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 +4 -4
- data/lib/kapost/bootstrapper/version.rb +1 -1
- data/lib/kapost/bootstrapper.rb +19 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4384c1374a0925ec426e81e7cb8d4d1afef06c99
|
4
|
+
data.tar.gz: 7f0f93d73a2d7add9fea9c65e102293829a458d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fc89d09ef1df3f23950ccaba5292a4b331f7b16a6615a0bc527ceac74ece617671648341a5193b685f5bab1aed9bf1d9906215f7473a0aa1295d9a4ba18c031
|
7
|
+
data.tar.gz: c0ccc02adc2e9f5947dbc2dba251b67bc39ea07aa4f447bc26e92e7c0ac8e3bea04ad98fcea12771fe73b37c7d74d9f45b526a1efdeb8e10f364eb04aa195aec
|
data/lib/kapost/bootstrapper.rb
CHANGED
@@ -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
|
-
|
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
|