help_parser 6.3.0 → 6.4.0

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
  SHA256:
3
- metadata.gz: b8f371bee63827fcbd8051796c5fce3421da5a3fc41bf6223e546c28ec99362c
4
- data.tar.gz: 4484cae785efb013dfccdbcec34a7f17ed89fe013b0a5018c31f4515e87a9439
3
+ metadata.gz: 713b3cb216b09e561ca011191c8e3aec1fea1798a547360398f355031a4c4ef5
4
+ data.tar.gz: b42f145cb7fa4089e76802d26a3ae7b39a67f3dd7f1dd9ade9e9769d620790ad
5
5
  SHA512:
6
- metadata.gz: ad1de10f9ba6c1788db1dcae160c5fe8ea8c61432d388c097aab22efe8edfa6f86e22131e43159f8ab944615e8e3aa9e66fa714131e0347a241ded901aba8926
7
- data.tar.gz: c4086cff775108315243f191acb81d243b792fdc18718b5390070b67f9b2174f8f5a517bf3a665807a4122bce80118799559f5883142e914f748eaa5f8895884
6
+ metadata.gz: 4c3a98296b366961938b28dfb54586547444405a86a0567321eea4c1c1f8210e86ed1e897a824fd7e78fc92b52843a3b0a5ab694038dca8d241850c150cd6c4a
7
+ data.tar.gz: ea9f6fbff247b25bfd1d96c404ae6adba54f164789570458d7943b7a9d8dfa68fd7118f5577f18362975f940cb205a312cbfb648c8f56d6ecb9915a7032911f9
data/README.md CHANGED
@@ -63,6 +63,11 @@ I prefer easy.
63
63
  Well, what do you think?
64
64
  PERFECT!
65
65
 
66
+ ## New for 6.4.0:
67
+
68
+ * Automates $VERBOSE=true on --verbose
69
+ * Reports typos you may have on options usage
70
+
66
71
  ## New for 6.1.0:
67
72
 
68
73
  Running your `awesome` command with the `--help` flag will also check your help text for errors,
@@ -21,6 +21,11 @@ module HelpParser
21
21
  @cache.clear
22
22
  end
23
23
  end
24
+ if _ = @specs["options"]
25
+ dict = _.flatten.map{|_|_.scan(/\w+/).first}
26
+ typos = @hash.keys.select{|k|k.is_a? String and not dict.include? k}
27
+ raise UsageError, MSG[UNRECOGNIZED, typos] unless typos.empty?
28
+ end
24
29
  raise UsageError, MATCH_USAGE
25
30
  end
26
31
 
@@ -54,6 +54,7 @@ module HelpParser
54
54
  UNRECOGNIZED_TYPE = 'Unrecognized type spec'
55
55
  UNRECOGNIZED_X = 'Unrecognized exclusive spec'
56
56
  UNRECOGNIZED_OPTION = 'Unrecognized option spec'
57
+ UNRECOGNIZED = 'Unrecognized'
57
58
  UNDEFINED_SECTION = 'Section not defined'
58
59
  MISSING_CASES = 'Missing cases'
59
60
  MISSING_USAGE = 'Missing usage'
@@ -23,6 +23,7 @@ module HelpParser
23
23
  exclusive.each{|xs| raise HelpParser::UsageError, MSG[EXCLUSIVE_KEYS,*xs] if @hash.keys.count{|k|xs.include?(k)}>1}
24
24
  end
25
25
  end
26
+ $VERBOSE = true if @hash['verbose']==true
26
27
  end
27
28
 
28
29
  def _hash
data/lib/help_parser.rb CHANGED
@@ -11,7 +11,7 @@ require_relative './help_parser/options'
11
11
  require_relative './help_parser/macros'
12
12
 
13
13
  module HelpParser
14
- VERSION = '6.3.0'
14
+ VERSION = '6.4.0'
15
15
 
16
16
  def self.[](
17
17
  version = nil,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: help_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.0
4
+ version: 6.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-08-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Welcome to the best Help Parser of all!
@@ -54,9 +54,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements:
57
- - 'ruby: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]'
57
+ - 'ruby: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]'
58
58
  rubyforge_project:
59
- rubygems_version: 2.7.3
59
+ rubygems_version: 2.7.6
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Welcome to the best Help Parser of all! Tweeker! Which do you find most helpful?