cliver 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -8
- data/lib/cliver/assertion.rb +8 -5
- data/lib/cliver/version.rb +1 -1
- data/spec/cliver_spec.rb +2 -2
- metadata +2 -2
data/.travis.yml
CHANGED
data/lib/cliver/assertion.rb
CHANGED
@@ -51,12 +51,15 @@ module Cliver
|
|
51
51
|
# @raise [DependencyVersionMismatch] if installed version does not match
|
52
52
|
# @raise [DependencyNotFound] if no installed version on your path
|
53
53
|
def assert!
|
54
|
-
version = installed_version
|
55
|
-
|
54
|
+
version = installed_version ||
|
55
|
+
raise(DependencyNotFound,
|
56
|
+
"required command-line executable '#{@executable}' " +
|
57
|
+
'could not be found on your PATH.')
|
56
58
|
|
57
59
|
if @requirement && !@requirement.satisfied_by?(Gem::Version.new(version))
|
58
60
|
raise DependencyVersionMismatch,
|
59
|
-
"expected '#{@executable}' to
|
61
|
+
"expected command-line executable '#{@executable}' to " +
|
62
|
+
"be #{@requirement}, got #{version}"
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
@@ -77,8 +80,8 @@ module Cliver
|
|
77
80
|
(version_string && version_string[PARSABLE_GEM_VERSION]).tap do |version|
|
78
81
|
unless version
|
79
82
|
raise ArgumentError,
|
80
|
-
"found #{@executable} at
|
81
|
-
'but could not detect its version.
|
83
|
+
"found command-line executable #{@executable} at " +
|
84
|
+
"'#{executable_path}' but could not detect its version."
|
82
85
|
end
|
83
86
|
end
|
84
87
|
end
|
data/lib/cliver/version.rb
CHANGED
data/spec/cliver_spec.rb
CHANGED
@@ -19,13 +19,13 @@ describe Cliver do
|
|
19
19
|
let(:detector) { proc { RUBY_VERSION.sub('p', '.') } }
|
20
20
|
it { should_not be_false }
|
21
21
|
it { should match 'Dependency Version Mismatch:' }
|
22
|
-
it { should match "expected 'ruby' to be #{requirements}" }
|
22
|
+
it { should match "expected .+ 'ruby' to be #{requirements}" }
|
23
23
|
end
|
24
24
|
context 'when dependency is not present' do
|
25
25
|
let(:executable) { 'ruxxxby' }
|
26
26
|
it { should_not be_false }
|
27
27
|
it { should match 'Dependency Not Found:' }
|
28
|
-
it { should match "'#{executable}'
|
28
|
+
it { should match "'#{executable}' could not be found" }
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
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: 2013-06-
|
12
|
+
date: 2013-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|