qb 0.1.34 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qb/options.rb +8 -12
- data/lib/qb/role.rb +1 -1
- data/lib/qb/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: 34b87b9d7874575c192ab37a4c7f017e2e5ab747
|
4
|
+
data.tar.gz: e01816796d5b073d666c4482b71a9b0c94126a9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da1f3337c183e348d05b4763bdc2a89bd1d715871623d2ac023c256568c962d22de2a50ce0cf18ff3e5a7dbdce5c463d2a3227846df0d9c361e43957d41f0954
|
7
|
+
data.tar.gz: 3dd4dfc1d842552a6b2bc218fe61daf334b6a1fd82f472df3411da4b5b0c5ebac0f5d9c0b4790398008318ea36e23f5c4f82cfd394a7589a94fbdd977c3e63fd
|
data/lib/qb/options.rb
CHANGED
@@ -66,14 +66,10 @@ module QB
|
|
66
66
|
# create an option
|
67
67
|
option = Option.new role, option_meta, include_path
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
on_args = [arg_style]
|
76
|
-
# on_args = []
|
69
|
+
# this dictates whether or not the option's *argument* is required.
|
70
|
+
# we always require the argument, except in the case of boolean
|
71
|
+
# options or options that accept false.
|
72
|
+
on_args = [:REQUIRED]
|
77
73
|
|
78
74
|
if option.meta['type'] == 'boolean'
|
79
75
|
# don't use short names when included (for now)
|
@@ -137,14 +133,14 @@ module QB
|
|
137
133
|
end
|
138
134
|
|
139
135
|
if role.defaults.key? option.var_name
|
140
|
-
|
141
|
-
if role.defaults[option.var_name]
|
136
|
+
if option.meta['type'] == 'boolean'
|
137
|
+
on_args << if role.defaults[option.var_name]
|
142
138
|
"DEFAULT: --#{ option.cli_name }"
|
143
139
|
else
|
144
140
|
"DEFAULT: --no-#{ option.cli_name }"
|
145
141
|
end
|
146
|
-
|
147
|
-
"DEFAULT: #{ role.defaults[option.var_name] }"
|
142
|
+
elsif !role.defaults[option.var_name].nil?
|
143
|
+
on_args << "DEFAULT: #{ role.defaults[option.var_name] }"
|
148
144
|
end
|
149
145
|
end
|
150
146
|
|
data/lib/qb/role.rb
CHANGED
data/lib/qb/version.rb
CHANGED