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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: 158a70fba74e7159c2f9f1a2fec4ffacb7ce5ae9
4
- data.tar.gz: 4742cd55e48e01349f82fe97f2ac570b04b94bbb
3
+ metadata.gz: 58589cc954b68c22abd845200c76ff6100763a7c
4
+ data.tar.gz: b70cc31920e33413374f2d662ee350ee883233f3
5
5
  SHA512:
6
- metadata.gz: 6427680d083cf0373284f787e936120b8a6a4ed2d4525201f632434215258236dc197f1de43950f1c8ade05b834adcba7455c0b6e0c98e7cee2d9599d3d9462f
7
- data.tar.gz: d5364eb79015a159342798713c3f723e2559f3eadfba392cbf326ad443ad2615d8356072a8edba6af15a23b3f2b15657f337f3308381efb4d961aa08c86a948f
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 $1 == "--help"
7
- puts "Usage: $0 [Bindepfile]"
6
+ if ARGV.first == "--help"
7
+ puts "Usage: bindep [Bindepfile]"
8
8
  exit 0
9
9
  end
10
10
 
11
- Bindep.load_file($1 || 'Bindepfile')
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)
@@ -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 || (item.local_command.nil? && !no_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
 
@@ -1,3 +1,3 @@
1
1
  module Bindep
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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).exactly(no_install ? 0:1).times
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(context).to receive(:gets).once.and_return("y\n")
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(context).to receive(:gets).once.and_return("bla\n")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bindep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niko Dziemba