kapost-bootstrapper 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4d7530215a80ce5f20423d078b28352e22c65bb
4
- data.tar.gz: 36bc6449556de23f09721e31d29969cda77b557d
3
+ metadata.gz: 4384c1374a0925ec426e81e7cb8d4d1afef06c99
4
+ data.tar.gz: 7f0f93d73a2d7add9fea9c65e102293829a458d1
5
5
  SHA512:
6
- metadata.gz: fed3eaa934921b85d701c4e7980a4d9ffd959749ef35a3d7043f2f42db4bb98939348e91446a0e87e4d6f3e533d8c62682ec1d516914172d84aaa4d6fffe562a
7
- data.tar.gz: cc53dff5d135a87cf4bb3db5e5c01223a78a752a0741d9fb5d786d328f991448b51733b628ecc5b1b6b9b7b61217a24041fb77bd683c8759206910fe28121173
6
+ metadata.gz: 9fc89d09ef1df3f23950ccaba5292a4b331f7b16a6615a0bc527ceac74ece617671648341a5193b685f5bab1aed9bf1d9906215f7473a0aa1295d9a4ba18c031
7
+ data.tar.gz: c0ccc02adc2e9f5947dbc2dba251b67bc39ea07aa4f447bc26e92e7c0ac8e3bea04ad98fcea12771fe73b37c7d74d9f45b526a1efdeb8e10f364eb04aa195aec
@@ -1,5 +1,5 @@
1
1
  module Kapost
2
2
  class Bootstrapper
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -12,14 +12,6 @@ module Kapost
12
12
  run(&block) if block_given?
13
13
  end
14
14
 
15
- def osx(&block)
16
- instance_eval(&block) if os == :macosx
17
- end
18
-
19
- def debian(&block)
20
- instance_eval(&block) if os == :debian
21
- end
22
-
23
15
  def check(command, help = nil, version: nil, &block)
24
16
  success = say(label(command, version)) do
25
17
  if block_given?
@@ -80,6 +72,18 @@ module Kapost
80
72
  result
81
73
  end
82
74
 
75
+ def osx(&block)
76
+ run(&block) if os == :macosx
77
+ end
78
+
79
+ def docker(&block)
80
+ run(&block) if os == :docker
81
+ end
82
+
83
+ def ubuntu(&block)
84
+ run(&block) if os == :ubuntu
85
+ end
86
+
83
87
  def run(&code)
84
88
  instance_eval(&code)
85
89
  end
@@ -99,7 +103,13 @@ module Kapost
99
103
  when /darwin|mac os/
100
104
  :macosx
101
105
  when /linux/
102
- installed?("apt-get") ? :debian : :linux
106
+ if File.exist?("/.dockerenv")
107
+ :docker
108
+ elsif installed?("apt-get")
109
+ :ubuntu
110
+ else
111
+ :linux
112
+ end
103
113
  else
104
114
  fail "unknown os: #{RUBY_PLATFORM.inspect}"
105
115
  end
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Sadauskas