fake_gem 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/fake_gem.rb +10 -3
- data/readme.md +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -19,7 +19,7 @@ require 'fileutils'
|
|
19
19
|
|
20
20
|
spec = Gem::Specification.new do |s|
|
21
21
|
s.name = "fake_gem"
|
22
|
-
s.version = "0.1.
|
22
|
+
s.version = "0.1.2"
|
23
23
|
s.summary = "Makes any directory looks like Ruby Gem"
|
24
24
|
s.description = "Makes any directory looks like Ruby Gem"
|
25
25
|
s.author = "Alexey Petrushin"
|
data/lib/fake_gem.rb
CHANGED
@@ -40,6 +40,13 @@ unless defined? FakeGem
|
|
40
40
|
end
|
41
41
|
attr_writer :libs
|
42
42
|
|
43
|
+
def inspect
|
44
|
+
relative_libs = @libs.collect{|l| l.sub("#{@dir}/", '')}
|
45
|
+
"fake gem #{@dir} (#{relative_libs.join(', ')})"
|
46
|
+
end
|
47
|
+
alias_method :to_s, :inspect
|
48
|
+
|
49
|
+
|
43
50
|
protected
|
44
51
|
def should_exist file
|
45
52
|
raise "File #{file} not exist!" unless File.exist? file
|
@@ -74,16 +81,16 @@ unless defined? FakeGem
|
|
74
81
|
def activate path
|
75
82
|
found = nil
|
76
83
|
catch :found do
|
77
|
-
gems.
|
84
|
+
gems.each do |gem_spec|
|
78
85
|
gem_spec.libs.each do |lib_path|
|
79
86
|
if File.exist? "#{lib_path}/#{path}"
|
80
87
|
found = gem_spec
|
81
88
|
throw :found
|
82
89
|
end
|
83
90
|
end
|
84
|
-
end
|
91
|
+
end
|
85
92
|
end
|
86
|
-
|
93
|
+
|
87
94
|
if found
|
88
95
|
gems.delete found
|
89
96
|
found.libs.each do |lib_path|
|
data/readme.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
## Overview
|
4
4
|
|
5
|
-
Why?
|
5
|
+
Why? Because I want some of my projects be accessible as a gem, but without overhead like providing gem spec, rebuild and pushing it with every update.
|
6
6
|
I need only the most basic functional of gem system - automatic path resolving. And the **fake_gem** does exactly that.
|
7
7
|
|
8
8
|
**Note**: it's not a gem replacement, It's just a handy hack to simplify development in cases when you don't need all the gem power. At any time you
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexey Petrushin
|