isolate 3.5.1 → 4.1.0

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
  SHA256:
3
- metadata.gz: b2b55d89acb0e5982a52f30273070453a540483ea7c67572dcf356da83a63406
4
- data.tar.gz: cb87cf7176af4cf28030ec9b8f341d8c8e360b1ac3e8e72c22b24d031043cde9
3
+ metadata.gz: c2a467e9e408610841c7a0e325634737d817118e5aa2671dba34b29d9843b3b6
4
+ data.tar.gz: 1080df2b987c1513320006e3dab30a3b954bd04a6f552cb2aca39a26b90a717e
5
5
  SHA512:
6
- metadata.gz: '00971ffc02710b27fd3b582c9f5e15e27d26a59cea9467190c22da1e54fd6bdd84c03aad4c31382a0fc57b277efecbfb859f65c17cb4fba866d6e137871137da'
7
- data.tar.gz: a19cb7d860e05bd8b19a3bc74941e7777067c55b7a144c210061e165452a705abb3ebbec29700b037aba70dae246e393686152cf19a8c78480ca06d76c46b9c8
6
+ metadata.gz: 79d4b5e490c1941acb7118ddcc8a9200b497e67c2613c2b0e10e968abba171eef1fe6163526e622ab744ffd937102032095d4af1383e05b78a9933043c3598d1
7
+ data.tar.gz: 9a4a5ffb30492b5f25590e46f3e62461870c77077039d2b3e9607a31ea2125184a1f683f8f478c4fbf682628998beb64efc0bcd12a0a0e6902aec1c534c0c49b
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,33 @@
1
+ === 4.1.0 / 2025-12-25
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added hoe/isolate_binaries plugin to make it easier to deal with extensions.
6
+
7
+ * 4 bug fixes:
8
+
9
+ * Bump minitest to 6.0+.
10
+ * Bump ruby to 3.2+.
11
+ * Bump rubygems to 3.6+.
12
+ * Remove hoe-git dependency as it has been added to hoe.
13
+
14
+ === 4.0.0 / 2024-06-18
15
+
16
+ * 3 major enhancements:
17
+
18
+ * Bump required ruby to 2.7
19
+ * Remove Event and all `fire` calls
20
+ * Removed long deprecated Sandbox#index
21
+
22
+ * 1 minor enhancement:
23
+
24
+ * Added hoe spec accessor to set multiruby.
25
+
26
+ * 2 bug fixes:
27
+
28
+ * Fix Rakefile access to isolated gems (no longer versioned by default).
29
+ * Fix errors created when string literals are frozen.
30
+
1
31
  === 3.5.1 / 2022-06-14
2
32
 
3
33
  * 1 bug fix:
data/Manifest.txt CHANGED
@@ -4,10 +4,10 @@ Manifest.txt
4
4
  README.rdoc
5
5
  Rakefile
6
6
  lib/hoe/isolate.rb
7
+ lib/hoe/isolate_binaries.rb
7
8
  lib/isolate.rb
8
9
  lib/isolate/completely.rb
9
10
  lib/isolate/entry.rb
10
- lib/isolate/events.rb
11
11
  lib/isolate/now.rb
12
12
  lib/isolate/rake.rb
13
13
  lib/isolate/sandbox.rb
@@ -24,5 +24,4 @@ test/fixtures/with-hoe/specifications/rubyforge-1.0.4.gemspec
24
24
  test/isolate/test.rb
25
25
  test/test_isolate.rb
26
26
  test/test_isolate_entry.rb
27
- test/test_isolate_events.rb
28
27
  test/test_isolate_sandbox.rb
data/Rakefile CHANGED
@@ -4,12 +4,13 @@ require "hoe"
4
4
  $:.unshift "lib"
5
5
 
6
6
  ENV["GEM_PATH"] ||= ""
7
- ENV["GEM_PATH"] += ":#{Dir["tmp/isolate/ruby-*"].sort.last}"
7
+ ENV["GEM_PATH"] += ":tmp/isolate"
8
8
  Gem.paths = ENV
