isolate 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +19 -1
- data/Rakefile +3 -0
- data/lib/hoe/isolate.rb +42 -0
- data/lib/isolate.rb +5 -3
- metadata +14 -1
data/CHANGELOG.rdoc
CHANGED
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -143,13 +143,31 @@ right below where <tt>boot.rb</tt> is required:
|
|
143
143
|
|
144
144
|
Pow. Isolated!
|
145
145
|
|
146
|
+
=== A Library Example
|
147
|
+
|
148
|
+
If you're using Hoe[http://blog.zenspider.com/hoe] to manage your
|
149
|
+
library, you can use Isolate's Hoe plugin to automatically install
|
150
|
+
your lib's development, runtime, and test dependencies without
|
151
|
+
polluting your system RubyGems, and run your tests/specs in total
|
152
|
+
isolation.
|
153
|
+
|
154
|
+
Assuming you have a recent Hoe and isolate's installed, it's as simple
|
155
|
+
as putting:
|
156
|
+
|
157
|
+
Hoe.plugin :isolate
|
158
|
+
|
159
|
+
before the <tt>Hoe.spec</tt> call in your <tt>Rakefile</tt>.
|
160
|
+
|
161
|
+
If you're not using Hoe, you can just do a regular
|
162
|
+
<tt>Isolate.gems</tt> block at the top of your Rakefile.
|
163
|
+
|
146
164
|
== Installation
|
147
165
|
|
148
166
|
$ gem install isolate
|
149
167
|
|
150
168
|
== License
|
151
169
|
|
152
|
-
Copyright 2009 John Barnette (jbarnette@rubyforge.org)
|
170
|
+
Copyright 2009 John Barnette, et al. (jbarnette@rubyforge.org)
|
153
171
|
|
154
172
|
Permission is hereby granted, free of charge, to any person obtaining
|
155
173
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -5,9 +5,12 @@ Hoe.plugin :doofus, :git
|
|
5
5
|
|
6
6
|
Hoe.spec "isolate" do
|
7
7
|
developer "John Barnette", "jbarnette@rubyforge.org"
|
8
|
+
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
8
9
|
|
9
10
|
self.extra_rdoc_files = Dir["*.rdoc"]
|
10
11
|
self.history_file = "CHANGELOG.rdoc"
|
11
12
|
self.readme_file = "README.rdoc"
|
12
13
|
self.testlib = :minitest
|
14
|
+
|
15
|
+
extra_dev_deps << ["minitest", "~> 1.4"]
|
13
16
|
end
|
data/lib/hoe/isolate.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "isolate"
|
3
|
+
|
4
|
+
module Hoe # :nodoc:
|
5
|
+
|
6
|
+
# This module is a Hoe plugin. You can set its attributes in your
|
7
|
+
# Rakefile's Hoe spec, like this:
|
8
|
+
#
|
9
|
+
# Hoe.plugin :isolate
|
10
|
+
#
|
11
|
+
# Hoe.spec "myproj" do
|
12
|
+
# self.isolate_dir = "tmp/isolated"
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# NOTE! The Isolate plugin is a little bit special: It messes with
|
16
|
+
# the plugin ordering to make sure that it comes before everything
|
17
|
+
# else.
|
18
|
+
|
19
|
+
module Isolate
|
20
|
+
|
21
|
+
# Where should Isolate, um, isolate? [default: <tt>"tmp/gems"</tt>]
|
22
|
+
|
23
|
+
attr_accessor :isolate_dir
|
24
|
+
|
25
|
+
def initialize_isolate # :nodoc:
|
26
|
+
# Tee hee! Move ourselves to the front to beat out :test.
|
27
|
+
Hoe.plugins.unshift Hoe.plugins.delete(:isolate)
|
28
|
+
self.isolate_dir ||= "tmp/gems"
|
29
|
+
end
|
30
|
+
|
31
|
+
def define_isolate_tasks # :nodoc:
|
32
|
+
i = Isolate.new self.isolate_dir
|
33
|
+
|
34
|
+
# TODO: consider sneakily adding test lib deps if they don't exist
|
35
|
+
(self.extra_deps + self.extra_dev_deps).each do |name, version|
|
36
|
+
i.gem name, *Array(version)
|
37
|
+
end
|
38
|
+
|
39
|
+
i.activate
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/isolate.rb
CHANGED
@@ -7,14 +7,16 @@ require "rubygems/requirement"
|
|
7
7
|
|
8
8
|
class Isolate
|
9
9
|
|
10
|
-
#
|
10
|
+
# An isolated Gem, with requirement, environment restrictions, and
|
11
|
+
# installation options. Internal use only.
|
12
|
+
|
11
13
|
class Entry < Struct.new(:name, :requirement, :environments, :options)
|
12
|
-
def matches? environment
|
14
|
+
def matches? environment # :nodoc:
|
13
15
|
environments.empty? || environments.include?(environment)
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
|
-
VERSION = "1.
|
19
|
+
VERSION = "1.2.0" # :nodoc:
|
18
20
|
|
19
21
|
attr_reader :entries # :nodoc:
|
20
22
|
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isolate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Barnette
|
8
|
+
- Ryan Davis
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -12,6 +13,16 @@ cert_chain: []
|
|
12
13
|
date: 2009-09-22 00:00:00 -07:00
|
13
14
|
default_executable:
|
14
15
|
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: minitest
|
18
|
+
type: :development
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ~>
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "1.4"
|
25
|
+
version:
|
15
26
|
- !ruby/object:Gem::Dependency
|
16
27
|
name: hoe
|
17
28
|
type: :development
|
@@ -46,6 +57,7 @@ description: |-
|
|
46
57
|
1.3.5.
|
47
58
|
email:
|
48
59
|
- jbarnette@rubyforge.org
|
60
|
+
- ryand-ruby@zenspider.com
|
49
61
|
executables: []
|
50
62
|
|
51
63
|
extensions: []
|
@@ -60,6 +72,7 @@ files:
|
|
60
72
|
- Manifest.txt
|
61
73
|
- README.rdoc
|
62
74
|
- Rakefile
|
75
|
+
- lib/hoe/isolate.rb
|
63
76
|
- lib/isolate.rb
|
64
77
|
- test/fixtures/with-hoe/specifications/hoe-2.3.3.gemspec
|
65
78
|
- test/fixtures/with-hoe/specifications/rake-0.8.7.gemspec
|