bindep 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/bin/bindep +10 -3
- data/lib/bindep/context.rb +2 -2
- data/lib/bindep/version.rb +1 -1
- data/spec/bindep/context_spec.rb +13 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58589cc954b68c22abd845200c76ff6100763a7c
|
4
|
+
data.tar.gz: b70cc31920e33413374f2d662ee350ee883233f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 728fa2074ab3be2a4bbd55933281f5b9e41509695a64ec84311dcd852b69757ac2fb9eafbed9f77c2fddc96a1f4947319d7618d0975108340fa7fa2228de361c
|
7
|
+
data.tar.gz: a48dcfc012c6a273ae6c5450673bbf5714159a89de55ca5ea21858bf901c46d11ef928396b7018c7d2a7da64dc236a7a7e3d02de7fda60652a10a11adffbc94c
|
data/bin/bindep
CHANGED
@@ -3,9 +3,16 @@
|
|
3
3
|
require 'bindep'
|
4
4
|
require 'bindep/library'
|
5
5
|
|
6
|
-
if
|
7
|
-
puts "Usage:
|
6
|
+
if ARGV.first == "--help"
|
7
|
+
puts "Usage: bindep [Bindepfile]"
|
8
8
|
exit 0
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
filename = ARGV.first || 'Bindepfile'
|
12
|
+
|
13
|
+
unless File.file? filename
|
14
|
+
puts "Cannot find Bindepfile '#{filename}'."
|
15
|
+
exit 1
|
16
|
+
end
|
17
|
+
|
18
|
+
Bindep.load_file(filename)
|
data/lib/bindep/context.rb
CHANGED
@@ -29,7 +29,7 @@ module Bindep
|
|
29
29
|
|
30
30
|
[ item.depends ].flatten.compact.each { |dep| check dep }
|
31
31
|
|
32
|
-
install item if force_install ||
|
32
|
+
install item if force_install || item.local_command.nil?
|
33
33
|
end
|
34
34
|
|
35
35
|
# Runs the specified command with the given arguments.
|
@@ -65,7 +65,7 @@ module Bindep
|
|
65
65
|
puts "[Bindep] $ #{item.install_command}\n"
|
66
66
|
|
67
67
|
unless no_confirm_before_install
|
68
|
-
error "Aborting." unless gets.downcase.strip == 'y'
|
68
|
+
error "Aborting." unless STDIN.gets.downcase.strip == 'y'
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
data/lib/bindep/version.rb
CHANGED
data/spec/bindep/context_spec.rb
CHANGED
@@ -68,7 +68,7 @@ describe Bindep::Context do
|
|
68
68
|
it "works for an existing but not installed item" do
|
69
69
|
item = context.define(:testid) { |i| i.command = "foo_bar_not_existing" }
|
70
70
|
|
71
|
-
expect(context).to receive(:install).with(item).
|
71
|
+
expect(context).to receive(:install).with(item).once
|
72
72
|
context.check :testid
|
73
73
|
end
|
74
74
|
end
|
@@ -123,7 +123,7 @@ describe Bindep::Context do
|
|
123
123
|
|
124
124
|
expect(context).to receive(:puts).with(/'testitem' is not installed/)
|
125
125
|
expect(context).to receive(:puts).with("[Bindep] $ my_install -b\n")
|
126
|
-
expect(
|
126
|
+
expect(STDIN).to receive(:gets).once.and_return("y\n")
|
127
127
|
|
128
128
|
context.send :pre_install, item
|
129
129
|
end
|
@@ -132,7 +132,7 @@ describe Bindep::Context do
|
|
132
132
|
item.install_command = "my_install -b"
|
133
133
|
|
134
134
|
expect(context).to receive(:puts).twice
|
135
|
-
expect(
|
135
|
+
expect(STDIN).to receive(:gets).once.and_return("bla\n")
|
136
136
|
expect(context).to receive(:error).with(/Aborting/)
|
137
137
|
|
138
138
|
context.send :pre_install, item
|
@@ -150,6 +150,16 @@ describe Bindep::Context do
|
|
150
150
|
context.send :install, item
|
151
151
|
end
|
152
152
|
|
153
|
+
it "runs installation command (success, no_install true)" do
|
154
|
+
context.no_install = true
|
155
|
+
|
156
|
+
expect(context).to receive(:pre_install).with(item).and_raise(RuntimeError)
|
157
|
+
|
158
|
+
expect do
|
159
|
+
context.send :install, item
|
160
|
+
end.to raise_error RuntimeError
|
161
|
+
end
|
162
|
+
|
153
163
|
it "runs installation command (fail)" do
|
154
164
|
item.install_command = "echo 1"
|
155
165
|
|