yoptparse 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59302e92b651d68a88f7a3af8ae13b526fc1812e
4
- data.tar.gz: c35647916c42ead200860812d1fab3f251cdd43d
3
+ metadata.gz: 0e222f69543c463641e19558f874a28b66a6dac3
4
+ data.tar.gz: 6922d5128e278a9e0d8f1e9a4c06abff40360f04
5
5
  SHA512:
6
- metadata.gz: 31da0a36da9c4680d6de1a7b969aabcd2cbb037c5e5d118c5d117fa03e9c82810fe0954642f0c25449a6724b33569d200c8d1c721a973ac44df97cb3eff0a302
7
- data.tar.gz: 0e48bef531c20b60b0b96d5ecfa8720f4add9903867b9d40f98bd2e2534e1d96250850f2e9a277e11bf51b998f34227cdc7423c431205072633bbcb3a28be9fb
6
+ metadata.gz: 67e472a020631fbe002bcc1c8c32dfe6a1b4a40f5ee3927c287b5c92b040dcc9f68c1c405d79f39690b012a6c82fec054760187530d27baece02f5004458280b
7
+ data.tar.gz: 7ce0a887e8d4ceca705f8cfcf4487ebff2a54d8f9e38c1aea5ee4dab61624ce0a1fdd3e9c98d0c563cec20d401a263c8e579fe85c62fe0a0dfd1641ad9a1154f
@@ -1,3 +1,7 @@
1
+ ## v0.1.2
2
+
3
+ - Support no YARD comments case
4
+
1
5
  ## v0.1.1
2
6
 
3
7
  - Return a new instance from Yoptparse::Command.parse
data/README.md CHANGED
@@ -32,7 +32,7 @@ Inherit `Yoptparse::Command` and define `#initialize` method with YARD style doc
32
32
 
33
33
  ```ruby
34
34
  class ExampleCommand < Yoptparse::Command
35
- # Usage: somemoji extract [options]
35
+ # Usage example-command [options]
36
36
  # @param destination [String] Directory path to put extracted emoji images
37
37
  # @param format [String] png or svg (default: png)
38
38
  # @param provider [String] Emoji provider name (apple, emoji_one, noto or twemoji)
@@ -57,7 +57,7 @@ puts ExampleCommand.to_option_parser
57
57
  ```
58
58
 
59
59
  ```
60
- Usage: somemoji extract [options]
60
+ Usage: example-command [options]
61
61
  --destination= Directory path to put extracted emoji images (required)
62
62
  --provider= Emoji provider name (apple, emoji_one, noto or twemoji) (required)
63
63
  --format= png or svg (default: png)
@@ -70,11 +70,11 @@ Usage: somemoji extract [options]
70
70
  Create a new instance from ARGV parse result.
71
71
 
72
72
  ```ruby
73
- p SomemojiExtractCommand.parse(ARGV)
73
+ p ExampleCommand.parse(ARGV)
74
74
  ```
75
75
 
76
76
  ```
77
- #<SomemojiExtractCommand:0x007ff6e41b8ea0 @destination="/path/to/emoji", @format="png", @provider="twemoji", @quiet=false, @size=64>
77
+ #<ExampleCommand:0x007ff6e41b8ea0 @destination="/path/to/emoji", @format="png", @provider="twemoji", @quiet=false, @size=64>
78
78
  ```
79
79
 
80
80
  ### Documentation
@@ -3,7 +3,10 @@ module Yoptparse
3
3
  class << self
4
4
  # @return [String]
5
5
  def banner
6
- ::YARD::Registry.at("#{self}#initialize").docstring
6
+ string = ::YARD::Registry.at("#{self}#initialize").docstring
7
+ unless string.empty?
8
+ string
9
+ end
7
10
  end
8
11
 
9
12
  # @param argv [Array<String>]
@@ -21,23 +21,27 @@ module Yoptparse
21
21
 
22
22
  # @return [Class]
23
23
  def type_class
24
- case tag.type
25
- when "Array"
26
- ::Array
27
- when "Float"
28
- ::Float
29
- when "Integer"
30
- ::Integer
31
- when "Numeric"
32
- ::Numeric
33
- when "OptionParser::DecimalInteger"
34
- ::OptionParser::DecimalInteger
35
- when "OptionParser::DecimalNumeric"
36
- ::OptionParser::DecimalNumeric
37
- when "OptionParser::OctalInteger"
38
- ::OptionParser::OctalInteger
39
- when "String"
40
- ::String
24
+ if tag
25
+ case tag.type
26
+ when "Array"
27
+ ::Array
28
+ when "Float"
29
+ ::Float
30
+ when "Integer"
31
+ ::Integer
32
+ when "Numeric"
33
+ ::Numeric
34
+ when "OptionParser::DecimalInteger"
35
+ ::OptionParser::DecimalInteger
36
+ when "OptionParser::DecimalNumeric"
37
+ ::OptionParser::DecimalNumeric
38
+ when "OptionParser::OctalInteger"
39
+ ::OptionParser::OctalInteger
40
+ when "String"
41
+ ::String
42
+ else
43
+ ::Object
44
+ end
41
45
  else
42
46
  ::Object
43
47
  end
@@ -47,7 +51,11 @@ module Yoptparse
47
51
 
48
52
  # @return [Boolean]
49
53
  def boolean?
50
- tag.type == "Boolean"
54
+ if tag
55
+ tag.type == "Boolean"
56
+ else
57
+ false
58
+ end
51
59
  end
52
60
 
53
61
  # @return [String]
@@ -1,3 +1,3 @@
1
1
  module Yoptparse
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoptparse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura