vendorer 0.1.3 → 0.1.4
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/Gemfile.lock +1 -1
- data/Readme.md +3 -1
- data/lib/vendorer.rb +4 -1
- data/lib/vendorer/version.rb +1 -1
- data/spec/vendorer_spec.rb +20 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -22,6 +22,9 @@ Add a `Vendorfile` to your project root:
|
|
22
22
|
puts "Do something useful with #{path}"
|
23
23
|
end
|
24
24
|
|
25
|
+
# checkout a specific :ref/:tag/:branch
|
26
|
+
folder 'vendor/plugins/parallel_tests', 'https://github.com/grosser/parallel_tests.git', :tag => 'v0.6.10'
|
27
|
+
|
25
28
|
Call `vendorer`
|
26
29
|
|
27
30
|
If you added something new: `vendorer`
|
@@ -33,7 +36,6 @@ If you want to update one dependencies: `vendorer update public/javasctips/jquer
|
|
33
36
|
|
34
37
|
TODO
|
35
38
|
====
|
36
|
-
- git branch/commit support
|
37
39
|
- `folder 'vendor' do` which will remove everything that is not vendored via Vendorfile on `vendorer update` or `vendorer update vendor`
|
38
40
|
- nice error message when no Vendorfile was found
|
39
41
|
|
data/lib/vendorer.rb
CHANGED
@@ -15,10 +15,13 @@ class Vendorer
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def folder(path, url)
|
18
|
+
def folder(path, url, options={})
|
19
19
|
update_or_not path do
|
20
20
|
run "mkdir -p #{File.dirname(path)}"
|
21
21
|
run "git clone '#{url}' #{path}"
|
22
|
+
if commit = (options[:ref] || options[:tag] || options[:branch])
|
23
|
+
run "cd #{path} && git checkout '#{commit}'"
|
24
|
+
end
|
22
25
|
run "rm -rf #{path}/.git"
|
23
26
|
yield path if block_given?
|
24
27
|
end
|
data/lib/vendorer/version.rb
CHANGED
data/spec/vendorer_spec.rb
CHANGED
@@ -177,6 +177,26 @@ describe Vendorer do
|
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
|
+
describe "git options" do
|
181
|
+
it "can checkout by :ref" do
|
182
|
+
write 'Vendorfile', "folder 'its_recursive', '../../.git', :ref => 'b1e6460'"
|
183
|
+
run
|
184
|
+
read('its_recursive/Readme.md').should include('CODE EXAMPLE')
|
185
|
+
end
|
186
|
+
|
187
|
+
it "can checkout by :branch" do
|
188
|
+
write 'Vendorfile', "folder 'its_recursive', '../../.git', :branch => 'b1e6460'"
|
189
|
+
run
|
190
|
+
read('its_recursive/Readme.md').should include('CODE EXAMPLE')
|
191
|
+
end
|
192
|
+
|
193
|
+
it "can checkout by :tag" do
|
194
|
+
write 'Vendorfile', "folder 'its_recursive', '../../.git', :tag => 'b1e6460'"
|
195
|
+
run
|
196
|
+
read('its_recursive/Readme.md').should include('CODE EXAMPLE')
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
180
200
|
context "with a passed block" do
|
181
201
|
before do
|
182
202
|
write 'Vendorfile', "folder('its_recursive', '../../.git'){|path| puts 'THE PATH IS ' + path }"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vendorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -44,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
44
44
|
version: '0'
|
45
45
|
segments:
|
46
46
|
- 0
|
47
|
-
hash:
|
47
|
+
hash: -442641517
|
48
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
segments:
|
55
55
|
- 0
|
56
|
-
hash:
|
56
|
+
hash: -442641517
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
59
|
rubygems_version: 1.8.10
|