vendorer 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vendorer (0.1.9)
4
+ vendorer (0.1.10)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  class Vendorer
2
- VERSION = '0.1.9'
2
+ VERSION = '0.1.10'
3
3
  end
data/lib/vendorer.rb CHANGED
@@ -7,7 +7,7 @@ class Vendorer
7
7
  end
8
8
 
9
9
  def parse(content)
10
- eval(content)
10
+ eval(content, nil, 'Vendorfile', 1)
11
11
  end
12
12
 
13
13
  def file(path, url)
@@ -82,6 +82,6 @@ class Vendorer
82
82
  end
83
83
 
84
84
  def complete_path(path)
85
- (@sub_path + [path]).join('/')
85
+ File.join(@sub_path + [path])
86
86
  end
87
87
  end
@@ -186,6 +186,14 @@ describe Vendorer do
186
186
  read('its_recursive/Gemfile').should include('rake')
187
187
  end
188
188
 
189
+ it "can handle a trailing slash" do
190
+ write 'Vendorfile', "folder 'its_recursive/', '../../.git'"
191
+ output = vendorer
192
+ ls('').should == ["its_recursive", "Vendorfile"]
193
+ read('its_recursive/Gemfile').should include('rake')
194
+ output.should_not include('//')
195
+ end
196
+
189
197
  it "does not keep .git folder so everything can be checked in" do
190
198
  vendorer
191
199
  ls('its_recursive/.git').first.should include('cannot access')
@@ -303,6 +311,13 @@ describe Vendorer do
303
311
  vendorer
304
312
  read('public/javascripts/jquery.js').should include('jQuery')
305
313
  end
314
+
315
+ it "can handle trailing slash" do
316
+ write 'Vendorfile', read('Vendorfile').sub("javascripts' do", "javascripts/' do")
317
+ output = vendorer
318
+ read('public/javascripts/jquery.js').should include('jQuery')
319
+ output.should_not include('//')
320
+ end
306
321
  end
307
322
 
308
323
  context "submodules" do
@@ -381,6 +396,12 @@ describe Vendorer do
381
396
  v.parse '$test = self'
382
397
  $test.should == v
383
398
  end
399
+
400
+ it "fails with a nice backtrace" do
401
+ write 'Vendorfile', "\n\nfile 'XXX'\n\n"
402
+ output = vendorer '', :raise => true
403
+ output.should include("from Vendorfile:3:in `parse")
404
+ end
384
405
  end
385
406
 
386
407
  describe "#init" do
@@ -389,29 +410,35 @@ describe Vendorer do
389
410
  read("Vendorfile").should include("folder")
390
411
  end
391
412
 
392
- it "creates a Vendorfile via ruby" do
393
- Vendorer.new('init').init
394
- read("Vendorfile").should include("folder")
395
- end
413
+ context "from ruby" do
414
+ before do
415
+ Dir.chdir '../../' if RUBY_VERSION < '1.9'
416
+ end
396
417
 
397
- it "created Vendorfile contains commented out examples" do
398
- Vendorer.new('init').init
399
- read("Vendorfile").split("\n").each{|l| l.should =~ /^(#|\s*$)/ }
400
- end
418
+ it "creates a Vendorfile via ruby" do
419
+ Vendorer.new('init').init
420
+ read("Vendorfile").should include("folder")
421
+ end
401
422
 
402
- it "created Vendorfile contains many examples" do
403
- Vendorer.new('init').init
404
- read("Vendorfile").should include("folder 'vendor/")
405
- read("Vendorfile").should include("file 'vendor/")
406
- read("Vendorfile").should include("rewrite(path)")
407
- end
423
+ it "created Vendorfile contains commented out examples" do
424
+ Vendorer.new('init').init
425
+ read("Vendorfile").split("\n").each{|l| l.should =~ /^(#|\s*$)/ }
426
+ end
408
427
 
409
- it "created Vendorfile does not contain other instructions" do
410
- Vendorer.new('init').init
411
- read("Vendorfile").should_not include("vendorer init")
412
- read("Vendorfile").should_not include("Gemfile")
413
- read("Vendorfile").should_not include("gem install")
414
- read("Vendorfile").should_not include("```")
428
+ it "created Vendorfile contains many examples" do
429
+ Vendorer.new('init').init
430
+ read("Vendorfile").should include("folder 'vendor/")
431
+ read("Vendorfile").should include("file 'vendor/")
432
+ read("Vendorfile").should include("rewrite(path)")
433
+ end
434
+
435
+ it "created Vendorfile does not contain other instructions" do
436
+ Vendorer.new('init').init
437
+ read("Vendorfile").should_not include("vendorer init")
438
+ read("Vendorfile").should_not include("Gemfile")
439
+ read("Vendorfile").should_not include("gem install")
440
+ read("Vendorfile").should_not include("```")
441
+ end
415
442
  end
416
443
  end
417
444
  end
metadata CHANGED
@@ -1,23 +1,32 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: vendorer
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.9
3
+ version: !ruby/object:Gem::Version
4
+ hash: 15
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 10
10
+ version: 0.1.10
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Michael Grosser
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-01-12 00:00:00.000000000 Z
17
+
18
+ date: 2012-02-28 00:00:00 Z
13
19
  dependencies: []
20
+
14
21
  description:
15
22
  email: michael@grosser.it
16
- executables:
23
+ executables:
17
24
  - vendorer
18
25
  extensions: []
26
+
19
27
  extra_rdoc_files: []
20
- files:
28
+
29
+ files:
21
30
  - .travis.yml
22
31
  - Gemfile
23
32
  - Gemfile.lock
@@ -30,34 +39,37 @@ files:
30
39
  - spec/vendorer_spec.rb
31
40
  - vendorer.gemspec
32
41
  homepage: http://github.com/grosser/vendorer
33
- licenses:
42
+ licenses:
34
43
  - MIT
35
44
  post_install_message:
36
45
  rdoc_options: []
37
- require_paths:
46
+
47
+ require_paths:
38
48
  - lib
39
- required_ruby_version: !ruby/object:Gem::Requirement
49
+ required_ruby_version: !ruby/object:Gem::Requirement
40
50
  none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: '0'
45
- segments:
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
46
56
  - 0
47
- hash: -844902927
48
- required_rubygems_version: !ruby/object:Gem::Requirement
57
+ version: "0"
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
59
  none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- segments:
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
55
65
  - 0
56
- hash: -844902927
66
+ version: "0"
57
67
  requirements: []
68
+
58
69
  rubyforge_project:
59
- rubygems_version: 1.8.10
70
+ rubygems_version: 1.8.15
60
71
  signing_key:
61
72
  specification_version: 3
62
73
  summary: Keep your vendor files up to date
63
74
  test_files: []
75
+