kapost-bootstrapper 0.5.0 → 0.5.1

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
  SHA1:
3
- metadata.gz: 6304d8fd0b5d48b0aaa51f59d1486eaf6223ea75
4
- data.tar.gz: 7968ffd2f955f975c0267bc88d85d3510fa0b3fe
3
+ metadata.gz: 7bbdfc50dfe2de74b812a50bb6258856d68116d5
4
+ data.tar.gz: 5bc52349f47dbb10611ed3783076130938119d86
5
5
  SHA512:
6
- metadata.gz: 7a2068b5336aeb916b2099e84cce868c9a2a02dab73af0c4316f841f81afd04f76fa3d4e4b6c1d679a8ade2626d7298bc19bcb163e2cce1d54a77d819c009dff
7
- data.tar.gz: 9a3085a9ab5b28058fb2be4058c2be08fe830d3768b82a0adbdfd91edd00d640ff74e0b6fd3c75e68649b35b5b5e0801d6c1401143f91851047115b2c25d1a5a
6
+ metadata.gz: 57280b925aea7f4e276c1ac2621efd6715e8a8bc1e4589900a7b90bb3a54352c706435a689e097e54dd781869d4445c78628b0323d402d86f2345da741b448c2
7
+ data.tar.gz: 5f198e76bf08abfafb25f13840cc5878dfa3c37d3b189ed9210be4a517c07fac346f7ad3336ff7b0ce67f82b8ef0d6e40ce5b653dd249bfe9ddd8982aba6b1e5
@@ -1,5 +1,5 @@
1
1
  module Kapost
2
2
  class Bootstrapper
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -53,7 +53,11 @@ module Kapost
53
53
  end
54
54
 
55
55
  def default_check(command, version)
56
- installed?(command) and (!version or right_version?(command, version))
56
+ installed?(command) or raise CommandNotFoundError, command
57
+ if version
58
+ actual_version = right_version?(command, version) or raise CommandVersionMismatchError, command, version, actual_version
59
+ end
60
+ true
57
61
  end
58
62
 
59
63
  def check(command, help = nil, version: nil)
@@ -82,16 +86,12 @@ module Kapost
82
86
 
83
87
  def installed?(command)
84
88
  _, status = cli.capture2e "bash -c 'type #{command}'"
85
- raise CommandNotFoundError, command unless status.success?
86
- true
89
+ status.success?
87
90
  end
88
91
 
89
92
  def right_version?(command, expected_version)
90
93
  version, status = cli.capture2e "#{command} --version"
91
- unless status.success? && version.include?(expected_version)
92
- raise CommandVersionMismatchError, command, expected_version, version
93
- end
94
- true
94
+ status.success? && version.include?(expected_version) && version
95
95
  end
96
96
 
97
97
  def say(message)
@@ -110,7 +110,7 @@ module Kapost
110
110
  def sh(*cmd)
111
111
  options = (Hash === cmd.last) ? cmd.pop : {}
112
112
  say(cmd.join(" ")) if options[:verbose]
113
- result = cli.system(*cmd)
113
+ result = shell.system(*cmd)
114
114
  status = $?
115
115
  raise CommandFailedError.new(cmd.join(" "), status.exitstatus) unless result
116
116
  result
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kapost-bootstrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Sadauskas