methadone 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -1
- data/CHANGES.md +4 -0
- data/Gemfile +1 -1
- data/README.rdoc +6 -0
- data/bin/methadone +14 -1
- data/features/bootstrap.feature +2 -0
- data/features/rspec_support.feature +32 -0
- data/lib/methadone/cli.rb +1 -1
- data/lib/methadone/execution_strategy/rbx_open_4.rb +1 -1
- data/lib/methadone/sh.rb +1 -1
- data/lib/methadone/version.rb +1 -1
- data/templates/full/Rakefile.erb +14 -1
- data/templates/rspec/spec/tc_something_spec.rb.erb +5 -0
- data/templates/{full → test_unit}/test/tc_something.rb.erb +0 -0
- data/test/execution_strategy/test_rbx_open_4.rb +1 -1
- metadata +150 -95
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use 1.9.
|
1
|
+
rvm use 1.9.3@methadone-dev --create
|
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -16,6 +16,12 @@ Toward that end, this gem provides:
|
|
16
16
|
* Simplified zero-config logging that is a better-than-<tt>puts</tt> <tt>puts</tt>.
|
17
17
|
* Cucumber Steps, built on Aruba, to allow you to test-drive your command-line app development.
|
18
18
|
|
19
|
+
== Tutorial
|
20
|
+
|
21
|
+
http://a1.mzstatic.com/us/r30/Publication/v4/2c/f7/90/2cf7902f-f709-9125-c73d-87311216527d/MethadoneTutorial.225x225-75.jpg
|
22
|
+
|
23
|
+
{Tutorial for your iPad}[http://itunes.apple.com/us/book/kick-bash-habit-ruby-methadone/id515825242?ls=1] - This is a *free* iBooks interactive ebook that contains a step-by-step tutorial on making an awesome app with Methadone, including screencasts.
|
24
|
+
|
19
25
|
== Links
|
20
26
|
|
21
27
|
* {Source on Github}[http://github.com/davetron5000/methadone]
|
data/bin/methadone
CHANGED
@@ -28,10 +28,22 @@ main do |app_name|
|
|
28
28
|
|
29
29
|
template_dirs_in(:full).each { |dir| mkdir_p dir }
|
30
30
|
|
31
|
-
|
31
|
+
rspec = options[:rspec]
|
32
|
+
|
33
|
+
["Rakefile", ".gitignore", "features/support/env.rb"].each do |file|
|
32
34
|
copy_file file, :binding => binding
|
33
35
|
end
|
34
36
|
|
37
|
+
if rspec
|
38
|
+
template_dirs_in(:rspec).each { |dir| mkdir_p dir }
|
39
|
+
copy_file "spec/tc_something_spec.rb", :from => :rspec, :binding => binding
|
40
|
+
|
41
|
+
else
|
42
|
+
template_dirs_in(:test_unit).each { |dir| mkdir_p dir }
|
43
|
+
copy_file "test/tc_something.rb", :from => :test_unit, :binding => binding
|
44
|
+
end
|
45
|
+
|
46
|
+
|
35
47
|
license = options[:license]
|
36
48
|
warn "warning: your app has no license" unless license
|
37
49
|
license = nil if license == 'NONE'
|
@@ -58,6 +70,7 @@ description "Kick the bash habit by bootstrapping your Ruby command-line apps"
|
|
58
70
|
|
59
71
|
on("--force","Overwrite files if they exist")
|
60
72
|
on("--[no-]readme","[Do not ]produce a README file")
|
73
|
+
on("--rspec", "Generate RSpec unit tests instead of Test::Unit")
|
61
74
|
|
62
75
|
licenses = %w(mit apache custom NONE)
|
63
76
|
on("-l LICENSE","--license",licenses,"Specify the license for your project",'(' + licenses.join('|') + ')')
|
data/features/bootstrap.feature
CHANGED
@@ -17,6 +17,8 @@ Feature: Bootstrap a new command-line app
|
|
17
17
|
|tmp/newgem/features |
|
18
18
|
|tmp/newgem/features/support |
|
19
19
|
|tmp/newgem/features/step_definitions |
|
20
|
+
Then the following directories should not exist:
|
21
|
+
|tmp/newgem/spec |
|
20
22
|
And the following files should exist:
|
21
23
|
|tmp/newgem/newgem.gemspec |
|
22
24
|
|tmp/newgem/Rakefile |
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Feature: Bootstrap a new command-line app using RSpec instead of Test::Unit
|
2
|
+
As an awesome developer who wants to make a command-line app
|
3
|
+
I should be able to use methadone to bootstrap it
|
4
|
+
And get support for RSpec instead of Test::Unit
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given the directory "tmp/newgem" does not exist
|
8
|
+
|
9
|
+
Scenario: Bootstrap a new app from scratch
|
10
|
+
When I successfully run `methadone --rspec tmp/newgem`
|
11
|
+
Then the following directories should exist:
|
12
|
+
|tmp/newgem/spec |
|
13
|
+
And the following directories should not exist:
|
14
|
+
|tmp/newgem/test |
|
15
|
+
And the following files should exist:
|
16
|
+
|tmp/newgem/spec/tc_something_spec.rb |
|
17
|
+
Given I cd to "tmp/newgem"
|
18
|
+
When I successfully run `rake -T -I../../lib`
|
19
|
+
Then the output should contain:
|
20
|
+
"""
|
21
|
+
rake spec # Run RSpec code examples
|
22
|
+
"""
|
23
|
+
And the output should not contain:
|
24
|
+
"""
|
25
|
+
rake test # Run tests
|
26
|
+
"""
|
27
|
+
When I run `rake spec -I../../lib`
|
28
|
+
Then the exit status should be 0
|
29
|
+
And the output should contain:
|
30
|
+
"""
|
31
|
+
1 example, 0 failures
|
32
|
+
"""
|
data/lib/methadone/cli.rb
CHANGED
data/lib/methadone/sh.rb
CHANGED
data/lib/methadone/version.rb
CHANGED
data/templates/full/Rakefile.erb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
require 'rake/clean'
|
3
|
+
<% if rspec %>
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
<% else %>
|
3
6
|
require 'rake/testtask'
|
7
|
+
<% end %>
|
4
8
|
require 'cucumber'
|
5
9
|
require 'cucumber/rake/task'
|
6
10
|
gem 'rdoc' # we need the installed RDoc gem, not the system one
|
@@ -10,9 +14,15 @@ include Rake::DSL
|
|
10
14
|
|
11
15
|
Bundler::GemHelper.install_tasks
|
12
16
|
|
17
|
+
<% if rspec %>
|
18
|
+
RSpec::Core::RakeTask.new do |t|
|
19
|
+
# Put spec opts in a file named .rspec in root
|
20
|
+
end
|
21
|
+
<% else %>
|
13
22
|
Rake::TestTask.new do |t|
|
14
23
|
t.pattern = 'test/tc_*.rb'
|
15
24
|
end
|
25
|
+
<% end %>
|
16
26
|
|
17
27
|
CUKE_RESULTS = 'results.html'
|
18
28
|
CLEAN << CUKE_RESULTS
|
@@ -27,5 +37,8 @@ Rake::RDocTask.new do |rd|
|
|
27
37
|
<% end %>
|
28
38
|
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
29
39
|
end
|
30
|
-
|
40
|
+
<% if rspec %>
|
41
|
+
task :default => [:spec,:features]
|
42
|
+
<% else %>
|
31
43
|
task :default => [:test,:features]
|
44
|
+
<% end %>
|
File without changes
|
metadata
CHANGED
@@ -1,126 +1,165 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: methadone
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 1.1.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- davetron5000
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-04-21 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: bundler
|
16
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
25
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
22
33
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
26
36
|
name: rspec-expectations
|
27
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
|
-
requirements:
|
40
|
+
requirements:
|
30
41
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 15
|
44
|
+
segments:
|
45
|
+
- 2
|
46
|
+
- 6
|
47
|
+
version: "2.6"
|
33
48
|
type: :development
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
37
51
|
name: rake
|
38
|
-
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
54
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
44
62
|
type: :development
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
48
65
|
name: rdoc
|
49
|
-
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
68
|
none: false
|
51
|
-
requirements:
|
69
|
+
requirements:
|
52
70
|
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 21
|
73
|
+
segments:
|
74
|
+
- 3
|
75
|
+
- 9
|
76
|
+
version: "3.9"
|
55
77
|
type: :development
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
59
80
|
name: cucumber
|
60
|
-
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
83
|
none: false
|
62
|
-
requirements:
|
84
|
+
requirements:
|
63
85
|
- - ~>
|
64
|
-
- !ruby/object:Gem::Version
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 17
|
88
|
+
segments:
|
89
|
+
- 1
|
90
|
+
- 1
|
91
|
+
- 1
|
65
92
|
version: 1.1.1
|
66
93
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
94
|
+
version_requirements: *id005
|
95
|
+
- !ruby/object:Gem::Dependency
|
70
96
|
name: aruba
|
71
|
-
|
97
|
+
prerelease: false
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
99
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
version: "0"
|
77
107
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
108
|
+
version_requirements: *id006
|
109
|
+
- !ruby/object:Gem::Dependency
|
81
110
|
name: simplecov
|
82
|
-
|
111
|
+
prerelease: false
|
112
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
|
-
requirements:
|
114
|
+
requirements:
|
85
115
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 1
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
- 5
|
121
|
+
version: "0.5"
|
88
122
|
type: :development
|
89
|
-
|
90
|
-
|
91
|
-
- !ruby/object:Gem::Dependency
|
123
|
+
version_requirements: *id007
|
124
|
+
- !ruby/object:Gem::Dependency
|
92
125
|
name: clean_test
|
93
|
-
|
126
|
+
prerelease: false
|
127
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
94
128
|
none: false
|
95
|
-
requirements:
|
129
|
+
requirements:
|
96
130
|
- - ~>
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
hash: 31
|
133
|
+
segments:
|
134
|
+
- 0
|
135
|
+
- 10
|
136
|
+
version: "0.10"
|
99
137
|
type: :development
|
100
|
-
|
101
|
-
|
102
|
-
- !ruby/object:Gem::Dependency
|
138
|
+
version_requirements: *id008
|
139
|
+
- !ruby/object:Gem::Dependency
|
103
140
|
name: mocha
|
104
|
-
|
141
|
+
prerelease: false
|
142
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
105
143
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
version: "0"
|
110
151
|
type: :development
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
a command-line app, including an opinionated bootstrapping process, some helpful
|
115
|
-
cucumber steps, and some classes to bridge logging and output into a simple, unified,
|
116
|
-
interface
|
117
|
-
email:
|
152
|
+
version_requirements: *id009
|
153
|
+
description: Methadone provides a lot of small but useful features for developing a command-line app, including an opinionated bootstrapping process, some helpful cucumber steps, and some classes to bridge logging and output into a simple, unified, interface
|
154
|
+
email:
|
118
155
|
- davetron5000 at gmail.com
|
119
|
-
executables:
|
156
|
+
executables:
|
120
157
|
- methadone
|
121
158
|
extensions: []
|
159
|
+
|
122
160
|
extra_rdoc_files: []
|
123
|
-
|
161
|
+
|
162
|
+
files:
|
124
163
|
- .gitignore
|
125
164
|
- .rvmrc
|
126
165
|
- .travis.yml
|
@@ -133,6 +172,7 @@ files:
|
|
133
172
|
- features/bootstrap.feature
|
134
173
|
- features/license.feature
|
135
174
|
- features/readme.feature
|
175
|
+
- features/rspec_support.feature
|
136
176
|
- features/step_definitions/bootstrap_steps.rb
|
137
177
|
- features/step_definitions/license_steps.rb
|
138
178
|
- features/step_definitions/readme_steps.rb
|
@@ -167,7 +207,8 @@ files:
|
|
167
207
|
- templates/full/features/step_definitions/executable_steps.rb.erb
|
168
208
|
- templates/full/features/support/env.rb.erb
|
169
209
|
- templates/full/mit_LICENSE.txt.erb
|
170
|
-
- templates/
|
210
|
+
- templates/rspec/spec/tc_something_spec.rb.erb
|
211
|
+
- templates/test_unit/test/tc_something.rb.erb
|
171
212
|
- test/base_test.rb
|
172
213
|
- test/command_for_tests.rb
|
173
214
|
- test/execution_strategy/test_base.rb
|
@@ -181,35 +222,49 @@ files:
|
|
181
222
|
- test/test_exit_now.rb
|
182
223
|
- test/test_main.rb
|
183
224
|
- test/test_sh.rb
|
225
|
+
has_rdoc: true
|
184
226
|
homepage: http://github.com/davetron5000/methadone
|
185
227
|
licenses: []
|
186
|
-
|
187
|
-
|
228
|
+
|
229
|
+
post_install_message: "\n\n\
|
230
|
+
!!!!!!!!!!!!!!!!!!!!!!\n\n\
|
231
|
+
If you are on Ruby 1.8 or REE, you MUST\n\n\
|
232
|
+
gem install open4\n\n\
|
233
|
+
!!!!!!!!!!!!!!!!!!!!!!\n "
|
188
234
|
rdoc_options: []
|
189
|
-
|
235
|
+
|
236
|
+
require_paths:
|
190
237
|
- lib
|
191
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
238
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
192
239
|
none: false
|
193
|
-
requirements:
|
194
|
-
- -
|
195
|
-
- !ruby/object:Gem::Version
|
196
|
-
|
197
|
-
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
hash: 3
|
244
|
+
segments:
|
245
|
+
- 0
|
246
|
+
version: "0"
|
247
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
248
|
none: false
|
199
|
-
requirements:
|
200
|
-
- -
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
|
249
|
+
requirements:
|
250
|
+
- - ">="
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
hash: 3
|
253
|
+
segments:
|
254
|
+
- 0
|
255
|
+
version: "0"
|
203
256
|
requirements: []
|
257
|
+
|
204
258
|
rubyforge_project: methadone
|
205
|
-
rubygems_version: 1.
|
259
|
+
rubygems_version: 1.5.2
|
206
260
|
signing_key:
|
207
261
|
specification_version: 3
|
208
262
|
summary: Kick the bash habit and start your command-line apps off right
|
209
|
-
test_files:
|
263
|
+
test_files:
|
210
264
|
- features/bootstrap.feature
|
211
265
|
- features/license.feature
|
212
266
|
- features/readme.feature
|
267
|
+
- features/rspec_support.feature
|
213
268
|
- features/step_definitions/bootstrap_steps.rb
|
214
269
|
- features/step_definitions/license_steps.rb
|
215
270
|
- features/step_definitions/readme_steps.rb
|