baf 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/baf/cli.rb +1 -1
- data/lib/baf/option.rb +16 -9
- data/lib/baf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 150c3cca7fba34de369d231d80ac5d40570b788e
|
4
|
+
data.tar.gz: eae88fb291406234386f09da17458982395d4af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf3c301be34c11193d54e90234ce1cfba6420ac1ed8f721ac032fa7a47d342f41978df191c3f9283329e1f2a420c51786b3c80d24cd304973db3a30d343de32
|
7
|
+
data.tar.gz: e5993ca64496e85ee17ebb676a1a996348afa12b5da7201c7b471cce4f2bbda5f9bbb6f86363bd5fb7f56425e012c38daa077fffb772660b6f0f91b212c1d0dc
|
data/lib/baf/cli.rb
CHANGED
data/lib/baf/option.rb
CHANGED
@@ -13,16 +13,23 @@ module Baf
|
|
13
13
|
|
14
14
|
protected
|
15
15
|
|
16
|
-
def build_attrs(short, long,
|
16
|
+
def build_attrs(short, long, arg_or_desc = nil, desc_or_block = nil)
|
17
17
|
{
|
18
18
|
short: short,
|
19
|
-
long: long
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
long: long
|
20
|
+
}.merge case desc_or_block
|
21
|
+
when Proc
|
22
|
+
{
|
23
|
+
desc: arg_or_desc,
|
24
|
+
block: desc_or_block
|
25
|
+
}
|
26
|
+
when String
|
27
|
+
{
|
28
|
+
arg: arg_or_desc,
|
29
|
+
desc: desc_or_block
|
30
|
+
}
|
31
|
+
else
|
32
|
+
{}
|
26
33
|
end
|
27
34
|
end
|
28
35
|
|
@@ -30,7 +37,7 @@ module Baf
|
|
30
37
|
[
|
31
38
|
'--' + long.to_s.tr(?_, ?-),
|
32
39
|
arg
|
33
|
-
].join ' '
|
40
|
+
].compact.join ' '
|
34
41
|
end
|
35
42
|
end
|
36
43
|
end
|
data/lib/baf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: baf-testing
|