kubec 0.3.1 → 0.3.2

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: c23740ce1bc4febca54094a2020bb1b92bc9f145
4
- data.tar.gz: 953128ac3ec5abd9193424c8efe1759f4dd6c983
3
+ metadata.gz: 5f0f38597832c138b960cbb3b6047c0c56689556
4
+ data.tar.gz: 9a8d9ef102c262681b9277055282bb66c51293c2
5
5
  SHA512:
6
- metadata.gz: a7792592e89f9087c44651c4dbb0336eb8569b4c8e20a74baf4bf6473a36eeeefeaa8d9ac3fb0f6711668abdc39991e3a691c0da6fa1d5964b31fb21b4ac825e
7
- data.tar.gz: c6ee7b69cbce676152729d02aa31c4049fd68bc318333c7b7705c679a88a32577734dd4ac9e1f5af99f3eabfbdb83b36a5df946199109775775a23fd18d3289a
6
+ metadata.gz: aa797d1199e6b971b3c22036d665e74681f21782054c53f38eba91ca623f9147efe7e3b7b96544074e8118f17d5ab678070a20163c273ec303f81f953efaf463
7
+ data.tar.gz: 16203cea03bdf3f1df6823c657d49f3397d824b1df762a5450ba55f38ba30d3a38ce8d8534fc502149bba1b42d7e391ca5860a019f1d35be5cf852b8e187e386
@@ -5,10 +5,6 @@ module Kubec
5
5
  class Environment < Hash
6
6
  include Singleton
7
7
 
8
- def fetch(key, default = nil)
9
- self[key.to_sym] || default
10
- end
11
-
12
8
  def set(key, value)
13
9
  self[key.to_sym] = value
14
10
  end
@@ -25,6 +25,11 @@ module Kubec
25
25
  instance_eval(&block)
26
26
  end
27
27
 
28
+ # TODO: Refactor this feature
29
+ def fetch(*args)
30
+ Environment.instance.fetch(*args)
31
+ end
32
+
28
33
  def spec
29
34
  self[:spec]
30
35
  end
@@ -12,6 +12,11 @@ module Kubec
12
12
  instance_eval(&block)
13
13
  end
14
14
 
15
+ # TODO: Refactor this feature
16
+ def fetch(*args)
17
+ Environment.instance.fetch(*args)
18
+ end
19
+
15
20
  def set(key, value)
16
21
  self[:data][key] = value
17
22
  end
@@ -12,6 +12,11 @@ module Kubec
12
12
  instance_eval(&block)
13
13
  end
14
14
 
15
+ # TODO: Refactor this feature
16
+ def fetch(*args)
17
+ Environment.instance.fetch(*args)
18
+ end
19
+
15
20
  def env(key, value)
16
21
  self[:env] ||= []
17
22
  self[:env].push name: key,
@@ -7,6 +7,11 @@ module Kubec
7
7
  self[:namespace] = fetch(:stage, :staging)
8
8
  end
9
9
 
10
+ # TODO: Refactor this feature
11
+ def fetch(*args)
12
+ Environment.instance.fetch(*args)
13
+ end
14
+
10
15
  def label(key, value)
11
16
  self['labels'] ||= {}
12
17
  self['labels'][key] = value
@@ -11,6 +11,11 @@ module Kubec
11
11
  self[:spec] = {}
12
12
  end
13
13
 
14
+ # TODO: Refactor this feature
15
+ def fetch(*args)
16
+ Environment.instance.fetch(*args)
17
+ end
18
+
14
19
  def volume(name, &block)
15
20
  spec[:volumes] ||= []
16
21
  spec[:volumes].push Volume.new(name, &block)
@@ -7,6 +7,11 @@ module Kubec
7
7
  instance_eval(&block)
8
8
  end
9
9
 
10
+ # TODO: Refactor this feature
11
+ def fetch(*args)
12
+ Environment.instance.fetch(*args)
13
+ end
14
+
10
15
  def empty(memory = false)
11
16
  self[:emptyDir] = if memory
12
17
  { medium: true }
@@ -41,7 +41,7 @@ module Kubec
41
41
  def setup_restarts
42
42
  self['Restarts'] = containers.map do |c|
43
43
  c['restartCount'].to_i
44
- end.sum
44
+ end.reduce(0, &:+)
45
45
  end
46
46
 
47
47
  def setup_age
data/lib/kubec/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kubec
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 5xRuby