optix 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +18 -4
- data/lib/optix.rb +2 -2
- data/lib/optix/version.rb +1 -1
- metadata +12 -12
data/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/busyloop/optix.png?branch=master)](https://travis-ci.org/busyloop/optix) [![Dependency Status](https://gemnasium.com/busyloop/optix.png)](https://gemnasium.com/busyloop/optix)
|
2
|
-
|
3
|
-
# Optix
|
1
|
+
# Optix [![Build Status](https://travis-ci.org/busyloop/optix.png?branch=master)](https://travis-ci.org/busyloop/optix) [![Dependency Status](https://gemnasium.com/busyloop/optix.png)](https://gemnasium.com/busyloop/optix)
|
4
2
|
|
5
3
|
Optix is a lightweight framework to build flexible, self-documenting
|
6
4
|
command line interfaces with a minimum amount of code.
|
@@ -78,7 +76,7 @@ The above code in action:
|
|
78
76
|
```
|
79
77
|
$ ./printer.rb --help
|
80
78
|
|
81
|
-
Usage: ./printer.rb <
|
79
|
+
Usage: ./printer.rb <command>
|
82
80
|
|
83
81
|
I am printer. I print strings to the screen.
|
84
82
|
Please invoke one of my not so many sub-commands.
|
@@ -90,6 +88,22 @@ Options:
|
|
90
88
|
Commands:
|
91
89
|
print Print a string
|
92
90
|
|
91
|
+
|
92
|
+
$ ./printer.rb print --help
|
93
|
+
|
94
|
+
Usage: ./printer.rb print <string>
|
95
|
+
|
96
|
+
Print a string to the screen
|
97
|
+
|
98
|
+
Options:
|
99
|
+
--count, -c <i>: Print how many times? (default: 1)
|
100
|
+
--debug, -d: Enable debugging
|
101
|
+
--help, -h: Show this message
|
102
|
+
|
103
|
+
|
104
|
+
$ ./printer.rb print -c 2 foobar
|
105
|
+
foobar
|
106
|
+
foobar
|
93
107
|
```
|
94
108
|
|
95
109
|
See the `examples/`-folder for more elaborate examples.
|
data/lib/optix.rb
CHANGED
@@ -22,7 +22,7 @@ class Optix
|
|
22
22
|
:text_header_subcommands => 'Subcommands:',
|
23
23
|
:text_header_topcommands => 'Commands:',
|
24
24
|
:text_header_options => 'Options:',
|
25
|
-
:text_param_subcommand => '<
|
25
|
+
:text_param_subcommand => '<command>'
|
26
26
|
}
|
27
27
|
@@tree = {}
|
28
28
|
end
|
@@ -59,7 +59,7 @@ class Optix
|
|
59
59
|
o[:params] = @@config[:text_param_subcommand]
|
60
60
|
end
|
61
61
|
|
62
|
-
text = o[:header].gsub('%0', $0).gsub('%command', cmdpath.join(' ')).gsub('%params', o[:params]).gsub(/ +/, ' ')
|
62
|
+
text = o[:header].gsub('%0', File.basename($0)).gsub('%command', cmdpath.join(' ')).gsub('%params', o[:params]).gsub(/ +/, ' ')
|
63
63
|
|
64
64
|
calls = []
|
65
65
|
calls << [:nowrap, [text], nil]
|
data/lib/optix/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chronic
|
16
|
-
requirement: &
|
16
|
+
requirement: &17490880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17490880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &17489920 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17489920
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &17488000 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *17488000
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
requirement: &
|
49
|
+
requirement: &17486920 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *17486920
|
58
58
|
description: Build flexible, self-documenting command line interfaces with a minimum
|
59
59
|
amount of code.
|
60
60
|
email:
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
segments:
|
98
98
|
- 0
|
99
|
-
hash:
|
99
|
+
hash: 3235936049040860319
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
102
102
|
requirements:
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
segments:
|
107
107
|
- 0
|
108
|
-
hash:
|
108
|
+
hash: 3235936049040860319
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
111
|
rubygems_version: 1.8.10
|