cl 0.1.15 → 0.1.16

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: b8928eba9781bc770ef2a863c04120309599a0a7
4
- data.tar.gz: bc645e9566d4a57e957a6fa22ffd3c8d2b578990
3
+ metadata.gz: c41314c277d727b80bcd73bb1493ad262e7aa62d
4
+ data.tar.gz: aa874747a62563ba17171d0669f218ae6667f645
5
5
  SHA512:
6
- metadata.gz: 61073bbfd0af9fd19083c27b20f8c27601f61fdd52d3388ed907f5cdf8bf783ba954dcae48097342fc6ec3dcacc7ffd1164fe0b16a0591e60d617b84196bb71d
7
- data.tar.gz: cf0c1cea7171e0bd6f29614ed0d063b4ab1bcddb99ff3e9a86df3797064e5f4fc5b8cc7094ae7686c7812d9f21fb767e7529e9225d16d02b9d338d1f6e186a5a
6
+ metadata.gz: 3864eb9b4f5d75db45ccc876d7c8c75bfe086ca3b4658300565bf03db4ada733633eab1d1c46c103243cb90f0624fe493c1705954704c916b58f3914f30a1d5b
7
+ data.tar.gz: 0a373a1d16ceaabfb0769b6cf4b92d69601a99dace4a60f3c1fc60e9491a3cf2c31ca2f6dd64a6347de0c408c2182bcaad85dcbc6138b7f8abd961e1f3b971fe
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cl (0.1.13)
4
+ cl (0.1.15)
5
5
  regstry (~> 1.0.3)
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  diff-lcs (1.3)
11
11
  memfs (1.0.0)
12
- regstry (1.0.9)
12
+ regstry (1.0.11)
13
13
  rspec (3.8.0)
14
14
  rspec-core (~> 3.8.0)
15
15
  rspec-expectations (~> 3.8.0)
@@ -39,6 +39,7 @@ class Cl
39
39
  opt '--help', 'Get help on this command'
40
40
 
41
41
  attr_reader :ctx, :args
42
+ attr_accessor :deprecations
42
43
 
43
44
  def initialize(ctx, args)
44
45
  args, opts = self.class.parse(ctx, args)
@@ -50,11 +51,5 @@ class Cl
50
51
  def opts
51
52
  @opts ||= {}
52
53
  end
53
-
54
- def deprecated_opts
55
- opts = self.class.opts.select(&:deprecated?)
56
- opts = opts.select { |opt| self.opts.key?(opt.deprecated[0]) }
57
- opts.map(&:deprecated).to_h
58
- end
59
54
  end
60
55
  end
@@ -16,6 +16,7 @@ class Cl
16
16
 
17
17
  def apply(cmd, opts)
18
18
  return opts if opts[:help]
19
+ cmd.deprecations = deprecations(cmd, opts)
19
20
  opts = with_defaults(cmd, opts)
20
21
  opts = downcase(opts)
21
22
  opts = cast(opts)
@@ -61,6 +62,12 @@ class Cl
61
62
 
62
63
  private
63
64
 
65
+ def deprecations(cmd, opts)
66
+ defs = cmd.class.opts.select(&:deprecated?)
67
+ defs = defs.select { |opt| opts.key?(opt.deprecated[0]) }
68
+ defs.map(&:deprecated).to_h
69
+ end
70
+
64
71
  def validate(cmd, opts)
65
72
  validate_requireds(cmd, opts)
66
73
  validate_required(opts)
@@ -1,3 +1,3 @@
1
1
  class Cl
2
- VERSION = '0.1.15'
2
+ VERSION = '0.1.16'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-11 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: regstry