9
9
 
10
10
  require "isolate/rake"
11
11
 
12
- Hoe.plugin :isolate, :doofus, :git
12
+ Hoe.plugin :isolate_binaries # minitest -> prism
13
+ Hoe.plugin :git
13
14
  Hoe.plugin :minitest, :history, :email # from hoe-seattlerb - :perforce
14
15
 
15
16
  Hoe.spec "isolate" do
@@ -17,7 +18,8 @@ Hoe.spec "isolate" do
17
18
  developer "Eric Hodel", "drbrain@segment7.net"
18
19
  developer "John Barnette", "code@jbarnette.com"
19
20
 
20
- require_rubygems_version ">= 1.8.2"
21
+ require_ruby_version ">= 3.2"
22
+ require_rubygems_version "~> 3.6"
21
23
 
22
24
  self.extra_rdoc_files = Dir["*.rdoc"]
23
25
  self.history_file = "CHANGELOG.rdoc"
@@ -31,9 +33,7 @@ Hoe.spec "isolate" do
31
33
  rdoc_locations << "docs-push.seattlerb.org:#{base}/#{remote_rdoc_dir}"
32
34
 
33
35
  dependency "hoe-seattlerb", "~> 1.2", :development
34
- dependency "minitest", "~> 5.0", :development
35
- dependency "hoe-doofus", "~> 1.0", :development
36
- dependency "hoe-git", "~> 1.3", :development
36
+ dependency "minitest", "~> 6.0", :development
37
37
  dependency "ZenTest", "~> 4.5", :development
38
38
  end
39
39
 
data/lib/hoe/isolate.rb CHANGED
@@ -22,12 +22,14 @@ class Hoe # :nodoc:
22
22
  # FIX: consider removing this and allowing +isolate_options+ instead.
23
23
 
24
24
  attr_accessor :isolate_dir
25
+ attr_accessor :isolate_multiruby
25
26
 
26
27
  def initialize_isolate
27
28
  # Tee hee! Move ourselves to the front to beat out :test.
28
29
  Hoe.plugins.unshift Hoe.plugins.delete(:isolate)
29
30
 
30
31
  self.isolate_dir ||= "tmp/isolate"
32
+ self.isolate_multiruby ||= false
31
33
 
32
34
  ::Isolate.sandbox ||= ::Isolate::Sandbox.new
33
35
 
@@ -46,7 +48,9 @@ class Hoe # :nodoc:
46
48
  sandbox = ::Isolate.sandbox
47
49
 
48
50
  # reset, now that they've had a chance to change it
49
- sandbox.options :path => isolate_dir, :system => true
51
+ sandbox.options(:path => isolate_dir,
52
+ :multiruby => isolate_multiruby,
53
+ :system => true)
50
54
 
51
55
  task :isolate do
52
56
  self.extra_deps.each do |name, version|
@@ -0,0 +1,13 @@
1
+ Hoe.plugin :isolate
2
+
3
+ class Hoe
4
+ module IsolateBinaries
5
+ def define_isolate_binaries_tasks
6
+ # do nothing
7
+ end
8
+
9
+ def initialize_isolate_binaries
10
+ self.isolate_multiruby = true
11
+ end
12
+ end
13
+ end
data/lib/isolate/entry.rb CHANGED
@@ -1,4 +1,3 @@
1
- require "isolate/events"
2
1
  require "rubygems"
3
2
  require "rubygems/command"
4
3
  require "rubygems/dependency_installer"
@@ -8,13 +7,9 @@ require "rubygems/version"
8
7
  module Isolate
9
8
 
10
9
  # An isolated Gem, with requirement, environment restrictions, and
11
- # installation options. Generally intended for internal use. This
12
- # class exposes lifecycle events for extension, see Isolate::Events
13
- # for more information.
10
+ # installation options. Generally intended for internal use.
14
11
 
15
12
  class Entry
