vendorer 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/Readme.md +8 -0
- data/lib/vendorer.rb +14 -14
- data/lib/vendorer/version.rb +1 -1
- data/spec/vendorer_spec.rb +31 -14
- metadata +5 -5
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -52,6 +52,14 @@ folder 'vendor/plugins/parallel_tests', 'https://github.com/grosser/parallel_tes
|
|
52
52
|
folder 'vendor/assets/javascripts' do
|
53
53
|
file 'jquery.js', 'http://code.jquery.com/jquery-latest.js'
|
54
54
|
end
|
55
|
+
|
56
|
+
# Copy files & folders from repos (also works with private repos)
|
57
|
+
from 'https://github.com/grosser/parallel_tests.git' do
|
58
|
+
file 'Readme.md'
|
59
|
+
file 'target-folder/file.rb', 'lib/parallel_tests.rb'
|
60
|
+
folder 'spec'
|
61
|
+
folder 'renamed-folder', 'spec'
|
62
|
+
end
|
55
63
|
```
|
56
64
|
<!-- extracted by vendorer init -->
|
57
65
|
|
data/lib/vendorer.rb
CHANGED
@@ -12,31 +12,31 @@ class Vendorer
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def file(path, url=nil)
|
15
|
-
|
16
|
-
update_or_not
|
17
|
-
run "mkdir -p #{File.dirname(
|
15
|
+
target_path = complete_path(path)
|
16
|
+
update_or_not target_path do
|
17
|
+
run "mkdir -p #{File.dirname(target_path)}"
|
18
18
|
if @copy_from_url
|
19
|
-
copy_from_path(
|
19
|
+
copy_from_path(target_path, url || path)
|
20
20
|
else
|
21
|
-
run "curl '#{url}' -L -o #{
|
22
|
-
raise "Downloaded empty file" unless File.exist?(
|
21
|
+
run "curl '#{url}' -L -o #{target_path}"
|
22
|
+
raise "Downloaded empty file" unless File.exist?(target_path)
|
23
23
|
end
|
24
|
-
yield
|
24
|
+
yield target_path if block_given?
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
def folder(path, url=nil, options={})
|
29
29
|
if @copy_from_path or url
|
30
|
-
|
31
|
-
update_or_not
|
32
|
-
run "rm -rf #{
|
33
|
-
run "mkdir -p #{File.dirname(
|
30
|
+
target_path = complete_path(path)
|
31
|
+
update_or_not target_path do
|
32
|
+
run "rm -rf #{target_path}"
|
33
|
+
run "mkdir -p #{File.dirname(target_path)}"
|
34
34
|
if @copy_from_path
|
35
|
-
copy_from_path(
|
35
|
+
copy_from_path(target_path, url || path)
|
36
36
|
else
|
37
|
-
download_repository(url,
|
37
|
+
download_repository(url, target_path, options)
|
38
38
|
end
|
39
|
-
yield
|
39
|
+
yield target_path if block_given?
|
40
40
|
end
|
41
41
|
else
|
42
42
|
@sub_path << path
|
data/lib/vendorer/version.rb
CHANGED
data/spec/vendorer_spec.rb
CHANGED
@@ -95,7 +95,7 @@ describe Vendorer do
|
|
95
95
|
write 'Vendorfile', "file 'xxx.js', 'http://NOTFOUND'"
|
96
96
|
result = vendorer '', :raise => true
|
97
97
|
# different errors on travis / local
|
98
|
-
raise result unless result.include?("
|
98
|
+
raise result unless result.include?("NOTFOUND") or result.include?('Downloaded empty file')
|
99
99
|
end
|
100
100
|
|
101
101
|
describe "with update" do
|
@@ -182,21 +182,21 @@ describe Vendorer do
|
|
182
182
|
|
183
183
|
it "can download from local" do
|
184
184
|
vendorer
|
185
|
-
ls('').should
|
185
|
+
ls('').should =~ ["its_recursive", "Vendorfile"]
|
186
186
|
read('its_recursive/Gemfile').should include('rake')
|
187
187
|
end
|
188
188
|
|
189
189
|
it "can handle a trailing slash" do
|
190
190
|
write 'Vendorfile', "folder 'its_recursive/', '../../.git'"
|
191
191
|
output = vendorer
|
192
|
-
ls('').should
|
192
|
+
ls('').should =~ ["its_recursive", "Vendorfile"]
|
193
193
|
read('its_recursive/Gemfile').should include('rake')
|
194
194
|
output.should_not include('//')
|
195
195
|
end
|
196
196
|
|
197
197
|
it "does not keep .git folder so everything can be checked in" do
|
198
198
|
vendorer
|
199
|
-
ls('its_recursive/.git').first.should
|
199
|
+
ls('its_recursive/.git').first.should =~ /cannot access|No such file or directory/
|
200
200
|
end
|
201
201
|
|
202
202
|
it "does not update an existing folder" do
|
@@ -474,7 +474,7 @@ describe Vendorer do
|
|
474
474
|
end
|
475
475
|
"
|
476
476
|
vendorer
|
477
|
-
ls(".").should
|
477
|
+
ls(".").should =~ ['Readme.md', 'Vendorfile']
|
478
478
|
end
|
479
479
|
|
480
480
|
it "copies to/from a nested location" do
|
@@ -484,8 +484,8 @@ describe Vendorer do
|
|
484
484
|
end
|
485
485
|
"
|
486
486
|
vendorer
|
487
|
-
ls(".").should
|
488
|
-
ls("./foo/bar").should
|
487
|
+
ls(".").should =~ ['foo', 'Vendorfile']
|
488
|
+
ls("./foo/bar").should =~ ['renamed.rb']
|
489
489
|
end
|
490
490
|
|
491
491
|
it "renames" do
|
@@ -495,7 +495,7 @@ describe Vendorer do
|
|
495
495
|
end
|
496
496
|
"
|
497
497
|
vendorer
|
498
|
-
ls(".").should
|
498
|
+
ls(".").should =~ ['Readme.renamed', 'Vendorfile']
|
499
499
|
end
|
500
500
|
end
|
501
501
|
|
@@ -507,8 +507,8 @@ describe Vendorer do
|
|
507
507
|
end
|
508
508
|
"
|
509
509
|
vendorer
|
510
|
-
ls(".").should
|
511
|
-
ls("./lib").should
|
510
|
+
ls(".").should =~ ['lib', 'Vendorfile']
|
511
|
+
ls("./lib").should =~ ['vendorer', 'vendorer.rb']
|
512
512
|
end
|
513
513
|
|
514
514
|
it "copies to/from a nested location" do
|
@@ -518,8 +518,8 @@ describe Vendorer do
|
|
518
518
|
end
|
519
519
|
"
|
520
520
|
vendorer
|
521
|
-
ls(".").should
|
522
|
-
ls("./foo/bar").should
|
521
|
+
ls(".").should =~ ['foo', 'Vendorfile']
|
522
|
+
ls("./foo/bar").should =~ ['version.rb']
|
523
523
|
end
|
524
524
|
|
525
525
|
it "renames" do
|
@@ -529,8 +529,25 @@ describe Vendorer do
|
|
529
529
|
end
|
530
530
|
"
|
531
531
|
vendorer
|
532
|
-
ls(".").should
|
533
|
-
ls("./foo").should
|
532
|
+
ls(".").should =~ ['foo', 'Vendorfile']
|
533
|
+
ls("./foo").should =~ ['vendorer', 'vendorer.rb']
|
534
|
+
end
|
535
|
+
end
|
536
|
+
|
537
|
+
context "with folder nesting" do
|
538
|
+
it "copies" do
|
539
|
+
write "Vendorfile", "
|
540
|
+
folder 'foo' do
|
541
|
+
from '../../.git' do
|
542
|
+
folder 'lib'
|
543
|
+
file 'Gemfile'
|
544
|
+
end
|
545
|
+
end
|
546
|
+
"
|
547
|
+
vendorer
|
548
|
+
ls(".").should =~ ['foo', 'Vendorfile']
|
549
|
+
ls("./foo").should =~ ['Gemfile', 'lib']
|
550
|
+
ls("./foo/lib").should =~ ['vendorer', 'vendorer.rb']
|
534
551
|
end
|
535
552
|
end
|
536
553
|
|
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.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: michael@grosser.it
|
@@ -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: 3814910532642010770
|
48
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
@@ -53,10 +53,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
segments:
|
55
55
|
- 0
|
56
|
-
hash:
|
56
|
+
hash: 3814910532642010770
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.8.
|
59
|
+
rubygems_version: 1.8.24
|
60
60
|
signing_key:
|
61
61
|
specification_version: 3
|
62
62
|
summary: Keep your vendor files up to date
|