hako 0.7.1 → 0.7.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: d3d9c90e89394fc7f064a57f0ae81e1048262fe8
4
- data.tar.gz: 7c91399a8265c5b71114b2e318e163064e93c074
3
+ metadata.gz: acb16772f9adf1b88875ca6b5512f18b7625b926
4
+ data.tar.gz: 570621547d7fcb12fa9a4687e08cf77e9c732e85
5
5
  SHA512:
6
- metadata.gz: c99e6a8cb5da22ef0f1306fa3be90c5de4a8167cd267c6934d54a3854e6a627cc86bf91d63c8ff0fd6e00995793c9e58d6565dd2c19d15c391c6e9e348aa0f06
7
- data.tar.gz: f37d8c0dfbdb5bc3f3fe6ddc1b5a6f9c371af0efbbb0b6749b40c51f6972d8d9134782d76415f3183f1c358ef2efffecd3455aed36d028e11d2fafb7210f6631
6
+ metadata.gz: 18bb12686bd0cac7c726c4dc759ecfbb071034bc41a9033a73dbd8d20f7d957cfe10d9af1652ef3906540c8408ccdccb6c9f25ad6380c9c9f9fb0523fae0f023
7
+ data.tar.gz: d18f665c6d2c61ee745deccb09e39d38518df4c610e281ca413dc0a1666ca3d584d311ddc83e4bd6ffb91eee6b3caf5df4e8bf726e1380d28bc47eccb0e04df9
@@ -9,7 +9,7 @@ module Hako
9
9
  path = Pathname.new(yaml_path)
10
10
  @id = path.basename.sub_ext('').to_s
11
11
  @root_path = path.parent
12
- @yaml = YamlLoader.load(path)
12
+ @yaml = YamlLoader.new.load(path)
13
13
  end
14
14
  end
15
15
  end
@@ -24,7 +24,7 @@ module Hako
24
24
  desc 'show-yaml FILE', 'Show expanded YAML'
25
25
  def show_yaml(yaml_path)
26
26
  require 'hako/yaml_loader'
27
- puts YamlLoader.load(Pathname.new(yaml_path)).to_yaml
27
+ puts YamlLoader.new.load(Pathname.new(yaml_path)).to_yaml
28
28
  end
29
29
 
30
30
  desc 'status FILE', 'Show deployment status'
@@ -1,9 +1,12 @@
1
1
  # frozen_string_literal: true
2
+ require 'hako/version'
3
+
2
4
  module Hako
3
5
  class Container
4
6
  def initialize(app, definition, dry_run:)
5
7
  @app = app
6
8
  @definition = default_config.merge(definition)
9
+ @definition['docker_labels'].merge!(default_labels)
7
10
  @dry_run = dry_run
8
11
  end
9
12
 
@@ -54,5 +57,11 @@ module Hako
54
57
  'links' => [],
55
58
  }
56
59
  end
60
+
61
+ def default_labels
62
+ {
63
+ 'cc.wanko.hako.version' => VERSION,
64
+ }
65
+ end
57
66
  end
58
67
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hako
3
- VERSION = '0.7.1'
3
+ VERSION = '0.7.2'
4
4
  end
@@ -2,22 +2,24 @@
2
2
  require 'psych'
3
3
 
4
4
  module Hako
5
- module YamlLoader
6
- class << self
7
- def load(path)
8
- class_loader = Psych::ClassLoader.new
9
- scanner = Psych::ScalarScanner.new(class_loader)
10
- prev_path = @current_path
11
- @current_path = path
12
- visitor = Visitor.new(scanner, class_loader) do |_, val|
13
- load(@current_path.parent.join(val))
14
- end
15
- path.open do |f|
16
- visitor.accept(Psych.parse(f))
17
- end
18
- ensure
19
- @current_path = prev_path
5
+ class YamlLoader
6
+ def initialize
7
+ @current_path = nil
8
+ end
9
+
10
+ def load(path)
11
+ class_loader = Psych::ClassLoader.new
12
+ scanner = Psych::ScalarScanner.new(class_loader)
13
+ prev_path = @current_path
14
+ @current_path = path
15
+ visitor = Visitor.new(scanner, class_loader) do |_, val|
16
+ load(@current_path.parent.join(val))
17
+ end
18
+ path.open do |f|
19
+ visitor.accept(Psych.parse(f))
20
20
  end
21
+ ensure
22
+ @current_path = prev_path
21
23
  end
22
24
 
23
25
  class Visitor < Psych::Visitors::ToRuby
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki