fake_gem 0.1.13 → 0.1.14
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.
- data/bin/fake_gem +2 -2
- data/lib/fake_gem.rb +1 -1
- data/readme.md +10 -6
- data/spec/fake_gem_spec.rb +5 -5
- metadata +2 -2
data/bin/fake_gem
CHANGED
@@ -42,6 +42,6 @@ fake_gem_paths = (fake_gem_paths + ARGV).uniq.join(':')
|
|
42
42
|
|
43
43
|
puts <<-TEXT
|
44
44
|
Please execute following commands or add it to Your bash profile:
|
45
|
-
RUBYOPT
|
46
|
-
FAKE_GEM_PATHS
|
45
|
+
export RUBYOPT="#{rubyopt}"
|
46
|
+
export FAKE_GEM_PATHS="#{fake_gem_paths}"
|
47
47
|
TEXT
|
data/lib/fake_gem.rb
CHANGED
@@ -101,7 +101,7 @@ unless defined?(FakeGem) or defined?(JRuby)
|
|
101
101
|
paths = paths.first if paths.first.is_a? Array
|
102
102
|
if paths.empty?
|
103
103
|
unless @paths
|
104
|
-
if env_paths = ENV['
|
104
|
+
if env_paths = ENV['FAKE_GEM_PATHS']
|
105
105
|
self.paths = env_paths.split(':')
|
106
106
|
else
|
107
107
|
self.paths = []
|
data/readme.md
CHANGED
@@ -18,12 +18,16 @@ Let's suppose Your projects are located in the /my_projects dir, and because You
|
|
18
18
|
|
19
19
|
You want lib1 and lib2 to be available as a gems while You are developing Your app, do following steps:
|
20
20
|
|
21
|
-
1
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
1 mark lib1 as fake_gem: create /projects/lib/fake_gem file and add there following lines:
|
22
|
+
|
23
|
+
name: lib1
|
24
|
+
libs: lib
|
25
|
+
|
26
|
+
2 do the same for lib2
|
27
|
+
|
28
|
+
3 enable fake_gem in current bash session, type:
|
29
|
+
|
30
|
+
$ fake_gem ~/projects
|
27
31
|
|
28
32
|
All done, now lib1 and lib2 will be availiable as real gems in ruby scripts.
|
29
33
|
No changes needed to source code, You can use real gems or fake gems - the application knows nothing about it.
|
data/spec/fake_gem_spec.rb
CHANGED
@@ -4,22 +4,22 @@ require "fake_gem"
|
|
4
4
|
describe FakeGem do
|
5
5
|
old_environment = nil
|
6
6
|
before do
|
7
|
-
old_environment = [$LOAD_PATH.clone, ENV['
|
7
|
+
old_environment = [$LOAD_PATH.clone, ENV['FAKE_GEM_PATHS']]
|
8
8
|
|
9
|
-
ENV['
|
9
|
+
ENV['FAKE_GEM_PATHS'] = nil
|
10
10
|
FakeGem.clear
|
11
11
|
end
|
12
12
|
|
13
13
|
after do
|
14
14
|
$LOAD_PATH.replace old_environment.first
|
15
|
-
ENV['
|
15
|
+
ENV['FAKE_GEM_PATHS'] = old_environment.last
|
16
16
|
end
|
17
17
|
|
18
|
-
it "should use
|
18
|
+
it "should use FAKE_GEM_PATHS environment variable or paths assigned to FakeGem::paths attribute" do
|
19
19
|
FakeGem.paths.should == []
|
20
20
|
|
21
21
|
FakeGem.clear
|
22
|
-
ENV['
|
22
|
+
ENV['FAKE_GEM_PATHS'] = "/first_path:/second_path"
|
23
23
|
FakeGem.paths.should == %w(/first_path /second_path)
|
24
24
|
|
25
25
|
FakeGem.paths '.'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-08-
|
13
|
+
date: 2011-08-07 00:00:00 +04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|