check_please 0.2.4 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: check_please
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Livingston-Gray
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: table_print
@@ -71,23 +71,28 @@ files:
71
71
  - README.md
72
72
  - Rakefile
73
73
  - bin/console
74
+ - bin/gh-md-toc
74
75
  - bin/setup
75
76
  - check_please.gemspec
76
77
  - exe/check_please
77
78
  - lib/check_please.rb
78
79
  - lib/check_please/cli.rb
79
- - lib/check_please/cli/flag.rb
80
80
  - lib/check_please/cli/parser.rb
81
81
  - lib/check_please/cli/runner.rb
82
82
  - lib/check_please/comparison.rb
83
83
  - lib/check_please/diff.rb
84
84
  - lib/check_please/diffs.rb
85
85
  - lib/check_please/error.rb
86
+ - lib/check_please/flag.rb
87
+ - lib/check_please/flags.rb
86
88
  - lib/check_please/path.rb
89
+ - lib/check_please/path_segment.rb
87
90
  - lib/check_please/printers.rb
88
91
  - lib/check_please/printers/base.rb
89
92
  - lib/check_please/printers/json.rb
90
93
  - lib/check_please/printers/table_print.rb
94
+ - lib/check_please/refinements.rb
95
+ - lib/check_please/reification.rb
91
96
  - lib/check_please/version.rb
92
97
  - usage_examples.rb
93
98
  homepage: https://github.com/RealGeeks/check_please
@@ -1,40 +0,0 @@
1
- module CheckPlease
2
- module CLI
3
-
4
- class Flag
5
- ATTR_NAMES = %i[ short long desc key block ]
6
- attr_accessor(*ATTR_NAMES)
7
-
8
- def initialize(*args)
9
- self.short = args.shift if args.any?
10
- self.long = args.shift if args.any?
11
-
12
- yield self if block_given?
13
-
14
- missing = ATTR_NAMES.select { |e| self.send(e).nil? }
15
- missing -= %i[ short ] # short is optional!
16
- if missing.any?
17
- raise ArgumentError, "Missing attributes: #{missing.join(', ')}"
18
- end
19
- end
20
-
21
- def visit_option_parser(parser, options)
22
- parser.on(short, long, desc) do |value|
23
- block.call options, value
24
- end
25
- end
26
-
27
- def set_key(key, message = nil, &b)
28
- raise ArgumentError if message && b
29
- raise ArgumentError if !message && !b
30
-
31
- self.key = key
32
- self.block = ->(options, value) {
33
- b ||= message.to_sym.to_proc
34
- options[key] = b.call(value)
35
- }
36
- end
37
- end
38
-
39
- end
40
- end