{"action":"created","issue":{"url":"https://api.github.com/repos/scriptcs/scriptcs/issues/928","labels_url":"https://api.github.com/repos/scriptcs/scriptcs/issues/928/labels{/name}","comments_url":"https://api.github.com/repos/scriptcs/scriptcs/issues/928/comments","events_url":"https://api.github.com/repos/scriptcs/scriptcs/issues/928/events","html_url":"https://github.com/scriptcs/scriptcs/pull/928","id":57285197,"number":928,"title":"Introduces the ability to author, package, and consume Script Libraries ","user":{"login":"glennblock","id":141124,"avatar_url":"https://avatars.githubusercontent.com/u/141124?v=3","gravatar_id":"","url":"https://api.github.com/users/glennblock","html_url":"https://github.com/glennblock","followers_url":"https://api.github.com/users/glennblock/followers","following_url":"https://api.github.com/users/glennblock/following{/other_user}","gists_url":"https://api.github.com/users/glennblock/gists{/gist_id}","starred_url":"https://api.github.com/users/glennblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennblock/subscriptions","organizations_url":"https://api.github.com/users/glennblock/orgs","repos_url":"https://api.github.com/users/glennblock/repos","events_url":"https://api.github.com/users/glennblock/events{/privacy}","received_events_url":"https://api.github.com/users/glennblock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scriptcs/scriptcs/labels/child%20PR","name":"child PR","color":"eeeeee"}],"state":"open","locked":false,"assignee":{"login":"adamralph","id":677704,"avatar_url":"https://avatars.githubusercontent.com/u/677704?v=3","gravatar_id":"","url":"https://api.github.com/users/adamralph","html_url":"https://github.com/adamralph","followers_url":"https://api.github.com/users/adamralph/followers","following_url":"https://api.github.com/users/adamralph/following{/other_user}","gists_url":"https://api.github.com/users/adamralph/gists{/gist_id}","starred_url":"https://api.github.com/users/adamralph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamralph/subscriptions","organizations_url":"https://api.github.com/users/adamralph/orgs","repos_url":"https://api.github.com/users/adamralph/repos","events_url":"https://api.github.com/users/adamralph/events{/privacy}","received_events_url":"https://api.github.com/users/adamralph/received_events","type":"User","site_admin":false},"milestone":null,"comments":20,"created_at":"2015-02-11T07:35:53Z","updated_at":"2015-02-28T10:35:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scriptcs/scriptcs/pulls/928","html_url":"https://github.com/scriptcs/scriptcs/pull/928","diff_url":"https://github.com/scriptcs/scriptcs/pull/928.diff","patch_url":"https://github.com/scriptcs/scriptcs/pull/928.patch"},"body":"... up in NuGet packages\r\n\r\n_The future is here_\r\n\r\nThis addresses #909 and #238. It also fixes #935 which was causing ScriptLibrary acceptance tests on TeamCity / Mono to fail.\r\n\r\nWith this PR, you can author a Script Library as a set of csx files which you then package up in a NuGet package. The packages are kind of the scriptcs equivalent of source packages. You can then install the package and use it within a script. \r\n\r\nWithin the package, the scripts must be in a content/scriptcs folder. Each script must also be added to the nuspec file as a file entry. The packs are not accessed via Require<T>, instead they are simply newed up.\r\n\r\nFor an example showing all the files in a Script Library, see this [gist] (https://gist.github.com/glennblock/c39cd3ed98ecb4e2d020)\r\n\r\nNotice it depends on another script pack, `ScriptCs.Logger` which is required. \r\n\r\nOnce the package is created i.e. `ScriptCs.Calculator.0.1.0.nupkg` and placed one of your NuGet sources it can be installed with `scriptcs install`. \r\n\r\nHere is client code that can then use the Script Library:\r\n\r\n```csharp\r\nvar calc = new Calculator();\r\nvar result = calc.Add(5,2);\r\nConsole.WriteLine(result);\r\nConsole.ReadLine();\r\n```\r\n\r\nA few constraints / notes:\r\n\r\n* You cannot have loose code in your package script. It must be contained within a method. This is because your script is packaged up inside of a wrapper class.\r\n* You must have an entry level script with the format of XXXMain.csx i.e. CalculatorMain.csx in the example.\r\n* You can use Require<T>. To do so create an instance field and then use Require. Require<T> is a static method in this context so it will work.\r\n* You can use #load and #r. For example in the gist you can see I have `#load Multiply.csx` which loads up the file which contains the Multiply method and includes it. \r\n\r\nYou can read more in the design doc [here] (https://github.com/scriptcs/scriptcs/wiki/Script-Libraries)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/scriptcs/scriptcs/issues/comments/76520760","html_url":"https://github.com/scriptcs/scriptcs/pull/928#issuecomment-76520760","issue_url":"https://api.github.com/repos/scriptcs/scriptcs/issues/928","id":76520760,"user":{"login":"glennblock","id":141124,"avatar_url":"https://avatars.githubusercontent.com/u/141124?v=3","gravatar_id":"","url":"https://api.github.com/users/glennblock","html_url":"https://github.com/glennblock","followers_url":"https://api.github.com/users/glennblock/followers","following_url":"https://api.github.com/users/glennblock/following{/other_user}","gists_url":"https://api.github.com/users/glennblock/gists{/gist_id}","starred_url":"https://api.github.com/users/glennblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennblock/subscriptions","organizations_url":"https://api.github.com/users/glennblock/orgs","repos_url":"https://api.github.com/users/glennblock/repos","events_url":"https://api.github.com/users/glennblock/events{/privacy}","received_events_url":"https://api.github.com/users/glennblock/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T10:35:22Z","updated_at":"2015-02-28T10:35:22Z","body":"@paulbouwer this should be fixed now. It will work if you are passing a non-rooted path. I have added an acceptance test which verifies this. Also REPL support is now in also with an acceptance test."}}