16
- include Events
17
-
18
13
  # Which environments does this entry care about? Generally an
19
14
  # Array of Strings. An empty array means "all", not "none".
20
15
 
@@ -62,38 +57,31 @@ module Isolate
62
57
  update(*requirements)
63
58
  end
64
59
 
65
- # Activate this entry. Fires <tt>:activating</tt> and
66
- # <tt>:activated</tt>.
60
+ # Activate this entry.
67
61
 
68
62
  def activate
69
- fire :activating, :activated do
70
- spec = self.specification
71
- raise Gem::LoadError, "Couldn't resolve: #{self}" unless spec
72
- spec.activate
73
- end
63
+ spec = self.specification
64
+ raise Gem::LoadError, "Couldn't resolve: #{self}" unless spec
65
+ spec.activate
74
66
  end
75
67
 
76
- # Install this entry in the sandbox. Fires <tt>:installing</tt>
77
- # and <tt>:installed</tt>.
68
+ # Install this entry in the sandbox.
78
69
 
79
70
  def install
80
71
  old = Gem.sources.dup
81
72
 
82
73
  begin
83
- fire :installing, :installed do
74
+ installer =
75
+ Gem::DependencyInstaller.new(:development => false,
76
+ :document => [],
77
+ :generate_rdoc => false,
78
+ :generate_ri => false,
79
+ :install_dir => @sandbox.path)
84
80
 
85
- installer =
86
- Gem::DependencyInstaller.new(:development => false,
87
- :document => [],
88
- :generate_rdoc => false,
89
- :generate_ri => false,
90
- :install_dir => @sandbox.path)
81
+ Gem::Command.build_args = Array(options[:args]) if options[:args]
82
+ Gem.sources += Array(options[:source]) if options[:source]
91
83
 
92
- Gem::Command.build_args = Array(options[:args]) if options[:args]
93
- Gem.sources += Array(options[:source]) if options[:source]
94
-
95
- installer.install @file || name, requirement
96
- end
84
+ installer.install @file || name, requirement
97
85
  ensure
98
86
  Gem.sources = old
99
87
  Gem::Command.build_args = nil
@@ -123,14 +111,12 @@ module Isolate
123
111
 
124
112
  # Updates this entry's environments, options, and
125
113
  # requirement. Environments and options are merged, requirement is
126
- # replaced. Fires <tt>:updating</tt> and <tt>:updated</tt>.
114
+ # replaced.
127
115
 
128
116
  def update *reqs
129
- fire :updating, :updated do
130
- @environments |= @sandbox.environments
131
- @options.merge! reqs.pop if Hash === reqs.last
132
- @requirement = Gem::Requirement.new reqs unless reqs.empty?
133
- end
117
+ @environments |= @sandbox.environments
118
+ @options.merge! reqs.pop if Hash === reqs.last
119
+ @requirement = Gem::Requirement.new reqs unless reqs.empty?
134
120
 
135
121
  self
136
122
  end
@@ -1,10 +1,8 @@
1
1
  require "fileutils"
2
2
  require "isolate/entry"
3
- require "isolate/events"
4
3
  require "rbconfig"
5
4
  require "rubygems/defaults"
6
5
  require "rubygems/uninstaller"
7
- require "rubygems/deprecate"
8
6
 
9
7
  # disable default gems getting in the way of everything.
10
8
 
@@ -19,13 +17,10 @@ end
19
17
 
20
18
  module Isolate
21
19
 
22
- # An isolated environment. This class exposes lifecycle events for
23
- # extension, see Isolate::Events for more information.
20
+ # An isolated environment.
24
21
 
25
22
  class Sandbox
26
- include Events
27
-
28
- DEFAULT_PATH = "tmp/isolate" # :nodoc:
23
+ DEFAULT_PATH = +"tmp/isolate" # :nodoc:
29
24
 
30
25
  attr_reader :entries # :nodoc:
31
26
  attr_reader :environments # :nodoc:
