quickl 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +82 -0
- data/Gemfile.lock +14 -14
- data/bin/quickl +2 -2
- data/lib/quickl.rb +162 -2
- data/lib/quickl/command.rb +22 -32
- data/lib/quickl/command/builder.rb +3 -3
- data/lib/quickl/command/delegator.rb +22 -12
- data/lib/quickl/command/options.rb +29 -4
- data/lib/quickl/command/robustness.rb +5 -12
- data/lib/quickl/command/single.rb +4 -6
- data/lib/quickl/errors.rb +2 -2
- data/lib/quickl/version.rb +2 -2
- data/quickl.gemspec +4 -4
- data/quickl.noespec +13 -37
- data/spec/command/delegator/test_split_argv.rb +41 -0
- data/spec/command/{command_building_spec.rb → test_command_building.rb} +4 -4
- data/spec/command/{command_name_spec.rb → test_command_name.rb} +1 -6
- data/spec/command/{documentation_spec.rb → test_documentation.rb} +1 -1
- data/spec/command/{overview_spec.rb → test_overview.rb} +1 -5
- data/spec/command/test_parse_options.rb +112 -0
- data/spec/command/{requester_spec.rb → test_requester.rb} +1 -1
- data/spec/command/test_run.rb +40 -0
- data/spec/command/{subcommand_by_name_spec.rb → test_subcommand_by_name.rb} +3 -3
- data/spec/command/{subcommands_spec.rb → test_subcommands.rb} +8 -7
- data/spec/command/test_usage.rb +11 -0
- data/spec/mini_client.rb +36 -6
- data/spec/naming/test_command2module.rb +17 -0
- data/spec/naming/test_module2command.rb +21 -0
- data/spec/quickl/test_command_name.rb +16 -0
- data/spec/quickl/test_documentation.rb +32 -0
- data/spec/quickl/test_overview.rb +16 -0
- data/spec/quickl/test_parse_commandline_args.rb +52 -0
- data/spec/quickl/test_split_commandline_args.rb +39 -0
- data/spec/quickl/test_sub_command.rb +48 -0
- data/spec/quickl/test_super_command.rb +21 -0
- data/spec/quickl/test_usage.rb +16 -0
- data/spec/{command/robustness/valid_read_file_spec.rb → quickl/test_valid_read_file.rb} +4 -4
- data/spec/ruby_tools/fixtures.rb +1 -1
- data/spec/ruby_tools/{class_unqualified_name_spec.rb → test_class_unqualified_name.rb} +0 -0
- data/spec/ruby_tools/{extract_file_rdoc_spec.rb → test_extract_file_rdoc.rb} +0 -0
- data/spec/ruby_tools/{optional_args_block_call_spec.rb → test_optional_args_block.rb} +0 -0
- data/spec/ruby_tools/{parent_module_spec.rb → test_parent_module.rb} +0 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/{quickl_spec.rb → test_quickl.rb} +1 -1
- data/tasks/debug_mail.rake +1 -1
- data/tasks/spec_test.rake +2 -2
- data/tasks/unit_test.rake +2 -2
- data/templates/single.erb +1 -1
- metadata +96 -76
- data/spec/command/run_spec.rb +0 -22
- data/spec/command/usage_spec.rb +0 -16
- data/spec/naming/command2module_spec.rb +0 -17
- data/spec/naming/module2command_spec.rb +0 -21
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
module Quickl
|
3
|
-
describe "
|
3
|
+
describe "Quickl.valid_read_file!" do
|
4
4
|
|
5
|
-
let(:r){
|
5
|
+
let(:r){ Quickl }
|
6
6
|
|
7
7
|
describe "with default options" do
|
8
8
|
|
@@ -59,4 +59,4 @@ module Quickl
|
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
62
|
-
end # module Quickl
|
62
|
+
end # module Quickl
|
data/spec/ruby_tools/fixtures.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
data/tasks/debug_mail.rake
CHANGED
data/tasks/spec_test.rake
CHANGED
@@ -30,7 +30,7 @@ begin
|
|
30
30
|
desc "Run RSpec code examples"
|
31
31
|
RSpec::Core::RakeTask.new(:spec_test) do |t|
|
32
32
|
# Glob pattern to match files.
|
33
|
-
t.pattern = "spec
|
33
|
+
t.pattern = "spec/**/test_*.rb"
|
34
34
|
|
35
35
|
# By default, if there is a Gemfile, the generated command will include
|
36
36
|
# 'bundle exec'. Set this to true to ignore the presence of a Gemfile,
|
@@ -61,7 +61,7 @@ begin
|
|
61
61
|
t.rcov_opts = []
|
62
62
|
|
63
63
|
# Command line options to pass to ruby. See 'ruby --help' about this
|
64
|
-
t.ruby_opts = []
|
64
|
+
t.ruby_opts = ["-w"]
|
65
65
|
|
66
66
|
# Path to rspec
|
67
67
|
t.rspec_path = "rspec"
|
data/tasks/unit_test.rake
CHANGED
@@ -45,7 +45,7 @@ begin
|
|
45
45
|
t.warning = false
|
46
46
|
|
47
47
|
# Glob pattern to match test files. (default is 'test/test*.rb')
|
48
|
-
t.pattern = "examples
|
48
|
+
t.pattern = "examples/**/test_*.rb"
|
49
49
|
|
50
50
|
# Style of test loader to use. Options are:
|
51
51
|
#
|
@@ -57,7 +57,7 @@ begin
|
|
57
57
|
|
58
58
|
# Array of commandline options to pass to ruby when running test
|
59
59
|
# loader.
|
60
|
-
t.ruby_opts = []
|
60
|
+
t.ruby_opts = ["-w"]
|
61
61
|
|
62
62
|
# Explicitly define the list of test files to be included in a
|
63
63
|
# test. +list+ is expected to be an array of file names (a
|
data/templates/single.erb
CHANGED
@@ -31,7 +31,7 @@ class <%= cmd_class_name %> < Quickl::Command(__FILE__, __LINE__)
|
|
31
31
|
# Run the command
|
32
32
|
def execute(args)
|
33
33
|
# FIX: do something here
|
34
|
-
puts "Hello #{args.join(' and ')} from #{program_name}"
|
34
|
+
puts "Hello #{args.join(' and ')} from #{Quickl.program_name}"
|
35
35
|
end
|
36
36
|
|
37
37
|
end # class <%= cmd_class_name %>
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bernard Lambeau
|
@@ -15,10 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-29 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
21
|
+
type: :development
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
22
23
|
none: false
|
23
24
|
requirements:
|
24
25
|
- - ~>
|
@@ -29,12 +30,12 @@ dependencies:
|
|
29
30
|
- 9
|
30
31
|
- 2
|
31
32
|
version: 0.9.2
|
32
|
-
|
33
|
-
requirement: *id001
|
34
|
-
prerelease: false
|
33
|
+
version_requirements: *id001
|
35
34
|
name: rake
|
35
|
+
prerelease: false
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
37
|
+
type: :development
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
39
|
none: false
|
39
40
|
requirements:
|
40
41
|
- - ~>
|
@@ -44,74 +45,73 @@ dependencies:
|
|
44
45
|
- 1
|
45
46
|
- 0
|
46
47
|
version: "1.0"
|
47
|
-
|
48
|
-
requirement: *id002
|
49
|
-
prerelease: false
|
48
|
+
version_requirements: *id002
|
50
49
|
name: bundler
|
50
|
+
prerelease: false
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
|
-
|
52
|
+
type: :development
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
54
|
none: false
|
54
55
|
requirements:
|
55
56
|
- - ~>
|
56
57
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
58
|
+
hash: 23
|
58
59
|
segments:
|
59
60
|
- 2
|
60
|
-
-
|
61
|
+
- 6
|
61
62
|
- 0
|
62
|
-
version: 2.
|
63
|
-
|
64
|
-
requirement: *id003
|
65
|
-
prerelease: false
|
63
|
+
version: 2.6.0
|
64
|
+
version_requirements: *id003
|
66
65
|
name: rspec
|
66
|
+
prerelease: false
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
|
-
|
68
|
+
type: :development
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
70
|
none: false
|
70
71
|
requirements:
|
71
72
|
- - ~>
|
72
73
|
- !ruby/object:Gem::Version
|
73
|
-
hash:
|
74
|
+
hash: 7
|
74
75
|
segments:
|
75
76
|
- 0
|
76
|
-
-
|
77
|
-
-
|
78
|
-
version: 0.
|
79
|
-
|
80
|
-
requirement: *id004
|
81
|
-
prerelease: false
|
77
|
+
- 7
|
78
|
+
- 2
|
79
|
+
version: 0.7.2
|
80
|
+
version_requirements: *id004
|
82
81
|
name: yard
|
82
|
+
prerelease: false
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
|
84
|
+
type: :development
|
85
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
85
86
|
none: false
|
86
87
|
requirements:
|
87
88
|
- - ~>
|
88
89
|
- !ruby/object:Gem::Version
|
89
|
-
hash:
|
90
|
+
hash: 11
|
90
91
|
segments:
|
91
92
|
- 2
|
93
|
+
- 1
|
92
94
|
- 0
|
93
|
-
|
94
|
-
|
95
|
-
type: :development
|
96
|
-
requirement: *id005
|
97
|
-
prerelease: false
|
95
|
+
version: 2.1.0
|
96
|
+
version_requirements: *id005
|
98
97
|
name: bluecloth
|
98
|
+
prerelease: false
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
-
|
100
|
+
type: :development
|
101
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
101
102
|
none: false
|
102
103
|
requirements:
|
103
104
|
- - ~>
|
104
105
|
- !ruby/object:Gem::Version
|
105
|
-
hash:
|
106
|
+
hash: 51
|
106
107
|
segments:
|
107
108
|
- 0
|
108
109
|
- 10
|
109
|
-
-
|
110
|
-
version: 0.10.
|
111
|
-
|
112
|
-
requirement: *id006
|
113
|
-
prerelease: false
|
110
|
+
- 2
|
111
|
+
version: 0.10.2
|
112
|
+
version_requirements: *id006
|
114
113
|
name: wlang
|
114
|
+
prerelease: false
|
115
115
|
description: |-
|
116
116
|
Quickl helps you creating commandline ruby programs. From simple commands
|
117
117
|
with options to complex delegators with subcommands, global and local
|
@@ -152,27 +152,37 @@ files:
|
|
152
152
|
- Rakefile
|
153
153
|
- README.md
|
154
154
|
- spec/spec_helper.rb
|
155
|
-
- spec/command/
|
156
|
-
- spec/command/
|
157
|
-
- spec/command/
|
158
|
-
- spec/command/
|
159
|
-
- spec/command/
|
160
|
-
- spec/command/
|
161
|
-
- spec/command/
|
162
|
-
- spec/command/
|
163
|
-
- spec/command/
|
164
|
-
- spec/command/
|
155
|
+
- spec/command/test_command_name.rb
|
156
|
+
- spec/command/test_subcommands.rb
|
157
|
+
- spec/command/test_subcommand_by_name.rb
|
158
|
+
- spec/command/test_overview.rb
|
159
|
+
- spec/command/test_command_building.rb
|
160
|
+
- spec/command/test_run.rb
|
161
|
+
- spec/command/test_usage.rb
|
162
|
+
- spec/command/delegator/test_split_argv.rb
|
163
|
+
- spec/command/test_parse_options.rb
|
164
|
+
- spec/command/test_documentation.rb
|
165
|
+
- spec/command/test_requester.rb
|
166
|
+
- spec/test_quickl.rb
|
165
167
|
- spec/mini_client.rb
|
166
168
|
- spec/ruby_tools/fixtures.rb
|
167
|
-
- spec/ruby_tools/
|
168
|
-
- spec/ruby_tools/
|
169
|
-
- spec/ruby_tools/
|
170
|
-
- spec/ruby_tools/
|
169
|
+
- spec/ruby_tools/test_extract_file_rdoc.rb
|
170
|
+
- spec/ruby_tools/test_class_unqualified_name.rb
|
171
|
+
- spec/ruby_tools/test_optional_args_block.rb
|
172
|
+
- spec/ruby_tools/test_parent_module.rb
|
171
173
|
- spec/ruby_tools/fixtures/RubyTools.rdoc
|
172
174
|
- spec/ruby_tools/fixtures/Utils.rdoc
|
173
|
-
- spec/
|
174
|
-
- spec/naming/
|
175
|
-
- spec/
|
175
|
+
- spec/naming/test_command2module.rb
|
176
|
+
- spec/naming/test_module2command.rb
|
177
|
+
- spec/quickl/test_command_name.rb
|
178
|
+
- spec/quickl/test_parse_commandline_args.rb
|
179
|
+
- spec/quickl/test_split_commandline_args.rb
|
180
|
+
- spec/quickl/test_super_command.rb
|
181
|
+
- spec/quickl/test_sub_command.rb
|
182
|
+
- spec/quickl/test_overview.rb
|
183
|
+
- spec/quickl/test_usage.rb
|
184
|
+
- spec/quickl/test_documentation.rb
|
185
|
+
- spec/quickl/test_valid_read_file.rb
|
176
186
|
- tasks/debug_mail.rake
|
177
187
|
- tasks/yard.rake
|
178
188
|
- tasks/clean.rake
|
@@ -209,30 +219,40 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
219
|
requirements: []
|
210
220
|
|
211
221
|
rubyforge_project:
|
212
|
-
rubygems_version: 1.8.
|
222
|
+
rubygems_version: 1.8.6
|
213
223
|
signing_key:
|
214
224
|
specification_version: 3
|
215
225
|
summary: Helper to create commandline ruby programs
|
216
226
|
test_files:
|
217
227
|
- spec/spec_helper.rb
|
218
|
-
- spec/command/
|
219
|
-
- spec/command/
|
220
|
-
- spec/command/
|
221
|
-
- spec/command/
|
222
|
-
- spec/command/
|
223
|
-
- spec/command/
|
224
|
-
- spec/command/
|
225
|
-
- spec/command/
|
226
|
-
- spec/command/
|
227
|
-
- spec/command/
|
228
|
+
- spec/command/test_command_name.rb
|
229
|
+
- spec/command/test_subcommands.rb
|
230
|
+
- spec/command/test_subcommand_by_name.rb
|
231
|
+
- spec/command/test_overview.rb
|
232
|
+
- spec/command/test_command_building.rb
|
233
|
+
- spec/command/test_run.rb
|
234
|
+
- spec/command/test_usage.rb
|
235
|
+
- spec/command/delegator/test_split_argv.rb
|
236
|
+
- spec/command/test_parse_options.rb
|
237
|
+
- spec/command/test_documentation.rb
|
238
|
+
- spec/command/test_requester.rb
|
239
|
+
- spec/test_quickl.rb
|
228
240
|
- spec/mini_client.rb
|
229
241
|
- spec/ruby_tools/fixtures.rb
|
230
|
-
- spec/ruby_tools/
|
231
|
-
- spec/ruby_tools/
|
232
|
-
- spec/ruby_tools/
|
233
|
-
- spec/ruby_tools/
|
242
|
+
- spec/ruby_tools/test_extract_file_rdoc.rb
|
243
|
+
- spec/ruby_tools/test_class_unqualified_name.rb
|
244
|
+
- spec/ruby_tools/test_optional_args_block.rb
|
245
|
+
- spec/ruby_tools/test_parent_module.rb
|
234
246
|
- spec/ruby_tools/fixtures/RubyTools.rdoc
|
235
247
|
- spec/ruby_tools/fixtures/Utils.rdoc
|
236
|
-
- spec/
|
237
|
-
- spec/naming/
|
238
|
-
- spec/
|
248
|
+
- spec/naming/test_command2module.rb
|
249
|
+
- spec/naming/test_module2command.rb
|
250
|
+
- spec/quickl/test_command_name.rb
|
251
|
+
- spec/quickl/test_parse_commandline_args.rb
|
252
|
+
- spec/quickl/test_split_commandline_args.rb
|
253
|
+
- spec/quickl/test_super_command.rb
|
254
|
+
- spec/quickl/test_sub_command.rb
|
255
|
+
- spec/quickl/test_overview.rb
|
256
|
+
- spec/quickl/test_usage.rb
|
257
|
+
- spec/quickl/test_documentation.rb
|
258
|
+
- spec/quickl/test_valid_read_file.rb
|
data/spec/command/run_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
-
module Quickl
|
3
|
-
describe "Command::run /" do
|
4
|
-
|
5
|
-
it "when invoked on a terminal command" do
|
6
|
-
MiniClient::Say::Hello.run.should == :hello
|
7
|
-
MiniClient::Say::Goodbye.run.should == :goodbye
|
8
|
-
end
|
9
|
-
|
10
|
-
it "when invoked on a delegator command" do
|
11
|
-
MiniClient.run(["help"]).should == :help
|
12
|
-
MiniClient::Say.run(["hello"]).should == :hello
|
13
|
-
MiniClient::Say.run(["goodbye"]).should == :goodbye
|
14
|
-
end
|
15
|
-
|
16
|
-
it "when invoked on qualified command names" do
|
17
|
-
MiniClient.run(["say:hello"]).should == :hello
|
18
|
-
MiniClient.run(["say:goodbye"]).should == :goodbye
|
19
|
-
end
|
20
|
-
|
21
|
-
end # Command::command
|
22
|
-
end # module Quickl
|
data/spec/command/usage_spec.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
-
module Quickl
|
3
|
-
describe "Command::usage /" do
|
4
|
-
|
5
|
-
it "should be installed from inline rdoc" do
|
6
|
-
MiniClient::Say::Hello.usage.should == "mini-client say:hello"
|
7
|
-
MiniClient::Say::Goodbye.usage.should == "mini-client say:goodbye"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should be accessible on instance" do
|
11
|
-
MiniClient::Say::Hello.new.usage.should == "mini-client say:hello"
|
12
|
-
MiniClient::Say::Goodbye.new.usage.should == "mini-client say:goodbye"
|
13
|
-
end
|
14
|
-
|
15
|
-
end # Command::usage
|
16
|
-
end # module Quickl
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
-
module Quickl
|
3
|
-
describe "Naming::command2module /" do
|
4
|
-
include Naming
|
5
|
-
|
6
|
-
it "should capitalize first char" do
|
7
|
-
command2module("say").should == "Say"
|
8
|
-
command2module(:say).should == :Say
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should capitalize support dashes" do
|
12
|
-
command2module("say-hello").should == "SayHello"
|
13
|
-
command2module(:"say-hello").should == :SayHello
|
14
|
-
end
|
15
|
-
|
16
|
-
end # module Quickl
|
17
|
-
end # module Quickl
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
-
module Quickl
|
3
|
-
describe "Naming::module2command /" do
|
4
|
-
include Naming
|
5
|
-
|
6
|
-
it "should uncapitalize first char" do
|
7
|
-
module2command("Say").should == "say"
|
8
|
-
module2command(:Say).should == :say
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should uncapitalize and introduce dashes" do
|
12
|
-
module2command("SayHello").should == "say-hello"
|
13
|
-
module2command(:"SayHello").should == :"say-hello"
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should support taking modules as argument" do
|
17
|
-
module2command(Quickl::Command).should == "command"
|
18
|
-
end
|
19
|
-
|
20
|
-
end # module Quickl
|
21
|
-
end # module Quickl
|