docker_core 0.0.31 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/docker_core.rb +21 -18
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3844eb4ee913899cab8113bb7ce6ef006eca4a3c20520ccbd1e9c9b74f5245e4
4
- data.tar.gz: 1ee372fce84dcc125d3ded1f14d65c583ef919949d4d722e2be1672f40fea992
3
+ metadata.gz: 3462495808e195a26c503fcb47e809cd1cf3b14234785f54906da57c1312fadd
4
+ data.tar.gz: ca4e5679e8ea61bd243355a9b4ad68258d7da68086d51356e6105df10f51d206
5
5
  SHA512:
6
- metadata.gz: c6b3c402892459520958a46ed72d79fa2f7b9ec16daa447b34cae359a3a0b0f461a077f2a77ea39cf69c4148e399d0e4fb0cecbcd3ac5ce15291a3eb02681566
7
- data.tar.gz: a2a5d399de5ee88cc83795a175ec3ec0f829aa3756adda5b575f68325893125b206526e588a4242303d7996616931c6f67a29d48caf6005b1713d3d7edcbdbcd
6
+ metadata.gz: 5bc578621035135247e128d111ff55393725de6b3f237bc2c6d3eb7af2e8e8f36b8382461a3005a02ab4aa4f25a8a59cc98c6185e7453215c12a3573bfae2bf9
7
+ data.tar.gz: e28f011b67bcee8e3fac989191b8d727c5abadb6d58793f0a166fa75f4ffd2e29fc0552103bdb6f67e87fc4267aaa0431959db7ad8a075bbe09a91c0db7bc007
data/lib/docker_core.rb CHANGED
@@ -40,6 +40,9 @@ module DockerCore
40
40
  module Image
41
41
  end
42
42
 
43
+ module Orchestrator
44
+ end
45
+
43
46
  module Command
44
47
  end
45
48
 
@@ -48,8 +51,8 @@ module DockerCore
48
51
  # @param [String] registry
49
52
  # @param [String] namespace
50
53
  # @param [String] tag
51
- def self.use_image(image, registry: REGISTRY, namespace: NAMESPACE, tag: 'latest')
52
- return [registry, namespace, image].join('/') + ":#{tag}"
54
+ def self.from_image(image, registry: REGISTRY, namespace: NAMESPACE, tag: 'latest')
55
+ return "#{registry}/#{namespace}/#{image}:#{tag}"
53
56
  end
54
57
 
55
58
  def self.deploy_path
@@ -74,7 +77,7 @@ module DockerCore
74
77
  return { docker: Shell.is_active_unit('docker') }
75
78
  end
76
79
 
77
- def self.detect_swarm
80
+ def self.detect_orchestrator
78
81
  swarm = self.read_swarm.to_sym
79
82
  detect = self.detect_services
80
83
 
@@ -88,9 +91,7 @@ module DockerCore
88
91
 
89
92
  def self.swarm_status
90
93
  color = Color::GREEN
91
- detect = self.detect_swarm
92
-
93
- Color.echo("Swarm: #{detect}", color)
94
+ Color.echo("Swarm: #{self.detect_orchestrator}", color)
94
95
  Color.echo(self.detect_services.to_yaml, color)
95
96
  end
96
97
 
@@ -100,14 +101,14 @@ module DockerCore
100
101
  self.write_swarm(swarm)
101
102
  end
102
103
 
103
- swarm = self.detect_swarm
104
- self.write_swarm(swarm)
104
+ orchestrator = self.detect_orchestrator
105
+ self.write_swarm(orchestrator)
105
106
 
106
- if swarm.empty?
107
- swarm = 'none'
107
+ if orchestrator.empty?
108
+ orchestrator = '<none>'
108
109
  end
109
110
 
110
- Color.echo("Swarm: #{swarm}", Color::GREEN)
111
+ Color.echo("Swarm: #{orchestrator}", Color::GREEN)
111
112
  end
112
113
 
113
114
  # @param [String] base
@@ -123,28 +124,32 @@ module DockerCore
123
124
  end
124
125
 
125
126
  # @param [Array] arguments
127
+ # @param [Hash] environment
128
+ # @param [Hash] bind
126
129
  # @param [Boolean] throw
127
130
  # @param [Numeric] wait
128
131
  # @param [Boolean] strip
129
132
  # @param [Boolean] echo
130
133
  # @return [String]
131
- def self.capture_command(*arguments, environment: {}, throw: false, wait: 0, strip: true, echo: false)
134
+ def self.capture_command(*arguments, environment: {}, bind: {}, throw: false, wait: 0, strip: true, echo: false)
132
135
  raise "No implement #{__method__} method"
133
136
  end
134
137
 
135
138
  # @param [Array] arguments
139
+ # @param [Hash] environment
140
+ # @param [Hash] bind
136
141
  # @param [Boolean] throw
137
142
  # @param [Numeric] wait
138
143
  # @param [Boolean] echo
139
144
  # @return [Boolean]
140
- def self.run_command(*arguments, environment: {}, throw: true, wait: 0, echo: true)
145
+ def self.run_command(*arguments, environment: {}, bind: {}, throw: true, wait: 0, echo: true)
141
146
  raise "No implement #{__method__} method"
142
147
  end
143
148
 
144
149
  #noinspection RubyClassVariableUsageInspection
145
- def self.swarm
146
- @@swarm ||= self.detect_swarm
147
- return "#{@@swarm}"
150
+ def self.orchestrator
151
+ @@orchestrator ||= self.detect_orchestrator
152
+ return "#{@@orchestrator}"
148
153
  end
149
154
 
150
155
  end
@@ -538,8 +543,6 @@ module DockerCore
538
543
  data = JSON.parse(Net::HTTP.get(uri))['tag_name']
539
544
  return "#{data}"
540
545
 
541
-
542
-
543
546
  end
544
547
  end
545
548
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - agrozyme