optix 1.2.4 → 1.2.5
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 +7 -0
- data/.ruby-version +1 -0
- data/.travis.yml +1 -7
- data/README.md +18 -20
- data/Rakefile +2 -2
- data/lib/optix/version.rb +1 -1
- metadata +18 -33
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a3e1e0585a508fdab6a198f577a96dd4fcf8daf9
|
4
|
+
data.tar.gz: ab099bb3605be50517767e1696e8f701692cec82
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 18905341887879a973e1f4d31cb2691e9bbf2ad2388b4d9ace4ca304a12a0587fa69682895c0e01b9e63e0c3b649d7b55484caa35227b7f53a69cd5c9e05ad1f
|
7
|
+
data.tar.gz: f475ef0ad2e546008d211214fc2c9c436b614f403d036b122646771141a62f34c22b5cee2230283c552ca5da4a511932d2ed385be5eb26884deb4abf621f5ca0
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.0
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Optix [](https://travis-ci.org/busyloop/optix) [](https://gemnasium.com/busyloop/optix)
|
1
|
+
# Optix [](https://travis-ci.org/busyloop/optix) [](https://gemnasium.com/busyloop/optix) [](https://badge.fury.io/rb/optix)
|
2
2
|
|
3
3
|
Optix is a lightweight framework to build flexible, self-documenting
|
4
4
|
command line interfaces with a minimum amount of code.
|
@@ -20,8 +20,6 @@ help-screens and provides a wide range of argument-types and validations.
|
|
20
20
|
|
21
21
|
* Automatic validation and help-screens.
|
22
22
|
|
23
|
-
* Should work on all major Ruby versions (tested on 1.9.3, 1.9.2 and 1.8.7).
|
24
|
-
|
25
23
|
|
26
24
|
## Installation
|
27
25
|
|
@@ -42,11 +40,11 @@ module Example
|
|
42
40
|
# A label to be printed on the root help-screen
|
43
41
|
text "I am printer. I print strings to the screen."
|
44
42
|
text "Please invoke one of my not so many sub-commands."
|
45
|
-
|
43
|
+
|
46
44
|
# An option that is inherited by all commands
|
47
45
|
opt :debug, "Enable debugging", :default => false
|
48
46
|
end
|
49
|
-
|
47
|
+
|
50
48
|
# Declare a command called "print"
|
51
49
|
desc "Print a string"
|
52
50
|
text "Print a string to the screen"
|
@@ -77,29 +75,29 @@ The above code in action:
|
|
77
75
|
$ ./printer.rb --help
|
78
76
|
|
79
77
|
Usage: ./printer.rb <command>
|
80
|
-
|
78
|
+
|
81
79
|
I am printer. I print strings to the screen.
|
82
80
|
Please invoke one of my not so many sub-commands.
|
83
|
-
|
81
|
+
|
84
82
|
Options:
|
85
83
|
--debug, -d: Enable debugging
|
86
84
|
--help, -h: Show this message
|
87
85
|
|
88
86
|
Commands:
|
89
87
|
print Print a string
|
90
|
-
|
88
|
+
|
91
89
|
|
92
90
|
$ ./printer.rb print --help
|
93
91
|
|
94
92
|
Usage: ./printer.rb print <string>
|
95
|
-
|
93
|
+
|
96
94
|
Print a string to the screen
|
97
|
-
|
95
|
+
|
98
96
|
Options:
|
99
97
|
--count, -c <i>: Print how many times? (default: 1)
|
100
98
|
--debug, -d: Enable debugging
|
101
99
|
--help, -h: Show this message
|
102
|
-
|
100
|
+
|
103
101
|
|
104
102
|
$ ./printer.rb print -c 2 foobar
|
105
103
|
foobar
|
@@ -287,7 +285,7 @@ module Example
|
|
287
285
|
# A label to be printed on the root help-screen
|
288
286
|
text "I am printer. I print strings to the screen."
|
289
287
|
text "Please invoke one of my not so many sub-commands."
|
290
|
-
|
288
|
+
|
291
289
|
# An option that is inherited by all commands
|
292
290
|
opt :debug, "Enable debugging", :default => false
|
293
291
|
|
@@ -297,7 +295,7 @@ module Example
|
|
297
295
|
puts "Version 1.0"
|
298
296
|
end
|
299
297
|
end
|
300
|
-
|
298
|
+
|
301
299
|
# Declare a command called "print"
|
302
300
|
desc "Print a string"
|
303
301
|
text "Print a string to the screen"
|
@@ -345,7 +343,7 @@ end
|
|
345
343
|
|
346
344
|
Takes the following optional arguments:
|
347
345
|
|
348
|
-
* `:long` Specify the long form of the argument, i.e. the form with two dashes.
|
346
|
+
* `:long` Specify the long form of the argument, i.e. the form with two dashes.
|
349
347
|
If unspecified, will be automatically derived based on the argument name by turning the name
|
350
348
|
option into a string, and replacing any _'s by -'s.
|
351
349
|
|
@@ -368,28 +366,28 @@ Takes the following optional arguments:
|
|
368
366
|
|
369
367
|
* `:required` If set to **true**, the argument must be provided on the commandline.
|
370
368
|
|
371
|
-
* `:multi` If set to **true**, allows multiple occurrences of the option on the commandline.
|
369
|
+
* `:multi` If set to **true**, allows multiple occurrences of the option on the commandline.
|
372
370
|
Otherwise, only a single instance of the option is allowed.
|
373
371
|
|
374
372
|
Note that there are two types of argument multiplicity: an argument
|
375
373
|
can take multiple values, e.g. "--arg 1 2 3". An argument can also
|
376
374
|
be allowed to occur multiple times, e.g. "--arg 1 --arg 2".
|
377
|
-
|
375
|
+
|
378
376
|
Arguments that take multiple values should have a `:type` parameter
|
379
377
|
or a `:default` value of an array of the correct type (e.g. [String]).
|
380
|
-
|
378
|
+
|
381
379
|
The value of this argument will be an array of the parameters on the
|
382
380
|
commandline.
|
383
|
-
|
381
|
+
|
384
382
|
Arguments that can occur multiple times should be marked with
|
385
383
|
`:multi => true`. The value of this argument will also be an array.
|
386
384
|
In contrast with regular non-multi options, if not specified on
|
387
385
|
the commandline, the default value will be [], not nil.
|
388
|
-
|
386
|
+
|
389
387
|
These two attributes can be combined (e.g. **:type => :strings**,
|
390
388
|
**:multi => true**), in which case the value of the argument will be
|
391
389
|
an array of arrays.
|
392
|
-
|
390
|
+
|
393
391
|
There's one ambiguous case to be aware of: when `:multi` is **true** and a
|
394
392
|
`:default` is set to an array (of something), it's ambiguous whether this
|
395
393
|
is a multi-value argument as well as a multi-occurrence argument.
|
data/Rakefile
CHANGED
@@ -7,14 +7,14 @@ task :default => :test
|
|
7
7
|
|
8
8
|
RSpec::Core::RakeTask.new("test:spec") do |t|
|
9
9
|
t.pattern = 'spec/*_spec.rb'
|
10
|
-
t.rcov = false
|
10
|
+
#t.rcov = false
|
11
11
|
#t.rspec_opts = '-b -c -f progress --tag ~benchmark'
|
12
12
|
t.rspec_opts = '--fail-fast -b -c -f documentation --tag ~benchmark'
|
13
13
|
end
|
14
14
|
|
15
15
|
RSpec::Core::RakeTask.new("test:benchmark") do |t|
|
16
16
|
t.pattern = 'spec/*.rb'
|
17
|
-
t.rcov = false
|
17
|
+
#t.rcov = false
|
18
18
|
t.rspec_opts = '-b -c -f documentation --tag benchmark'
|
19
19
|
end
|
20
20
|
|
data/lib/optix/version.rb
CHANGED
metadata
CHANGED
@@ -1,78 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Moe
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-12-25 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: chronic
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: simplecov
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
description: Build flexible, self-documenting command line interfaces with a minimum
|
@@ -83,8 +74,9 @@ executables: []
|
|
83
74
|
extensions: []
|
84
75
|
extra_rdoc_files: []
|
85
76
|
files:
|
86
|
-
- .gitignore
|
87
|
-
- .
|
77
|
+
- ".gitignore"
|
78
|
+
- ".ruby-version"
|
79
|
+
- ".travis.yml"
|
88
80
|
- Gemfile
|
89
81
|
- LICENSE
|
90
82
|
- README.md
|
@@ -104,33 +96,26 @@ files:
|
|
104
96
|
- spec/spec_helper.rb
|
105
97
|
homepage: https://github.com/busyloop/optix
|
106
98
|
licenses: []
|
99
|
+
metadata: {}
|
107
100
|
post_install_message:
|
108
101
|
rdoc_options: []
|
109
102
|
require_paths:
|
110
103
|
- lib
|
111
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
-
none: false
|
113
105
|
requirements:
|
114
|
-
- -
|
106
|
+
- - ">="
|
115
107
|
- !ruby/object:Gem::Version
|
116
108
|
version: '0'
|
117
|
-
segments:
|
118
|
-
- 0
|
119
|
-
hash: 3973238625638004697
|
120
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
110
|
requirements:
|
123
|
-
- -
|
111
|
+
- - ">="
|
124
112
|
- !ruby/object:Gem::Version
|
125
113
|
version: '0'
|
126
|
-
segments:
|
127
|
-
- 0
|
128
|
-
hash: 3973238625638004697
|
129
114
|
requirements: []
|
130
115
|
rubyforge_project:
|
131
|
-
rubygems_version:
|
116
|
+
rubygems_version: 2.6.8
|
132
117
|
signing_key:
|
133
|
-
specification_version:
|
118
|
+
specification_version: 4
|
134
119
|
summary: Build flexible, self-documenting command line interfaces with a minimum amount
|
135
120
|
of code.
|
136
121
|
test_files:
|