@@ -33,8 +28,7 @@ module Isolate
33
28
 
34
29
  # Create a new Isolate::Sandbox instance. See Isolate.now! for the
35
30
  # most common use of the API. You probably don't want to use this
36
- # constructor directly. Fires <tt>:initializing</tt> and
37
- # <tt>:initialized</tt>.
31
+ # constructor directly.
38
32
 
39
33
  def initialize options = {}, &block
40
34
  @enabled = false
@@ -48,8 +42,6 @@ module Isolate
48
42
  raise ArgumentError, "can't specify both name and path!" if name && path
49
43
  options[:path] = File.expand_path("~/.gem/repos/#{name}") if name
50
44
 
51
- fire :initializing
52
-
53
45
  user = File.expand_path "~/.isolate/user.rb"
54
46
  load user if File.exist? user
55
47
 
@@ -63,13 +55,11 @@ module Isolate
63
55
  load file if file
64
56
 
65
57
  if block_given?
66
- /\@(.+?):\d+/ =~ block.to_s
67
- files << ($1 || "inline block")
58
+ files << (block.to_s[/ (\/.+):\d+/, 1] || "inline block")
68
59
  instance_eval(&block)
69
60
  end
70
61
 
71
62
  load local if local && File.exist?(local)
72
- fire :initialized
73
63
  end
74
64
 
75
65
  # Activate this set of isolated entries, respecting an optional
@@ -78,12 +68,10 @@ module Isolate
78
68
  # everything, and removes any superfluous gem (again, if
79
69
  # necessary). If +environment+ isn't specified, +ISOLATE_ENV+,
80
70
  # +RAILS_ENV+, and +RACK_ENV+ are checked before falling back to
81
- # <tt>"development"</tt>. Fires <tt>:activating</tt> and
82
- # <tt>:activated</tt>.
71
+ # <tt>"development"</tt>.
83
72
 
84
73
  def activate environment = nil
85
74
  enable unless enabled?
86
- fire :activating
87
75
 
88
76
  env = (environment || Isolate.env).to_s
89
77
 
@@ -94,14 +82,11 @@ module Isolate
94
82
  end
95
83
 
96
84
  cleanup if cleanup?
97
- fire :activated
98
85
 
99
86
  self
100
87
  end
101
88
 
102
89
  def cleanup # :nodoc:
103
- fire :cleaning
104
-
105
90
  gem_dir = Gem.dir
106
91
 
107
92
  global, local = Gem::Specification.partition { |s| s.base_dir != gem_dir }
@@ -109,17 +94,14 @@ module Isolate
109
94
  extra = (local - legit) + (local & global)
110
95
 
111
96
  self.remove(*extra)
112
-
113
- fire :cleaned
114
97
  end
115
98
 
116
99
  def cleanup?
117
100
  install? and @options.fetch(:cleanup, true)
118
101
  end
119
102
 
120
- def disable &block
121
- return self if not enabled?
122
- fire :disabling
103
+ def disable
104
+ return self unless enabled?
123
105
 
124
106
  ENV.replace @old_env
125
107
  $LOAD_PATH.replace @old_load_path
@@ -127,16 +109,20 @@ module Isolate
127
109
  @enabled = false
128
110
 
129
111
  Isolate.refresh
130
- fire :disabled
131
112
 
132
- begin; return yield ensure enable end if block_given?
113
+ if block_given? then
114
+ begin
115
+ return yield
116
+ ensure
117
+ enable
118
+ end
119
+ end
133
120
 
134
121
  self
135
122
  end
136
123
 
137
124
  def enable # :nodoc:
138
125
  return self if enabled?
139
- fire :enabling
140
126
 
141
127
  @old_env = ENV.to_hash
142
128
  @old_load_path = $LOAD_PATH.dup
@@ -149,12 +135,13 @@ module Isolate
149
135
  unless system?
150
136
  isolate_lib = File.expand_path "../..", __FILE__
151
137
 
