libclimate-ruby 0.17.0 → 0.17.0.1
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/examples/flag_and_option_specifications.from_DATA.rb +4 -4
- data/examples/flag_and_option_specifications.rb +22 -22
- data/examples/show_usage_and_version.rb +7 -7
- data/lib/libclimate/climate.rb +1000 -1000
- data/lib/libclimate/version.rb +14 -14
- data/test/scratch/blankzeroes.rb +14 -14
- data/test/scratch/specifications.rb +23 -23
- data/test/unit/tc_abort.rb +42 -42
- data/test/unit/tc_double_slash_index.rb +73 -73
- data/test/unit/tc_infer_version.rb +47 -47
- data/test/unit/tc_minimal.rb +516 -516
- data/test/unit/tc_minimal_CLASP.rb +323 -323
- data/test/unit/tc_parse.rb +104 -104
- data/test/unit/tc_parse_and_verify.rb +93 -93
- data/test/unit/tc_test_specifications.rb +48 -48
- data/test/unit/tc_values.rb +294 -294
- data/test/unit/tc_with_blocks.rb +18 -18
- data/test/unit/tc_with_blocks_CLASP.rb +18 -18
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 981bdf923fb9c2577fbedff4c7c1eb439c9b1f6bad3e58fcb12c3b03176f115a
|
4
|
+
data.tar.gz: 14873ddc1ddf50b39c4d71ca2ead31168f429aa7c9c386c03f2f788f2061e09e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02c54de2518d6b8cb30dce87b5f67fb0e85be6ea81d3ef98622b62de8563d448d34e2559a6a1ac5736812e6940ca551c496eef8b155b2e1e8ec6f4c7f1222d86
|
7
|
+
data.tar.gz: bdb598044e0dbc18c0bbfe70e494fc4368765ac120865bd5c54d0d2544cf8bbef22fd698cc2213e47631748c04a1a36a9cf52dee738d3870b9b33c8dad208ba3
|
@@ -13,9 +13,9 @@ require 'libclimate'
|
|
13
13
|
options = {}
|
14
14
|
climate = LibCLImate::Climate.load DATA do |cl|
|
15
15
|
|
16
|
-
|
16
|
+
cl.on_flag('--debug') { options[:debug] = true }
|
17
17
|
|
18
|
-
|
18
|
+
cl.on_option('--verbosity') { |o, a| options[:verbosity] = o.value }
|
19
19
|
end
|
20
20
|
|
21
21
|
r = climate.parse_and_verify ARGV
|
@@ -25,12 +25,12 @@ r = climate.parse_and_verify ARGV
|
|
25
25
|
|
26
26
|
if options[:verbosity]
|
27
27
|
|
28
|
-
|
28
|
+
$stdout.puts "verbosity is specified as: #{options[:verbosity]}"
|
29
29
|
end
|
30
30
|
|
31
31
|
if options[:debug]
|
32
32
|
|
33
|
-
|
33
|
+
$stdout.puts 'Debug mode is specified'
|
34
34
|
end
|
35
35
|
|
36
36
|
|
@@ -11,33 +11,33 @@ require 'libclimate'
|
|
11
11
|
options = {}
|
12
12
|
climate = LibCLImate::Climate.new do |cl|
|
13
13
|
|
14
|
-
|
14
|
+
cl.add_flag('--debug', alias: '-d', help: 'runs in Debug mode') do
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
options[:debug] = true
|
17
|
+
end
|
18
|
+
cl.add_option('--verbosity', alias: '-v', help: 'specifies the verbosity', values: [ 'terse', 'quiet', 'silent', 'chatty' ]) do |o, a|
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
options[:verbosity] = o.value
|
21
|
+
end
|
22
|
+
cl.add_alias('--verbosity=chatty', '-c')
|
23
23
|
|
24
|
-
|
24
|
+
cl.version = [ 0, 1, 0 ]
|
25
25
|
|
26
|
-
|
26
|
+
cl.info_lines = [
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
'libCLImate.Ruby examples',
|
29
|
+
:version,
|
30
|
+
"Illustrates use of libCLImate.Ruby's specification of flags, options, and specifications",
|
31
|
+
'',
|
32
|
+
]
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
cl.constrain_values = 1..2
|
35
|
+
cl.usage_values = "<dir-1> [ <dir-2> ]"
|
36
|
+
cl.value_names = [
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
"first directory",
|
39
|
+
"second directory",
|
40
|
+
]
|
41
41
|
end
|
42
42
|
|
43
43
|
r = climate.parse_and_verify ARGV
|
@@ -48,12 +48,12 @@ r = climate.parse_and_verify ARGV
|
|
48
48
|
|
49
49
|
if options[:verbosity]
|
50
50
|
|
51
|
-
|
51
|
+
$stdout.puts "verbosity is specified as: #{options[:verbosity]}"
|
52
52
|
end
|
53
53
|
|
54
54
|
if options[:debug]
|
55
55
|
|
56
|
-
|
56
|
+
$stdout.puts 'Debug mode is specified'
|
57
57
|
end
|
58
58
|
|
59
59
|
|
@@ -10,15 +10,15 @@ require 'libclimate'
|
|
10
10
|
|
11
11
|
climate = LibCLImate::Climate.new do |cl|
|
12
12
|
|
13
|
-
|
13
|
+
cl.version = [ 0, 1, 0 ]
|
14
14
|
|
15
|
-
|
15
|
+
cl.info_lines = [
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
'libCLImate.Ruby examples',
|
18
|
+
:version,
|
19
|
+
"Illustrates use of libCLImate.Ruby's automatic support for '--help' and '--version'",
|
20
|
+
'',
|
21
|
+
]
|
22
22
|
end
|
23
23
|
|
24
24
|
climate.parse_and_verify ARGV
|