docker_toolkit 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: 156de56f6addd20cac878ffaee41587f8251b5bd5f5d3913c1d9ccda16c5635c
4
- data.tar.gz: e5fe80be2b6868363d0e47402c46998b32c4177819ec628d9c9585aabdd0d01d
3
+ metadata.gz: 254725d84611e9033ec506f86f0ee1c640f87866c68449234fbfcee768a9c6bf
4
+ data.tar.gz: 38fe06543fb8988a77dbc06c3aad636412f6bb82b31b8dfc30a3cfb775f75f5d
5
5
  SHA512:
6
- metadata.gz: 87f7513c019ede61027804ceb8981e5eae89b42904bfec12fc80c4168578095af5f07b2fce08b6cf90112a79eebb06fbf24f153c1e112cd623c063a6d2261d40
7
- data.tar.gz: 08cbae47473122832c5bc79de4a492e8ebe8e9183df91b13d21d075fa5eedc14ff544cef5abdc99003b902f9b4c1722da92d3107f4b9c871c6562bfc6fce47e9
6
+ metadata.gz: ff340a5aef5d4abd537b1b07c3d1e5b0cab3e82b29570ef59ce436206cb213048edfcbeb8debaa22b21482e22d329629daed9a5cb29ec52f0946c44822eaa899
7
+ data.tar.gz: 93ebdc671a9aecf8b86ef3529941791ab678b967eecbc0bb12c94808568636a3ccf163eb86d12add70a9eef3d42ff0c3707ce5ce000c9798409518f81530722a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docker_toolkit (0.1.5)
4
+ docker_toolkit (0.1.6)
5
5
  diplomat
6
6
  dotenv
7
7
  json
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
 
28
28
 
29
29
  spec.add_dependency 'diplomat'
30
- spec.add_dependency 'json'
31
30
  spec.add_dependency 'dotenv'
31
+ spec.add_dependency 'json'
32
32
 
33
33
  spec.add_development_dependency 'bundler', '~> 1.14'
34
34
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -1,15 +1,14 @@
1
1
  require 'diplomat'
2
2
  require 'English'
3
3
  require 'optparse'
4
-
4
+ require 'dotenv'
5
5
 
6
6
 
7
7
  require 'docker_toolkit/version'
8
8
  require 'docker_toolkit/watcher'
9
+ require 'docker_toolkit/runner'
9
10
  require 'docker_toolkit/childprocess'
10
11
 
11
12
  module DockerToolkit
12
13
 
13
-
14
-
15
14
  end
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ module DockerToolkit
4
+
5
+ module Runner
6
+
7
+ def error(message)
8
+ STDERR.puts "Error: #{message}"
9
+ end
10
+
11
+ def die(message)
12
+ error(message)
13
+ exit 1
14
+ end
15
+
16
+ def load_envs(string, env = ENV)
17
+ envs Dotenv::Parser.new(string).call
18
+ envs.each_pair do |k, v|
19
+ env[k] = v
20
+ end
21
+ envs
22
+ end
23
+
24
+ def execute(cmd)
25
+ `#{cmd}`
26
+ end
27
+
28
+ def execute!(cmd, error = nil)
29
+ output = execute(cmd)
30
+ $CHILD_STATUS.success? || die(error || "Can't execute: #{cmd}")
31
+ output
32
+ end
33
+
34
+ def ensure_env_defined!(key, env = ENV)
35
+ env.key?(key) || die("Environment variable #{key} must present!")
36
+ env[key]
37
+ end
38
+
39
+ end
40
+
41
+ end
@@ -1,5 +1,5 @@
1
1
  module DockerToolkit
2
2
 
3
- VERSION = '0.1.5'.freeze
3
+ VERSION = '0.1.6'.freeze
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan
@@ -26,7 +26,7 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: json
29
+ name: dotenv
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
@@ -40,7 +40,7 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: dotenv
43
+ name: json
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
@@ -138,6 +138,7 @@ files:
138
138
  - lib/docker_toolkit/childprocess/windows/process.rb
139
139
  - lib/docker_toolkit/childprocess/windows/process_builder.rb
140
140
  - lib/docker_toolkit/childprocess/windows/structs.rb
141
+ - lib/docker_toolkit/runner.rb
141
142
  - lib/docker_toolkit/version.rb
142
143
  - lib/docker_toolkit/watcher.rb
143
144
  homepage: https://github.com/RnD-Soft/docker_toolkit
@@ -160,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
161
  version: '0'
161
162
  requirements: []
162
163
  rubyforge_project:
163
- rubygems_version: 2.7.7
164
+ rubygems_version: 2.7.3
164
165
  signing_key:
165
166
  specification_version: 4
166
167
  summary: Helper scripts for work with docker and consul