152
- # manually deactivate pre-isolate gems...
153
- $LOAD_PATH.reject! { |lpath|
138
+ $LOAD_PATH.reject! { |lpath| # manually deactivate pre-isolate gems...
154
139
  (lpath.start_with?("/") && # only full paths
155
140
  lpath.end_with?("/lib") && # and that end in lib
156
- lpath != isolate_lib &&
157
- Gem.path.reject(&:empty?).any? { |gem_path| lpath.include?(gem_path) })
141
+ lpath != isolate_lib && # that aren't us
142
+ Gem.path.reject(&:empty?).any? { |gem_path|
143
+ lpath.include?(gem_path) # and are included in a gem's path(?)
144
+ })
158
145
  }
159
146
 
160
147
  # HACK: Gotta keep isolate explicitly in the LOAD_PATH in
@@ -183,7 +170,6 @@ module Isolate
183
170
  Isolate.refresh
184
171
 
185
172
  @enabled = true
186
- fire :enabled
187
173
 
188
174
  self
189
175
  end
@@ -217,20 +203,10 @@ module Isolate
217
203
  entry
218
204
  end
219
205
 
220
- # A source index representing only isolated gems.
221
-
222
- def index
223
- @index ||= Gem::SourceIndex.from_gems_in File.join(path, "specifications")
224
- end
225
-
226
206
  def install environment # :nodoc:
227
- fire :installing
228
-
229
207
  install_missing environment
230
208
  rebuild_extensions
231
209
 
232
- fire :installed
233
-
234
210
  self
235
211
  end
236
212
 
@@ -367,9 +343,5 @@ module Isolate
367
343
 
368
344
  specs.uniq
369
345
  end
370
-
371
- dep_module = defined?(Gem::Deprecate) ? Gem::Deprecate : Deprecate
372
- extend dep_module
373
- deprecate :index, :none, 2011, 11
374
346
  end
375
347
  end
data/lib/isolate.rb CHANGED
@@ -8,7 +8,7 @@ module Isolate
8
8
 
9
9
  # Duh.
10
10
 
11
- VERSION = "3.5.1"
11
+ VERSION = "4.1.0"
12
12
 
13
13
  # Disable Isolate. If a block is provided, isolation will be
14
14
  # disabled for the scope of the block.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,20 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isolate
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
8
  - Eric Hodel
9
9
  - John Barnette
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain:
13
12
  - |
14
13
  -----BEGIN CERTIFICATE-----
15
- MIIDPjCCAiagAwIBAgIBBjANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
+ MIIDPjCCAiagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
16
15
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
17
- GRYDY29tMB4XDTIxMTIyMzIzMTkwNFoXDTIyMTIyMzIzMTkwNFowRTETMBEGA1UE
16
+ GRYDY29tMB4XDTI1MDEwNjIzMjcwMVoXDTI2MDEwNjIzMjcwMVowRTETMBEGA1UE
18
17
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
19
18
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
20
19
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -24,14 +23,14 @@ cert_chain:
24
23
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
25
24
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
26
25
  HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
27
- AQCKB5jfsuSnKb+t/Wrh3UpdkmX7TrEsjVmERC0pPqzQ5GQJgmEXDD7oMgaKXaAq
28
- x2m+KSZDrqk7c8uho5OX6YMqg4KdxehfSLqqTZGoeV78qwf/jpPQZKTf+W9gUSJh
29
- zsWpo4K50MP+QtdSbKXZwjAafpQ8hK0MnnZ/aeCsW9ov5vdXpYbf3dpg6ADXRGE7
30
- lQY2y1tJ5/chqu6h7dQmnm2ABUqx9O+JcN9hbCYoA5i/EeubUEtFIh2w3SpO6YfB
31
- JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
32
- YsuyUzsMz6GQA4khyaMgKNSD
26
+ AQAC0WQJcPOWPFwkojhzweilRVjTJ19UiLhiBTw3C1wJO3LVdBkWDmnnhAmKuX4D
27
+ r7vjQvESlABGIPdutI1Yl7mrHQzTkfLfXvNN6MT0nLChPyIYauT6SZZxubwJrUfA
28
+ 7R0c2CJTIboZ0XaGpLsXqHEF1c29H7TV1QvVuqKAN2mCjh4N82QVn+ZKtys28AwT
29
+ 6GfQX2fqLoi4KSc7xIzHKaNzqxeOICmJofk9w5VZ2rRN6yes8jvFYwz9HR41wdj8
30
+ bwfinv7Yp5fA6AysuZLhCykyfDuZVRrUp0Vb68YCKsLjJly/Theak+euNTxvHsB+
31
+ al9oSgPPHICMEX65qvLywitx
33
32
  -----END CERTIFICATE-----
