vendorer 0.1.5 → 0.1.6

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.5)
4
+ vendorer (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/bin/vendorer CHANGED
@@ -30,4 +30,5 @@ end
30
30
  parser.parse!
31
31
 
32
32
  require 'vendorer'
33
- Vendorer.new(:update => (ARGV[1] || true if ARGV[0] == 'update'))
33
+ v = Vendorer.new(:update => (ARGV[1] || true if ARGV[0] == 'update'))
34
+ v.parse(File.read('Vendorfile'))
data/lib/vendorer.rb CHANGED
@@ -1,10 +1,13 @@
1
1
  require 'tempfile'
2
2
 
3
3
  class Vendorer
4
- def initialize(options)
4
+ def initialize(options={})
5
5
  @options = options
6
6
  @sub_path = []
7
- eval(File.read('Vendorfile'))
7
+ end
8
+
9
+ def parse(content)
10
+ eval(content)
8
11
  end
9
12
 
10
13
  def file(path, url)
@@ -1,3 +1,3 @@
1
1
  class Vendorer
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
@@ -38,11 +38,11 @@ describe Vendorer do
38
38
  out
39
39
  end
40
40
 
41
- describe 'version' do
42
- it "has a VERSION" do
43
- Vendorer::VERSION.should =~ /^[\.\da-z]+$/
44
- end
41
+ it "has a VERSION" do
42
+ Vendorer::VERSION.should =~ /^[\.\da-z]+$/
43
+ end
45
44
 
45
+ describe 'version' do
46
46
  it "shows its version via -v" do
47
47
  vendorer('-v').should == "#{Vendorer::VERSION}\n"
48
48
  end
@@ -62,7 +62,7 @@ describe Vendorer do
62
62
  end
63
63
  end
64
64
 
65
- describe '.file' do
65
+ describe '#file' do
66
66
  def simple_vendorfile
67
67
  write 'Vendorfile', "file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js'"
68
68
  end
@@ -152,7 +152,7 @@ describe Vendorer do
152
152
  end
153
153
  end
154
154
 
155
- describe '.folder' do
155
+ describe '#folder' do
156
156
  before do
157
157
  write 'Vendorfile', "folder 'its_recursive', '../../.git'"
158
158
  end
@@ -189,7 +189,7 @@ describe Vendorer do
189
189
  read('its_recursive/Gemfile').should == 'Foo'
190
190
  end
191
191
 
192
- describe 'update' do
192
+ describe '#update' do
193
193
  it "updates a folder" do
194
194
  vendorer
195
195
  write('its_recursive/Gemfile', 'Foo')
@@ -297,7 +297,7 @@ describe Vendorer do
297
297
  end
298
298
  end
299
299
 
300
- describe 'rewrite' do
300
+ describe '#rewrite' do
301
301
  it "can rewrite a file to change stuff" do
302
302
  write "Vendorfile", "
303
303
  file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js' do |path|
@@ -310,4 +310,13 @@ describe Vendorer do
310
310
  content.should include('hQuery')
311
311
  end
312
312
  end
313
+
314
+ describe "#parse" do
315
+ it "executes inside vendorer" do
316
+ $test = 1
317
+ v = Vendorer.new
318
+ v.parse '$test = self'
319
+ $test.should == v
320
+ end
321
+ end
313
322
  end
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.5
4
+ version: 0.1.6
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: 2011-12-20 00:00:00.000000000 Z
12
+ date: 2011-12-23 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: 138779027
47
+ hash: 181505217
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: 138779027
56
+ hash: 181505217
57
57
  requirements: []
58
58
  rubyforge_project:
59
59
  rubygems_version: 1.8.10