vendorer 0.1.11 → 0.1.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vendorer (0.1.11)
4
+ vendorer (0.1.12)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
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
- path = complete_path(path)
16
- update_or_not path do
17
- run "mkdir -p #{File.dirname(path)}"
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(path, url)
19
+ copy_from_path(target_path, url || path)
20
20
  else
21
- run "curl '#{url}' -L -o #{path}"
22
- raise "Downloaded empty file" unless File.exist?(path)
21
+ run "curl '#{url}' -L -o #{target_path}"
22
+ raise "Downloaded empty file" unless File.exist?(target_path)
23
23
  end
24
- yield path if block_given?
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
- path = complete_path(path)
31
- update_or_not path do
32
- run "rm -rf #{path}"
33
- run "mkdir -p #{File.dirname(path)}"
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(path, url)
35
+ copy_from_path(target_path, url || path)
36
36
  else
37
- download_repository(url, path, options)
37
+ download_repository(url, target_path, options)
38
38
  end
39
- yield path if block_given?
39
+ yield target_path if block_given?
40
40
  end
41
41
  else
42
42
  @sub_path << path
@@ -1,3 +1,3 @@
1
1
  class Vendorer
2
- VERSION = '0.1.11'
2
+ VERSION = '0.1.12'
3
3
  end
@@ -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?("resolve host 'NOTFOUND'") or result.include?('Downloaded empty file')
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 == ["its_recursive", "Vendorfile"]
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 == ["its_recursive", "Vendorfile"]
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 include('cannot access')
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 == ['Readme.md', 'Vendorfile']
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 == ['foo', 'Vendorfile']
488
- ls("./foo/bar").should == ['renamed.rb']
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 == ['Readme.renamed', 'Vendorfile']
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 == ['lib', 'Vendorfile']
511
- ls("./lib").should == ['vendorer', 'vendorer.rb']
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 == ['foo', 'Vendorfile']
522
- ls("./foo/bar").should == ['version.rb']
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 == ['foo', 'Vendorfile']
533
- ls("./foo").should == ['vendorer', 'vendorer.rb']
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.11
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-04-06 00:00:00.000000000 Z
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: 1583849555704471697
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: 1583849555704471697
56
+ hash: 3814910532642010770
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 1.8.15
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