iruby-dependencies 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d776a0bfc545dece58b742386bcee7eecb9c4069
4
- data.tar.gz: e71834db955a0085aafa2380abde5b25602294f3
3
+ metadata.gz: 06994db526c0cc4552732ec1ad4f1b9a060a787d
4
+ data.tar.gz: dce88d5d259e11082f538a0df462bafc454f96cd
5
5
  SHA512:
6
- metadata.gz: e8a0c38a50b91bb020a58987cc117756bcf18381045e0d646456a27fe07a6f24beea8f5899e0d350ea58fb4e12bfc175bbff39dd20dd36ccb275307d98fa4cd0
7
- data.tar.gz: 0be6783def0c53f6cf176225f14af3f9cec3de9371f8a5914e2ef2c93598014dccfa5aed2f2da6bba25e330178e3878567b3bee9fecc33e9596a78b43e6ccd7c
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` | Loads the stylesheet at the given url into the notebook as a `link` tag
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
- Gems active at the time IRuby::Dependencies are added to the dependency bundle. This means that you cannot specify a different version of a gem already being used by IRuby. If you really need a different version of that gem, install it on the command line and restart the kernel.
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
@@ -1,5 +1,5 @@
1
1
  module IRuby
2
2
  module Dependencies
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -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
- if Bundler.settings['dependencies.mypki']
24
- require 'mypki'
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.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-08 00:00:00.000000000 Z
11
+ date: 2016-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iruby