34
- date: 2022-06-15 00:00:00.000000000 Z
33
+ date: 1980-01-02 00:00:00.000000000 Z
35
34
  dependencies:
36
35
  - !ruby/object:Gem::Dependency
37
36
  name: hoe-seattlerb
@@ -53,42 +52,14 @@ dependencies:
53
52
  requirements:
54
53
  - - "~>"
55
54
  - !ruby/object:Gem::Version
56
- version: '5.0'
55
+ version: '6.0'
57
56
  type: :development
58
57
  prerelease: false
59
58
  version_requirements: !ruby/object:Gem::Requirement
60
59
  requirements:
61
60
  - - "~>"
62
61
  - !ruby/object:Gem::Version
63
- version: '5.0'
64
- - !ruby/object:Gem::Dependency
65
- name: hoe-doofus
66
- requirement: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: '1.0'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.0'
78
- - !ruby/object:Gem::Dependency
79
- name: hoe-git
80
- requirement: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.3'
85
- type: :development
86
- prerelease: false
87
- version_requirements: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '1.3'
62
+ version: '6.0'
92
63
  - !ruby/object:Gem::Dependency
93
64
  name: ZenTest
94
65
  requirement: !ruby/object:Gem::Requirement
@@ -109,34 +80,34 @@ dependencies:
109
80
  requirements:
110
81
  - - ">="
111
82
  - !ruby/object:Gem::Version
112
- version: '4.0'
83
+ version: '6.0'
113
84
  - - "<"
114
85
  - !ruby/object:Gem::Version
115
- version: '7'
86
+ version: '8'
116
87
  type: :development
117
88
  prerelease: false
118
89
  version_requirements: !ruby/object:Gem::Requirement
119
90
  requirements:
120
91
  - - ">="
121
92
  - !ruby/object:Gem::Version
122
- version: '4.0'
93
+ version: '6.0'
123
94
  - - "<"
124
95
  - !ruby/object:Gem::Version
125
- version: '7'
96
+ version: '8'
126
97
  - !ruby/object:Gem::Dependency
127
98
  name: hoe
128
99
  requirement: !ruby/object:Gem::Requirement
129
100
  requirements:
130
101
  - - "~>"
131
102
  - !ruby/object:Gem::Version
132
- version: '3.23'
103
+ version: '4.5'
133
104
  type: :development
134
105
  prerelease: false
135
106
  version_requirements: !ruby/object:Gem::Requirement
136
107
  requirements:
137
108
  - - "~>"
138
109
  - !ruby/object:Gem::Version
139
- version: '3.23'
110
+ version: '4.5'
140
111
  description: |-
141
112
  Isolate is a very simple RubyGems sandbox. It provides a way to
142
113
  express and automatically install your project's Gem dependencies.
@@ -157,10 +128,10 @@ files:
157
128
  - README.rdoc
158
129
  - Rakefile
159
130
  - lib/hoe/isolate.rb
131
+ - lib/hoe/isolate_binaries.rb
160
132
  - lib/isolate.rb
161
133
  - lib/isolate/completely.rb
162
134
  - lib/isolate/entry.rb
163
- - lib/isolate/events.rb
164
135
  - lib/isolate/now.rb
