devpack 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d17e8b2f27d6bf6dc15ff37e549e3f97a3550339daa6fba5db14174483c2197
4
- data.tar.gz: e85c8dc654ae6fdf89c24ebaff90f0a14d2ae67b802b33a25430dde625c72a4b
3
+ metadata.gz: 7d0f6b9fad66aac0d4cbf7d9b2b0ce83de1b9ef159ce568ba74585e387d7ca49
4
+ data.tar.gz: c9e8dccdebba5fa96bd4e3437f526196ca0ca06f92e29f64c957aef252d24c98
5
5
  SHA512:
6
- metadata.gz: 6095f9fe4d862df8a9a50ceccc1de6415f95a3e7a6749fd10076ff05e22244f343364e23231bb0270af7a1d0b9c02b5e627b82f49775c1cfa95cea10dc3f3c58
7
- data.tar.gz: 79363c38a26853e07ef07ae3675ab867ce1d16bc52f1e31f6489ab1fd33e7cc09a45121a588c0b645a72a93c0adf1a0e5dfceb34424f0f1e5398d628e79f879e
6
+ metadata.gz: dc5fbfee439392e48cbad78dcc427969e3177e74c2d633869e73392c3f32c9e3890eed458e10e1dc40f49c01239711ee172c84941165ee778d59b726d394e05b
7
+ data.tar.gz: 8255b841d85e24b4b6a0cbf90c5f0d47612654360f3f64ea01e82b37c9dcaed74d0e4c09e0fd502edc95a514b362ba5c7c9c7c284bdd87fd499ff0c930e3d7bb
data/README.md CHANGED
@@ -8,7 +8,7 @@ Add the gem to your `Gemfile`:
8
8
 
9
9
  ```ruby
10
10
  group :development, :test do
11
- gem 'devpack', '~> 0.3.0'
11
+ gem 'devpack', '~> 0.3.1'
12
12
  end
13
13
  ```
14
14
 
@@ -31,6 +31,7 @@ module Devpack
31
31
  def load_gem(name, requirement)
32
32
  [name, activate(name, requirement)]
33
33
  rescue LoadError => e
34
+ deactivate(name)
34
35
  warn(Messages.failure(name, load_error_message(e)))
35
36
  nil
36
37
  end
@@ -38,13 +39,19 @@ module Devpack
38
39
  def activate(name, version)
39
40
  spec = GemSpec.new(@gem_glob, name, version)
40
41
  update_load_path(spec.require_paths)
41
- loaded = Kernel.require(name)
42
+ # NOTE: do this before we require, because some gems use the gemspec to
43
+ # declare their version...
42
44
  Gem.loaded_specs[name] = spec.gemspec
45
+ loaded = Kernel.require(name)
43
46
  spec.gemspec&.activated = true
44
47
  spec.gemspec&.instance_variable_set(:@loaded, true)
45
48
  loaded
46
49
  end
47
50
 
51
+ def deactivate(name)
52
+ Gem.loaded_specs.delete(name)
53
+ end
54
+
48
55
  def warn(message)
49
56
  Devpack.warn(message)
50
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devpack
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-05 00:00:00.000000000 Z
11
+ date: 2020-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug