libclimate-ruby 0.17.0 → 0.17.0.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/LICENSE +23 -21
- data/README.md +57 -30
- data/examples/flag_and_option_specifications.from_DATA.md +29 -29
- data/examples/flag_and_option_specifications.from_DATA.rb +4 -4
- data/examples/flag_and_option_specifications.md +45 -45
- data/examples/flag_and_option_specifications.rb +22 -22
- data/examples/show_usage_and_version.md +16 -16
- 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 +15 -15
- data/test/scratch/specifications.rb +23 -23
- data/test/unit/tc_abort.rb +43 -43
- data/test/unit/tc_double_slash_index.rb +74 -74
- data/test/unit/tc_infer_version.rb +48 -48
- data/test/unit/tc_minimal.rb +516 -516
- data/test/unit/tc_minimal_CLASP.rb +323 -323
- data/test/unit/tc_parse.rb +105 -105
- data/test/unit/tc_parse_and_verify.rb +94 -94
- data/test/unit/tc_test_specifications.rb +49 -49
- data/test/unit/tc_values.rb +294 -293
- data/test/unit/tc_with_blocks.rb +19 -19
- data/test/unit/tc_with_blocks_CLASP.rb +19 -19
- metadata +6 -6
|
@@ -19,15 +19,15 @@ require 'libclimate'
|
|
|
19
19
|
|
|
20
20
|
climate = LibCLImate::Climate.new do |cl|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
cl.version = [ 0, 1, 0 ]
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
cl.info_lines = [
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
'libCLImate.Ruby examples',
|
|
27
|
+
:version,
|
|
28
|
+
"Illustrates use of libCLImate.Ruby's automatic support for '--help' and '--version'",
|
|
29
|
+
'',
|
|
30
|
+
]
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
climate.parse_and_verify ARGV
|
|
@@ -44,13 +44,13 @@ $stdout.puts 'no flags specified'
|
|
|
44
44
|
If executed with no arguments
|
|
45
45
|
|
|
46
46
|
```
|
|
47
|
-
|
|
47
|
+
ruby examples/show_usage_and_version.rb
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
or (in a Unix shell):
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
|
|
53
|
+
./examples/show_usage_and_version.rb
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
it gives the output:
|
|
@@ -64,7 +64,7 @@ no flags specified
|
|
|
64
64
|
If executed with the arguments
|
|
65
65
|
|
|
66
66
|
```
|
|
67
|
-
|
|
67
|
+
ruby examples/show_usage_and_version.rb --help
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
it gives the output:
|
|
@@ -78,11 +78,11 @@ USAGE: show_usage_and_version.rb [ ... flags and options ... ]
|
|
|
78
78
|
|
|
79
79
|
flags/options:
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
--help
|
|
82
|
+
shows this help and terminates
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
--version
|
|
85
|
+
shows version and terminates
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
### Show version
|
|
@@ -90,7 +90,7 @@ flags/options:
|
|
|
90
90
|
If executed with the arguments
|
|
91
91
|
|
|
92
92
|
```
|
|
93
|
-
|
|
93
|
+
ruby examples/show_usage_and_version.rb --version
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
it gives the output:
|
|
@@ -104,7 +104,7 @@ show_usage_and_version.rb 0.1.0
|
|
|
104
104
|
If executed with the arguments
|
|
105
105
|
|
|
106
106
|
```
|
|
107
|
-
|
|
107
|
+
ruby examples/show_usage_and_version.rb --unknown=value
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
it gives the output (on the standard error stream):
|
|
@@ -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
|