cli 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +5 -7
- data/Gemfile.lock +29 -37
- data/README.md +17 -18
- data/Rakefile +1 -28
- data/cli.gemspec +14 -84
- data/rdoc/CLI/Arguments.html +178 -0
- data/rdoc/CLI/DSL/Argument.html +200 -0
- data/rdoc/CLI/DSL/Arguments.html +172 -0
- data/rdoc/CLI/DSL/Base.html +154 -0
- data/rdoc/CLI/DSL/Cast.html +152 -0
- data/rdoc/CLI/DSL/Description.html +150 -0
- data/rdoc/CLI/DSL/Input.html +143 -0
- data/rdoc/CLI/DSL/MultiDefault.html +151 -0
- data/rdoc/CLI/DSL/Option.html +143 -0
- data/rdoc/CLI/DSL/Options.html +142 -0
- data/rdoc/CLI/DSL/Switch.html +267 -0
- data/rdoc/CLI/DSL/Value.html +238 -0
- data/rdoc/CLI/DSL.html +91 -0
- data/rdoc/CLI/Options.html +200 -0
- data/rdoc/CLI/ParserError/ArgumentNameSpecifiedTwice.html +138 -0
- data/rdoc/CLI/ParserError/LongNameSpecifiedTwiceError.html +138 -0
- data/rdoc/CLI/ParserError/MultipleArgumentsSpecifierError.html +138 -0
- data/rdoc/CLI/ParserError/NameArgumetNotSymbolError.html +138 -0
- data/rdoc/CLI/ParserError/OptionsArgumentNotHashError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameIsInvalidError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameNotSymbolError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameSpecifiedTwiceError.html +138 -0
- data/rdoc/CLI/ParserError.html +97 -0
- data/rdoc/CLI/ParsingError/CastError.html +138 -0
- data/rdoc/CLI/ParsingError/MandatoryArgumentNotSpecifiedError.html +138 -0
- data/rdoc/CLI/ParsingError/MandatoryOptionsNotSpecifiedError.html +138 -0
- data/rdoc/CLI/ParsingError/MissingOptionValueError.html +138 -0
- data/rdoc/CLI/ParsingError/UnknownSwitchError.html +138 -0
- data/rdoc/CLI/ParsingError/UsageError.html +97 -0
- data/rdoc/CLI/ParsingError.html +97 -0
- data/rdoc/CLI/Switches.html +306 -0
- data/rdoc/CLI/Values.html +202 -0
- data/rdoc/CLI.html +652 -0
- data/rdoc/README_md.html +553 -0
- data/rdoc/created.rid +7 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +639 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +120 -0
- data/rdoc/js/darkfish.js +84 -0
- data/rdoc/js/navigation.js +105 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +110 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +533 -0
- data/spec/argument_spec.rb +104 -105
- data/spec/cli_spec.rb +27 -28
- data/spec/conflict_reporting_spec.rb +16 -17
- data/spec/option_spec.rb +60 -61
- data/spec/separator_spec.rb +19 -20
- data/spec/stdin_spec.rb +13 -14
- data/spec/switch_spec.rb +15 -16
- data/spec/usage_spec.rb +80 -81
- metadata +91 -139
- data/.document +0 -5
- data/.rspec +0 -1
- data/VERSION +0 -1
- data/features/cli.feature +0 -9
- data/features/step_definitions/cli_steps.rb +0 -0
- data/features/support/env.rb +0 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7cf21e138ef28582b6180c808de4905f792b2205a2bae357dee8c2070c1068b9
|
4
|
+
data.tar.gz: 447ee769df7594df66b621edcec8a741e22400831560973cb4db0c898fef01f0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f7d41024d20971baf9fb26fd53b4f7ff0a71d74d74ab66f3aa5392a4544116191a26fb9d88a762fa2e6147d17c2095d4a19a721a3c6a04fc78cf5aaf605a1456
|
7
|
+
data.tar.gz: 8556eb061844dc0696ebca9a56db5bc38b12dc8d0f6c00961359693e2744f5c60733247866a53660e6e581600e8fad4d6d9efd10dab479d9cde601df0f09c714
|
data/Gemfile
CHANGED
@@ -3,11 +3,9 @@ source "http://rubygems.org"
|
|
3
3
|
# Add dependencies to develop your gem here.
|
4
4
|
# Include everything needed to run rake, tests, features, etc.
|
5
5
|
group :development do
|
6
|
-
gem "
|
7
|
-
gem "
|
8
|
-
gem "bundler", "~>
|
9
|
-
gem "
|
10
|
-
gem "
|
11
|
-
gem "rdoc", "~> 3.9"
|
12
|
-
gem "ruby-ip", "~> 0.9"
|
6
|
+
gem "rake", "~> 13.0"
|
7
|
+
gem "rspec", "~> 3.11"
|
8
|
+
gem "bundler", "~> 2.2"
|
9
|
+
gem "rdoc", "~> 6.4"
|
10
|
+
gem "ruby-ip", "~> 0.9.3"
|
13
11
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,45 +1,37 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
rspec-core (~> 2.11.0)
|
26
|
-
rspec-expectations (~> 2.11.0)
|
27
|
-
rspec-mocks (~> 2.11.0)
|
28
|
-
rspec-core (2.11.1)
|
29
|
-
rspec-expectations (2.11.3)
|
30
|
-
diff-lcs (~> 1.1.3)
|
31
|
-
rspec-mocks (2.11.2)
|
32
|
-
ruby-ip (0.9.0)
|
33
|
-
term-ansicolor (1.0.7)
|
4
|
+
diff-lcs (1.5.0)
|
5
|
+
psych (4.0.3)
|
6
|
+
stringio
|
7
|
+
rake (13.0.6)
|
8
|
+
rdoc (6.4.0)
|
9
|
+
psych (>= 4.0.0)
|
10
|
+
rspec (3.11.0)
|
11
|
+
rspec-core (~> 3.11.0)
|
12
|
+
rspec-expectations (~> 3.11.0)
|
13
|
+
rspec-mocks (~> 3.11.0)
|
14
|
+
rspec-core (3.11.0)
|
15
|
+
rspec-support (~> 3.11.0)
|
16
|
+
rspec-expectations (3.11.0)
|
17
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
18
|
+
rspec-support (~> 3.11.0)
|
19
|
+
rspec-mocks (3.11.0)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.11.0)
|
22
|
+
rspec-support (3.11.0)
|
23
|
+
ruby-ip (0.9.3)
|
24
|
+
stringio (3.0.1)
|
34
25
|
|
35
26
|
PLATFORMS
|
36
27
|
ruby
|
37
28
|
|
38
29
|
DEPENDENCIES
|
39
|
-
bundler (~>
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
30
|
+
bundler (~> 2.2)
|
31
|
+
rake (~> 13.0)
|
32
|
+
rdoc (~> 6.4)
|
33
|
+
rspec (~> 3.11)
|
34
|
+
ruby-ip (~> 0.9.3)
|
35
|
+
|
36
|
+
BUNDLED WITH
|
37
|
+
2.2.32
|
data/README.md
CHANGED
@@ -35,9 +35,9 @@ begin
|
|
35
35
|
puts c.get_async("http://#{settings.server}:#{settings.port}#{settings.url}").pop.content.read
|
36
36
|
else
|
37
37
|
puts c.post_async("http://#{settings.server}:#{settings.port}#{settings.url}", settings.post_arguments.join("\n")).pop.content.read
|
38
|
-
end
|
38
|
+
end
|
39
39
|
rescue SocketError, Errno::ECONNREFUSED => e
|
40
|
-
puts "
|
40
|
+
puts "Failed to connect: #{e}"
|
41
41
|
end
|
42
42
|
```
|
43
43
|
|
@@ -115,7 +115,7 @@ sinatra = Sinatra.new
|
|
115
115
|
sinatra.set :environment, 'production'
|
116
116
|
sinatra.set :server, settings.server
|
117
117
|
sinatra.set :lock, true
|
118
|
-
sinatra.set :boundary, "
|
118
|
+
sinatra.set :boundary, "thumbnail image data"
|
119
119
|
sinatra.set :logging, (not settings.no_logging)
|
120
120
|
sinatra.set :debug, settings.debug
|
121
121
|
sinatra.set :optimization, (not settings.no_optimization)
|
@@ -170,8 +170,8 @@ require 'yaml'
|
|
170
170
|
settings = CLI.new do
|
171
171
|
description 'Generate blog posts in given Jekyll directory from input statistics'
|
172
172
|
stdin :log_data, :cast => YAML, :description => 'statistic data in YAML format'
|
173
|
-
option :location, :short => :l, :description => 'location name (ex. Dublin, Singapore,
|
174
|
-
option :csv_dir, :short => :c, :cast => Pathname, :default => 'csv', :description => 'directory name where CSV file will be
|
173
|
+
option :location, :short => :l, :description => 'location name (ex. Dublin, Singapore, California)'
|
174
|
+
option :csv_dir, :short => :c, :cast => Pathname, :default => 'csv', :description => 'directory name where CSV file will be stored (relative to jekyll-dir)'
|
175
175
|
argument :jekyll_dir, :cast => Pathname, :default => '/var/lib/vhs/jekyll', :description => 'directory where site source is located'
|
176
176
|
end.parse! do |settings|
|
177
177
|
fail 'jekyll-dir is not a directory' unless settings.jekyll_dir.directory?
|
@@ -192,15 +192,15 @@ Example help message:
|
|
192
192
|
Switches:
|
193
193
|
--help (-h) - display this help message
|
194
194
|
Options:
|
195
|
-
--location (-l) - location name (ex. Dublin, Singapore,
|
196
|
-
--csv-dir (-c) [csv] - directory name where CSV file will be
|
195
|
+
--location (-l) - location name (ex. Dublin, Singapore, California)
|
196
|
+
--csv-dir (-c) [csv] - directory name where CSV file will be stored (relative to jekyll-dir)
|
197
197
|
Arguments:
|
198
198
|
jekyll-dir [/var/lib/vhs/jekyll] - directory where site source is located
|
199
199
|
|
200
200
|
With this example usage (assuming /var/lib/vhs/jekyll/csv dir exist):
|
201
201
|
|
202
202
|
examples/processor --location Singapore <<EOF
|
203
|
-
:parser:
|
203
|
+
:parser:
|
204
204
|
:successes: 41
|
205
205
|
:failures: 0
|
206
206
|
EOF
|
@@ -303,7 +303,7 @@ Prints:
|
|
303
303
|
...
|
304
304
|
|
305
305
|
With directory list:
|
306
|
-
|
306
|
+
|
307
307
|
examples/ls *
|
308
308
|
|
309
309
|
Prints:
|
@@ -320,7 +320,7 @@ Prints:
|
|
320
320
|
pkg/cli-0.0.1.gem
|
321
321
|
pkg/cli-0.0.2.gem
|
322
322
|
...
|
323
|
-
|
323
|
+
|
324
324
|
Long printout:
|
325
325
|
|
326
326
|
examples/ls -l *
|
@@ -339,7 +339,7 @@ Prints:
|
|
339
339
|
501:20 pkg/cli-0.0.1.gem
|
340
340
|
501:20 pkg/cli-0.0.2.gem
|
341
341
|
...
|
342
|
-
|
342
|
+
|
343
343
|
## Usage
|
344
344
|
|
345
345
|
`CLI.new` takes a block where you specify parser behavior. The returned object is a parser that has `#parse` and `#parse!` methods.
|
@@ -350,7 +350,7 @@ It will take argument array (defaults to ARGV), standard input IO (defaults to S
|
|
350
350
|
|
351
351
|
The method will parse argument array and cast standard input IO according to parser specification and return OpenStruct kind of object with resulting values.
|
352
352
|
|
353
|
-
The returned object will have `help` attribute set if `--help` or `-h` switch was found in argument array or `version` attribute if `--version` argument was found.
|
353
|
+
The returned object will have `help` attribute set if `--help` or `-h` switch was found in argument array or `version` attribute if `--version` argument was found.
|
354
354
|
In other case all the attributes will be set to appropriate values depending on argument array and parser specification.
|
355
355
|
In case of parsing error `CLI::ParsingError` kind of exception will be raised.
|
356
356
|
|
@@ -389,8 +389,8 @@ The value after casting (if used) will be available from the `#parse` or `#parse
|
|
389
389
|
In addition to *switch*, option hash can have following pairs:
|
390
390
|
|
391
391
|
* **:default => value** - use default value of *value* if the option was not specified on the command argument list. The *value* will firstly be casted to string (with `#to_s`) and then it will be casted if casting is specified.
|
392
|
-
* **:default_label => label** - display *label* in usage rather than default value - useful to
|
393
|
-
* **:cast => cast specifier** - cast the provided value (or default) with given *cast specifier*.
|
392
|
+
* **:default_label => label** - display *label* in usage rather than default value - useful to describe default value if default value is generated if no value is provided
|
393
|
+
* **:cast => cast specifier** - cast the provided value (or default) with given *cast specifier*.
|
394
394
|
The specifier can be a class constant - the value will be provided to `#new` method of the class and resulting object used as option value. When provided constant does not respond to `#new` (i.e. it is a module) the `#load` method will be tried instead. If provided specifier is a Proc (or `lambda {}`) the Proc will be called with the value and resulting value will be used. Otherwise `CLI::ParsingError::CastError` will be raised. Special cast specified `Integer` or `Float` can also be used - the value will be strictly casted to integer or float type.
|
395
395
|
* **:required => true** - if used and no *default* value is specified the `#parse` method will fail with `CLI::ParsingError::MissingOptionValueError` if the option was not specified in the command argument list. If `#parse!` method was used the program will exit with appropriate message.
|
396
396
|
|
@@ -406,7 +406,7 @@ After the parser encounters command line argument that is not a *switch* or *opt
|
|
406
406
|
|
407
407
|
Each argument will be matched to argument specifications in order and their value after optional casting will be available as `#parse` or `#parse!` returned object argument with the same name.
|
408
408
|
|
409
|
-
Options hash can contain the same pairs as *option* expect of **:short => :symbol**.
|
409
|
+
Options hash can contain the same pairs as *option* expect of **:short => :symbol**.
|
410
410
|
|
411
411
|
If defaults are used the parser will keep using default values until it has enough command line arguments available to fill all mandatory arguments.
|
412
412
|
Arguments are required by default, use **:required => false** option pair to use `nil` value if argument is not specified on the command line argument list.
|
@@ -427,7 +427,7 @@ As with *switch* specifier the **:description => 'string'** can be used.
|
|
427
427
|
Also **:cast => cast specifier** option pair can be used but the value will be an IO object and not string.
|
428
428
|
|
429
429
|
## Contributing to CLI
|
430
|
-
|
430
|
+
|
431
431
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
432
432
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
433
433
|
* Fork the project
|
@@ -438,6 +438,5 @@ Also **:cast => cast specifier** option pair can be used but the value will be a
|
|
438
438
|
|
439
439
|
## Copyright
|
440
440
|
|
441
|
-
Copyright (c) 2011 Jakub Pastuszek. See LICENSE.txt for
|
441
|
+
Copyright (c) 2011-2022 Jakub Pastuszek. See LICENSE.txt for
|
442
442
|
further details.
|
443
|
-
|
data/Rakefile
CHANGED
@@ -9,36 +9,9 @@ rescue Bundler::BundlerError => e
|
|
9
9
|
$stderr.puts "Run `bundle install` to install missing gems"
|
10
10
|
exit e.status_code
|
11
11
|
end
|
12
|
-
require 'rake'
|
13
12
|
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "cli"
|
18
|
-
gem.homepage = "http://github.com/jpastuszek/cli"
|
19
|
-
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{Command line argument parser with stdin handling and usage generator}
|
21
|
-
gem.description = %Q{Command Line Interface gem allows you to quickly specify command argument parser that will automatically generate usage, handle stdin, switches, options and arguments with default values and value casting}
|
22
|
-
gem.email = "jpastuszek@gmail.com"
|
23
|
-
gem.authors = ["Jakub Pastuszek"]
|
24
|
-
# dependencies defined in Gemfile
|
25
|
-
end
|
26
|
-
Jeweler::RubygemsDotOrgTasks.new
|
27
|
-
|
28
|
-
require 'rspec/core'
|
29
13
|
require 'rspec/core/rake_task'
|
30
|
-
RSpec::Core::RakeTask.new(:spec)
|
31
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
-
end
|
33
|
-
|
34
|
-
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
-
spec.rcov = true
|
37
|
-
end
|
38
|
-
|
39
|
-
require 'cucumber/rake/task'
|
40
|
-
Cucumber::Rake::Task.new(:features)
|
41
|
-
|
14
|
+
RSpec::Core::RakeTask.new(:spec)
|
42
15
|
task :default => :spec
|
43
16
|
|
44
17
|
require 'rdoc/task'
|
data/cli.gemspec
CHANGED
@@ -1,87 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
require 'bundler'
|
3
|
+
# spec is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
4
|
+
spec.name = "cli"
|
5
|
+
spec.version = "1.4.0"
|
6
|
+
spec.homepage = "http://github.com/jpastuszek/cli"
|
7
|
+
spec.license = "MIT"
|
8
|
+
spec.summary = %Q{Command line argument parser with stdin handling and usage generator}
|
9
|
+
spec.description = %Q{Command Line Interface gem allows you to quickly specify command argument parser that will automatically generate usage, handle stdin, switches, options and arguments with default values and value casting}
|
10
|
+
spec.email = "jpastuszek@protonmail.com"
|
11
|
+
spec.authors = ["Jakub Pastuszek"]
|
5
12
|
|
6
|
-
|
7
|
-
|
8
|
-
s.version = "1.3.1"
|
13
|
+
spec.files = Dir['**/**'].grep_v(/.gem$/)
|
14
|
+
spec.require_paths = ["lib"]
|
9
15
|
|
10
|
-
|
11
|
-
s.authors = ["Jakub Pastuszek"]
|
12
|
-
s.date = "2012-11-16"
|
13
|
-
s.description = "Command Line Interface gem allows you to quickly specify command argument parser that will automatically generate usage, handle stdin, switches, options and arguments with default values and value casting"
|
14
|
-
s.email = "jpastuszek@gmail.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.md"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rspec",
|
22
|
-
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
|
-
"LICENSE.txt",
|
25
|
-
"README.md",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"cli.gemspec",
|
29
|
-
"examples/httpclient",
|
30
|
-
"examples/ls",
|
31
|
-
"examples/processor",
|
32
|
-
"examples/sinatra",
|
33
|
-
"features/cli.feature",
|
34
|
-
"features/step_definitions/cli_steps.rb",
|
35
|
-
"features/support/env.rb",
|
36
|
-
"lib/cli.rb",
|
37
|
-
"lib/cli/arguments.rb",
|
38
|
-
"lib/cli/dsl.rb",
|
39
|
-
"lib/cli/options.rb",
|
40
|
-
"lib/cli/switches.rb",
|
41
|
-
"spec/argument_spec.rb",
|
42
|
-
"spec/cli_spec.rb",
|
43
|
-
"spec/conflict_reporting_spec.rb",
|
44
|
-
"spec/option_spec.rb",
|
45
|
-
"spec/separator_spec.rb",
|
46
|
-
"spec/spec_helper.rb",
|
47
|
-
"spec/stdin_spec.rb",
|
48
|
-
"spec/switch_spec.rb",
|
49
|
-
"spec/usage_spec.rb"
|
50
|
-
]
|
51
|
-
s.homepage = "http://github.com/jpastuszek/cli"
|
52
|
-
s.licenses = ["MIT"]
|
53
|
-
s.require_paths = ["lib"]
|
54
|
-
s.rubygems_version = "1.8.24"
|
55
|
-
s.summary = "Command line argument parser with stdin handling and usage generator"
|
56
|
-
|
57
|
-
if s.respond_to? :specification_version then
|
58
|
-
s.specification_version = 3
|
59
|
-
|
60
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.4"])
|
62
|
-
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
63
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.2"])
|
64
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
65
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
66
|
-
s.add_development_dependency(%q<rdoc>, ["~> 3.9"])
|
67
|
-
s.add_development_dependency(%q<ruby-ip>, ["~> 0.9"])
|
68
|
-
else
|
69
|
-
s.add_dependency(%q<rspec>, ["~> 2.4"])
|
70
|
-
s.add_dependency(%q<cucumber>, [">= 0"])
|
71
|
-
s.add_dependency(%q<bundler>, ["~> 1.2"])
|
72
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
73
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
74
|
-
s.add_dependency(%q<rdoc>, ["~> 3.9"])
|
75
|
-
s.add_dependency(%q<ruby-ip>, ["~> 0.9"])
|
76
|
-
end
|
77
|
-
else
|
78
|
-
s.add_dependency(%q<rspec>, ["~> 2.4"])
|
79
|
-
s.add_dependency(%q<cucumber>, [">= 0"])
|
80
|
-
s.add_dependency(%q<bundler>, ["~> 1.2"])
|
81
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
82
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
83
|
-
s.add_dependency(%q<rdoc>, ["~> 3.9"])
|
84
|
-
s.add_dependency(%q<ruby-ip>, ["~> 0.9"])
|
85
|
-
end
|
16
|
+
Bundler.require(:default, :development)
|
86
17
|
end
|
87
|
-
|
@@ -0,0 +1,178 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class CLI::Arguments - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">Array
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-i-has-3F">#has?</a>
|
76
|
+
<li ><a href="#method-i-mandatory">#mandatory</a>
|
77
|
+
<li ><a href="#method-i-multiary">#multiary</a>
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
<main role="main" aria-labelledby="class-CLI::Arguments">
|
85
|
+
<h1 id="class-CLI::Arguments" class="class">
|
86
|
+
class CLI::Arguments
|
87
|
+
</h1>
|
88
|
+
|
89
|
+
<section class="description">
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
100
|
+
<header>
|
101
|
+
<h3>Public Instance Methods</h3>
|
102
|
+
</header>
|
103
|
+
|
104
|
+
<div id="method-i-has-3F" class="method-detail ">
|
105
|
+
<div class="method-heading">
|
106
|
+
<span class="method-name">has?</span><span
|
107
|
+
class="method-args">(argument_dsl)</span>
|
108
|
+
<span class="method-click-advice">click to toggle source</span>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div class="method-description">
|
112
|
+
|
113
|
+
|
114
|
+
<div class="method-source-code" id="has-3F-source">
|
115
|
+
<pre><span class="ruby-comment"># File lib/cli/arguments.rb, line 2</span>
|
116
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has?</span>(<span class="ruby-identifier">argument_dsl</span>)
|
117
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">argument_dsl</span>.<span class="ruby-identifier">name</span>}
|
118
|
+
<span class="ruby-keyword">end</span></pre>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div id="method-i-mandatory" class="method-detail ">
|
126
|
+
<div class="method-heading">
|
127
|
+
<span class="method-name">mandatory</span><span
|
128
|
+
class="method-args">()</span>
|
129
|
+
<span class="method-click-advice">click to toggle source</span>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
<div class="method-description">
|
133
|
+
|
134
|
+
|
135
|
+
<div class="method-source-code" id="mandatory-source">
|
136
|
+
<pre><span class="ruby-comment"># File lib/cli/arguments.rb, line 6</span>
|
137
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mandatory</span>
|
138
|
+
<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">mandatory?</span>}
|
139
|
+
<span class="ruby-keyword">end</span></pre>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div id="method-i-multiary" class="method-detail ">
|
147
|
+
<div class="method-heading">
|
148
|
+
<span class="method-name">multiary</span><span
|
149
|
+
class="method-args">()</span>
|
150
|
+
<span class="method-click-advice">click to toggle source</span>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div class="method-description">
|
154
|
+
|
155
|
+
|
156
|
+
<div class="method-source-code" id="multiary-source">
|
157
|
+
<pre><span class="ruby-comment"># File lib/cli/arguments.rb, line 10</span>
|
158
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multiary</span>
|
159
|
+
<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">multiary?</span>}
|
160
|
+
<span class="ruby-keyword">end</span></pre>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
</div>
|
166
|
+
|
167
|
+
</section>
|
168
|
+
|
169
|
+
</section>
|
170
|
+
</main>
|
171
|
+
|
172
|
+
|
173
|
+
<footer id="validator-badges" role="contentinfo">
|
174
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
175
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
176
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
177
|
+
</footer>
|
178
|
+
|