165
136
  - lib/isolate/rake.rb
166
137
  - lib/isolate/sandbox.rb
@@ -177,14 +148,12 @@ files:
177
148
  - test/isolate/test.rb
178
149
  - test/test_isolate.rb
179
150
  - test/test_isolate_entry.rb
180
- - test/test_isolate_events.rb
181
151
  - test/test_isolate_sandbox.rb
182
152
  homepage: http://github.com/jbarnette/isolate
183
153
  licenses:
184
154
  - MIT
185
155
  metadata:
186
156
  homepage_uri: http://github.com/jbarnette/isolate
187
- post_install_message:
188
157
  rdoc_options:
189
158
  - "--main"
190
159
  - README.rdoc
@@ -194,15 +163,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
163
  requirements:
195
164
  - - ">="
196
165
  - !ruby/object:Gem::Version
197
- version: '0'
166
+ version: '3.2'
198
167
  required_rubygems_version: !ruby/object:Gem::Requirement
199
168
  requirements:
200
- - - ">="
169
+ - - "~>"
201
170
  - !ruby/object:Gem::Version
202
- version: 1.8.2
171
+ version: '3.6'
203
172
  requirements: []
204
- rubygems_version: 3.3.12
205
- signing_key:
173
+ rubygems_version: 3.7.2
206
174
  specification_version: 4
207
175
  summary: Isolate is a very simple RubyGems sandbox
208
176
  test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,42 +0,0 @@
1
- module Isolate
2
-
3
- # A simple way to watch and extend the Isolate lifecycle.
4
- #
5
- # Isolate::Events.watch Isolate::Sandbox, :initialized do |sandbox|
6
- # puts "A sandbox just got initialized: #{sandbox}"
7
- # end
8
- #
9
- # Read the source for Isolate::Sandbox and Isolate::Entry to see
10
- # what sort of events are fired.
11
-
12
- module Events
13
-
14
- # Watch for an event called +name+ from an instance of
15
- # +klass+. +block+ will be called when the event occurs. Block
16
- # args vary by event, but usually an instance of the relevant
17
- # class is passed.
18
-
19
- def self.watch klass, name, &block
20
- watchers[[klass, name]] << block
21
- end
22
-
23
- def self.fire klass, name, *args #:nodoc:
24
- watchers[[klass, name]].each do |block|
25
- block[*args]
26
- end
27
- end
28
-
29
- def self.watchers #:nodoc:
30
- @watchers ||= Hash.new { |h, k| h[k] = [] }
31
- end
32
-
33
- def fire name, after = nil, *args, &block #:nodoc:
34
- Isolate::Events.fire self.class, name, self, *args
35
-
36
- if after && block_given?
37
- yield self
38
- Isolate::Events.fire self.class, after, *args
39
- end
40
- end
41
- end
42
- end
@@ -1,44 +0,0 @@
1
- require "isolate/events"
2
- require "isolate/test"
3
-
4
- class TestIsolateEvents < Isolate::Test
5
- include Isolate::Events
6
-
7
- def setup
8
- Isolate::Events.watchers.clear
9
- super
10
- end
11
-
12
- def test_self_watch
13
- b = lambda {}
14
- Isolate::Events.watch String, :foo, &b
15
- assert_equal [b], Isolate::Events.watchers[[String, :foo]]
16
- end
17
-
18
- def test_fire
19
- count = 0
20
-
21
- Isolate::Events.watch self.class, :increment do
22
- count += 1
23
- end
24
-
25
- fire :increment
26
- assert_equal 1, count
27
- end
28
-
29
- def test_fire_block
30
- count = 0
31
-
32
- [:increment, :incremented].each do |name|
33
- Isolate::Events.watch self.class, name do
34
- count += 1
35
- end
36
- end
37
-
38
- fire :increment, :incremented do |x|
39
- assert_same self, x
40
- end
41
-
42
- assert_equal 2, count
43
- end
44
- end