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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/lib/yoptparse/command.rb +4 -1
- data/lib/yoptparse/option.rb +26 -18
- data/lib/yoptparse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e222f69543c463641e19558f874a28b66a6dac3
|
4
|
+
data.tar.gz: 6922d5128e278a9e0d8f1e9a4c06abff40360f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67e472a020631fbe002bcc1c8c32dfe6a1b4a40f5ee3927c287b5c92b040dcc9f68c1c405d79f39690b012a6c82fec054760187530d27baece02f5004458280b
|
7
|
+
data.tar.gz: 7ce0a887e8d4ceca705f8cfcf4487ebff2a54d8f9e38c1aea5ee4dab61624ce0a1fdd3e9c98d0c563cec20d401a263c8e579fe85c62fe0a0dfd1641ad9a1154f
|
data/CHANGELOG.md
CHANGED
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
|
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:
|
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
|
73
|
+
p ExampleCommand.parse(ARGV)
|
74
74
|
```
|
75
75
|
|
76
76
|
```
|
77
|
-
#<
|
77
|
+
#<ExampleCommand:0x007ff6e41b8ea0 @destination="/path/to/emoji", @format="png", @provider="twemoji", @quiet=false, @size=64>
|
78
78
|
```
|
79
79
|
|
80
80
|
### Documentation
|
data/lib/yoptparse/command.rb
CHANGED
@@ -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>]
|
data/lib/yoptparse/option.rb
CHANGED
@@ -21,23 +21,27 @@ module Yoptparse
|
|
21
21
|
|
22
22
|
# @return [Class]
|
23
23
|
def type_class
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
54
|
+
if tag
|
55
|
+
tag.type == "Boolean"
|
56
|
+
else
|
57
|
+
false
|
58
|
+
end
|
51
59
|
end
|
52
60
|
|
53
61
|
# @return [String]
|
data/lib/yoptparse/version.rb
CHANGED