dapp 0.25.0 → 0.25.1

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: 9feef0467f4a300a3890d8c35fca220590a9fd19
4
- data.tar.gz: eb7cb2377a0dd260976a6bbfd08c51cf50e4c4bf
3
+ metadata.gz: 3da7856304ed795022546a6c8c52219b0bf4972a
4
+ data.tar.gz: de4113e5a102587051925011ae772c1df10360c5
5
5
  SHA512:
6
- metadata.gz: 0050bb050988788005d6af8dd2432ca5b3e9b02dd6f5fbd3203deab1adc36253f0d460ab31bac8c3ba17229a21c00ba1c6c180202496ff76a3e030cb665b360c
7
- data.tar.gz: 19cc26da6da554416efa0969d0ccc88e061578cbd8b4147cf6af785eba4169555d7f10ec73fb85ee2a729c12d2795e793e1f6b86bb36d1900ec9154e7b94c23d
6
+ metadata.gz: bc756b6eec2c67b7dfb4dfb7dfb94f07750edb2e0d8c4e2454dc84e6e2de22ff0a502f35359f81e462498e570bf7c8d721868ce9304a954660a82837f177ae13
7
+ data.tar.gz: 7220a8eaccaa64444968ff16f7737b76ed931c428f8bf125efbc645430b2d0d33ff0cc422586925b05db174c6756455c6a3abf793a65e898b639405e48a5cf5a
@@ -5,11 +5,25 @@ module Dapp
5
5
  module Tag
6
6
  def self.extended(klass)
7
7
  klass.class_eval do
8
- option :tag,
9
- long: '--tag TAG',
10
- description: 'Add tag (can be used one or more times)',
8
+ "Add tag (can be used one or more times), specified text will be slugified".tap do |desc|
9
+ option :tag,
10
+ long: '--tag TAG',
11
+ description: desc,
12
+ default: [],
13
+ proc: proc { |v| composite_options(:tags) << v }
14
+
15
+ option :tag_slug,
16
+ long: '--tag-slug TAG',
17
+ description: desc,
18
+ default: [],
19
+ proc: proc { |v| composite_options(:slug_tags) << v }
20
+ end
21
+
22
+ option :tag_plain,
23
+ long: '--tag-plain TAG',
24
+ description: "Add tag (can be used one or more times)",
11
25
  default: [],
12
- proc: proc { |v| composite_options(:tags) << v }
26
+ proc: proc { |v| composite_options(:plain_tags) << v }
13
27
 
14
28
  option :tag_branch,
15
29
  long: '--tag-branch',
@@ -7,12 +7,21 @@ module Dapp
7
7
 
8
8
  def tags_by_scheme
9
9
  @tags_by_scheme_name ||= begin
10
- [simple_tags, branch_tags, commit_tags, build_tags, ci_tags].reduce({}) do |some_tags_by_scheme, tags_by_scheme|
11
- tags_by_scheme.in_depth_merge(some_tags_by_scheme)
12
- end.tap do |tags_by_scheme|
13
- [:git_branch, :git_tag, :custom].each do |scheme|
14
- tags_by_scheme[scheme].map!(&method(:consistent_uniq_slugify)) unless tags_by_scheme[scheme].nil?
10
+ {}.tap do |tags_by_scheme|
11
+ [slug_tags, branch_tags, ci_tags].each do |_tags_by_scheme|
12
+ _tags_by_scheme.each do |scheme, tags|
13
+ tags_by_scheme[scheme] ||= []
14
+ tags_by_scheme[scheme] += tags.map(&method(:consistent_uniq_slugify))
15
+ end
15
16
  end
17
+
18
+ [plain_tags, commit_tags, build_tags].each do |_tags_by_scheme|
19
+ _tags_by_scheme.each do |scheme, tags|
20
+ tags_by_scheme[scheme] ||= []
21
+ tags_by_scheme[scheme] += tags
22
+ end
23
+ end
24
+
16
25
  tags_by_scheme[:custom] = [:latest] if tags_by_scheme.values.flatten.empty?
17
26
  end
18
27
  end
@@ -22,8 +31,12 @@ module Dapp
22
31
  tags_by_scheme.values.flatten
23
32
  end
24
33
 
25
- def simple_tags
26
- { custom: options[:tag] }
34
+ def slug_tags
35
+ { custom: [*options[:tag], *options[:tag_slug]]}
36
+ end
37
+
38
+ def plain_tags
39
+ { custom: options[:tag_plain] }
27
40
  end
28
41
 
29
42
  def branch_tags
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.25.0"
2
+ VERSION = "0.25.1"
3
3
  BUILD_CACHE_VERSION = 26
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-29 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout