vendorer 0.1.1 → 0.1.2
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 +8 -6
- data/lib/vendorer/version.rb +1 -1
- data/lib/vendorer.rb +10 -14
- data/spec/vendorer_spec.rb +13 -11
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
Vendorer
|
1
|
+
Vendorer
|
2
2
|
|
3
|
-
-
|
4
|
-
-
|
3
|
+
- documented dependencies
|
4
|
+
- automatic updates
|
5
5
|
- no unwanted/accidental updates
|
6
6
|
|
7
7
|
Install
|
@@ -12,10 +12,10 @@ Install curl and git, then:
|
|
12
12
|
|
13
13
|
Usage
|
14
14
|
=====
|
15
|
-
Add a Vendorfile to your project root:
|
15
|
+
Add a `Vendorfile` to your project root:
|
16
16
|
|
17
|
-
file 'public/javascripts/jquery.min.js'
|
18
|
-
folder 'vendor/plugins/parallel_tests'
|
17
|
+
file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js'
|
18
|
+
folder 'vendor/plugins/parallel_tests', 'https://github.com/grosser/parallel_tests.git'
|
19
19
|
|
20
20
|
Call `vendorer`
|
21
21
|
|
@@ -30,6 +30,8 @@ TODO
|
|
30
30
|
====
|
31
31
|
- git branch/commit support
|
32
32
|
- `folder 'vendor' do` which will remove everything that is not vendored via Vendorfile on `vendorer update` or `vendorer update vendor`
|
33
|
+
- nice error message when no Vendorfile was found
|
34
|
+
- block support `folder(....){|folder| `rm -rf "#{folder}/.gitignore"` }`
|
33
35
|
|
34
36
|
Author
|
35
37
|
======
|
data/lib/vendorer/version.rb
CHANGED
data/lib/vendorer.rb
CHANGED
@@ -6,23 +6,19 @@ class Vendorer
|
|
6
6
|
|
7
7
|
private
|
8
8
|
|
9
|
-
def file(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
raise "Downloaded empty file" unless File.exist?(file)
|
15
|
-
end
|
9
|
+
def file(path, url)
|
10
|
+
update_or_not path do
|
11
|
+
run "mkdir -p #{File.dirname(path)}"
|
12
|
+
run "curl '#{url}' -o #{path}"
|
13
|
+
raise "Downloaded empty file" unless File.exist?(path)
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
19
|
-
def folder(
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
run "rm -rf #{path}/.git"
|
25
|
-
end
|
17
|
+
def folder(path, url)
|
18
|
+
update_or_not path do
|
19
|
+
run "mkdir -p #{File.dirname(path)}"
|
20
|
+
run "git clone '#{url}' #{path}"
|
21
|
+
run "rm -rf #{path}/.git"
|
26
22
|
end
|
27
23
|
end
|
28
24
|
|
data/spec/vendorer_spec.rb
CHANGED
@@ -59,7 +59,7 @@ describe Vendorer do
|
|
59
59
|
describe '.file' do
|
60
60
|
context "with working Vendorfile" do
|
61
61
|
before do
|
62
|
-
write 'Vendorfile', "file 'public/javascripts/jquery.min.js'
|
62
|
+
write 'Vendorfile', "file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js'"
|
63
63
|
run
|
64
64
|
end
|
65
65
|
|
@@ -82,8 +82,8 @@ describe Vendorer do
|
|
82
82
|
|
83
83
|
it "can update a single file" do
|
84
84
|
write 'Vendorfile', "
|
85
|
-
file 'public/javascripts/jquery.min.js'
|
86
|
-
file 'public/javascripts/jquery.js'
|
85
|
+
file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js'
|
86
|
+
file 'public/javascripts/jquery.js', 'http://code.jquery.com/jquery-latest.js'
|
87
87
|
"
|
88
88
|
run
|
89
89
|
read('public/javascripts/jquery.js').should include('jQuery')
|
@@ -98,29 +98,31 @@ describe Vendorer do
|
|
98
98
|
end
|
99
99
|
|
100
100
|
it "fails with a nice message" do
|
101
|
-
write 'Vendorfile', "file 'xxx.js'
|
101
|
+
write 'Vendorfile', "file 'xxx.js', 'http://NOTFOUND'"
|
102
102
|
result = run '', :raise => true
|
103
|
-
|
103
|
+
# different errors on travis / local
|
104
|
+
raise result unless result.include?("resolve host 'NOTFOUND'") or result.include?('Downloaded empty file')
|
104
105
|
end
|
105
106
|
end
|
106
107
|
|
107
108
|
describe '.folder' do
|
108
109
|
it "can download via hash syntax" do
|
109
|
-
write 'Vendorfile', "folder 'vendor/plugins/parallel_tests'
|
110
|
+
write 'Vendorfile', "folder 'vendor/plugins/parallel_tests', 'https://github.com/grosser/parallel_tests.git'"
|
110
111
|
run
|
111
112
|
ls('vendor/plugins').should == ["parallel_tests"]
|
112
113
|
read('vendor/plugins/parallel_tests/Gemfile').should include('parallel')
|
113
114
|
end
|
114
115
|
|
115
116
|
it "reports errors" do
|
116
|
-
write 'Vendorfile', "folder 'vendor/plugins/parallel_tests'
|
117
|
+
write 'Vendorfile', "folder 'vendor/plugins/parallel_tests', 'https://blob'"
|
117
118
|
output = run '', :raise => true
|
118
|
-
|
119
|
+
# different errors on travis / local
|
120
|
+
raise unless output.include?('Connection refused') or output.include?('resolve host')
|
119
121
|
end
|
120
122
|
|
121
123
|
context "with a fast,local repository" do
|
122
124
|
before do
|
123
|
-
write 'Vendorfile', "folder 'its_recursive'
|
125
|
+
write 'Vendorfile', "folder 'its_recursive', '../../.git'"
|
124
126
|
run
|
125
127
|
end
|
126
128
|
|
@@ -147,8 +149,8 @@ describe Vendorer do
|
|
147
149
|
|
148
150
|
it "can update a single file" do
|
149
151
|
write 'Vendorfile', "
|
150
|
-
folder 'its_recursive'
|
151
|
-
folder 'its_really_recursive'
|
152
|
+
folder 'its_recursive', '../../.git'
|
153
|
+
folder 'its_really_recursive', '../../.git'
|
152
154
|
"
|
153
155
|
run
|
154
156
|
write('its_recursive/Gemfile', 'Foo')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vendorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-13 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|