iruby-dependencies 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/iruby/dependencies/config.rb +3 -2
- data/lib/iruby/dependencies/version.rb +1 -1
- data/lib/iruby/dependencies.rb +7 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06994db526c0cc4552732ec1ad4f1b9a060a787d
|
4
|
+
data.tar.gz: dce88d5d259e11082f538a0df462bafc454f96cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5fa9fb4cff7898835c71163a793e4b1c68f9b97f1f487e148ff1a83ef927833c794885298a22307a43d228703edfa842575a003eda5ea6a255b68a396420cba
|
7
|
+
data.tar.gz: cd6f50c7e24341cd13f8b7544b3a02e7c21a92084474556d05cd8a93b21585cb6a5cc4b004439213a1b55f73a37b8336adadf7d83bae3456d4f81cef0d56288f
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# IRuby::Dependencies
|
2
2
|
|
3
|
-
IRuby::Dependencies is a module for injecting Ruby dependencies into Jupyter Notebooks. For example,
|
3
|
+
`IRuby::Dependencies` is a module for injecting Ruby dependencies into Jupyter Notebooks. For example,
|
4
4
|
|
5
5
|
```ruby
|
6
6
|
require 'iruby/dependencies'
|
@@ -21,14 +21,14 @@ You'll have to restart any IRuby kernels already running.
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
IRuby::Dependencies uses the [Bundler Gemfile syntax](http://bundler.io/v1.5/gemfile.html) with some additional methods:
|
24
|
+
`IRuby::Dependencies` uses the [Bundler Gemfile syntax](http://bundler.io/v1.5/gemfile.html) with some additional methods:
|
25
25
|
|
26
26
|
| Method | Description |
|
27
27
|
| ------ | ----------- |
|
28
28
|
| `script <url>` | Loads the javascript at the given url into the notebook as a `script` tag |
|
29
29
|
| `define <hash>` | Defines alternate paths for requirejs modules. Keys are modules, values are paths |
|
30
30
|
| `exec <string>` | Executes the system command, for example `yum install gsl` |
|
31
|
-
| `css
|
31
|
+
| `css <string>` | Loads the stylesheet at the given url into the notebook as a `link` tag
|
32
32
|
|
33
33
|
To see the normal bundler output, pass `verbose: true` to the dependencies method:
|
34
34
|
|
@@ -41,4 +41,4 @@ end
|
|
41
41
|
|
42
42
|
## Active Gems
|
43
43
|
|
44
|
-
|
44
|
+
When `IRuby::Dependencies` is first loaded, it saves a list of all active gems, which are added to the dependency bundle. For example, since IRuby uses multi_json, the multi_json gem is always included in the bundle. Active gems cannot be removed and their versions are fixed. If you need a different version of an active gem, install it on the command line and restart the kernel. To reduce the number of active gems, `require 'iruby/dependencies'` as early in your notebook as possible.
|
@@ -24,7 +24,8 @@ module IRuby
|
|
24
24
|
end
|
25
25
|
|
26
26
|
definition = builder.to_definition nil, true
|
27
|
-
|
27
|
+
definition.resolve_remotely!
|
28
|
+
|
28
29
|
definition.specs.each do |spec|
|
29
30
|
if commands = config.delete(spec.name)
|
30
31
|
commands.each do |command|
|
@@ -42,4 +43,4 @@ module IRuby
|
|
42
43
|
end
|
43
44
|
end
|
44
45
|
end
|
45
|
-
end
|
46
|
+
end
|
data/lib/iruby/dependencies.rb
CHANGED
@@ -3,6 +3,9 @@ require 'iruby/dependencies/dsl'
|
|
3
3
|
require 'iruby/dependencies/config'
|
4
4
|
require 'iruby/dependencies/version'
|
5
5
|
|
6
|
+
# require 'mypki' if requested so it is an active gem
|
7
|
+
require 'mypki' if Bundler.settings['dependencies.mypki']
|
8
|
+
|
6
9
|
module IRuby
|
7
10
|
module Dependencies
|
8
11
|
paths = Gem.path.map {|p| File.join p, 'gems'}
|
@@ -16,15 +19,10 @@ module IRuby
|
|
16
19
|
|
17
20
|
# this code is taken from bundler/inline with small changes
|
18
21
|
def self.dependencies verbose: false, &gemfile
|
19
|
-
warn 'Dependencies installing. This could take a minute ...'
|
20
|
-
|
21
22
|
Bundler.ui = verbose ? Bundler::UI::Shell.new : nil
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
MyPKI.init
|
26
|
-
end
|
27
|
-
|
23
|
+
MyPKI.init if Bundler.settings['dependencies.mypki']
|
24
|
+
|
25
|
+
warn 'Dependencies installing. This could take a minute ...'
|
28
26
|
old_root = Bundler.method(:root)
|
29
27
|
|
30
28
|
def Bundler.root
|
@@ -36,6 +34,7 @@ module IRuby
|
|
36
34
|
builder = Dsl.new
|
37
35
|
builder.instance_eval(&gemfile)
|
38
36
|
|
37
|
+
Gem::ConfigFile.new ['sources']
|
39
38
|
Gem.sources.each {|s| builder.source s}
|
40
39
|
|
41
40
|
ACTIVE_GEMS.each do |name,version|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iruby-dependencies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle King
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iruby
|