methadone 1.9.5 → 2.0.0

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.
Files changed (56) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +2 -5
  5. data/README.rdoc +75 -47
  6. data/Rakefile +25 -29
  7. data/bin/methadone +13 -5
  8. data/lib/methadone.rb +1 -1
  9. data/lib/methadone/cli_logger.rb +0 -1
  10. data/lib/methadone/cli_logging.rb +1 -1
  11. data/lib/methadone/cucumber.rb +4 -0
  12. data/lib/methadone/main.rb +4 -1
  13. data/lib/methadone/test/base_integration_test.rb +29 -0
  14. data/lib/methadone/test/integration_test_assertions.rb +63 -0
  15. data/lib/methadone/version.rb +1 -1
  16. data/methadone.gemspec +3 -5
  17. data/templates/full/Rakefile.erb +9 -12
  18. data/templates/full/bin/executable.erb +2 -0
  19. data/templates/rspec/spec/something_spec.rb.erb +1 -1
  20. data/templates/test_unit/test/integration/test_cli.rb.erb +11 -0
  21. data/templates/test_unit/test/{tc_something.rb.erb → unit/test_something.rb.erb} +0 -0
  22. data/test/integration/base_integration_test.rb +60 -0
  23. data/test/integration/test_bootstrap.rb +150 -0
  24. data/test/integration/test_cli.rb +21 -0
  25. data/test/integration/test_license.rb +56 -0
  26. data/test/integration/test_readme.rb +53 -0
  27. data/test/integration/test_rspec.rb +28 -0
  28. data/test/integration/test_version.rb +21 -0
  29. data/test/{base_test.rb → unit/base_test.rb} +0 -0
  30. data/test/{command_for_tests.sh → unit/command_for_tests.sh} +0 -0
  31. data/test/{execution_strategy → unit/execution_strategy}/test_base.rb +0 -0
  32. data/test/{execution_strategy → unit/execution_strategy}/test_jvm.rb +4 -4
  33. data/test/{execution_strategy → unit/execution_strategy}/test_mri.rb +0 -0
  34. data/test/{execution_strategy → unit/execution_strategy}/test_open_3.rb +5 -5
  35. data/test/{execution_strategy → unit/execution_strategy}/test_open_4.rb +5 -5
  36. data/test/{execution_strategy → unit/execution_strategy}/test_rbx_open_4.rb +0 -0
  37. data/test/unit/test/test_integration_test_assertions.rb +211 -0
  38. data/test/{test_cli_logger.rb → unit/test_cli_logger.rb} +17 -17
  39. data/test/{test_cli_logging.rb → unit/test_cli_logging.rb} +12 -12
  40. data/test/{test_exit_now.rb → unit/test_exit_now.rb} +4 -4
  41. data/test/{test_main.rb → unit/test_main.rb} +48 -48
  42. data/test/{test_sh.rb → unit/test_sh.rb} +37 -37
  43. metadata +61 -93
  44. data/features/bootstrap.feature +0 -153
  45. data/features/license.feature +0 -43
  46. data/features/readme.feature +0 -26
  47. data/features/rspec_support.feature +0 -27
  48. data/features/step_definitions/bootstrap_steps.rb +0 -47
  49. data/features/step_definitions/license_steps.rb +0 -30
  50. data/features/step_definitions/readme_steps.rb +0 -26
  51. data/features/step_definitions/version_steps.rb +0 -4
  52. data/features/support/env.rb +0 -26
  53. data/features/version.feature +0 -17
  54. data/templates/full/features/executable.feature.erb +0 -13
  55. data/templates/full/features/step_definitions/executable_steps.rb.erb +0 -1
  56. data/templates/full/features/support/env.rb.erb +0 -16
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: methadone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - davetron5000
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-02 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
- - !ruby/object:Gem::Dependency
56
- name: cucumber
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: aruba
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 0.5.1
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 0.5.1
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: simplecov
85
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +84,16 @@ dependencies:
112
84
  name: mocha
113
85
  requirement: !ruby/object:Gem::Requirement
114
86
  requirements:
115
- - - '='
87
+ - - ">="
116
88
  - !ruby/object:Gem::Version
117
- version: 0.13.2
89
+ version: '0'
118
90
  type: :development
119
91
  prerelease: false
120
92
  version_requirements: !ruby/object:Gem::Requirement
121
93
  requirements:
122
- - - '='
94
+ - - ">="
123
95
  - !ruby/object:Gem::Version
124
- version: 0.13.2
96
+ version: '0'
125
97
  - !ruby/object:Gem::Dependency
126
98
  name: sdoc
127
99
  requirement: !ruby/object:Gem::Requirement
@@ -140,30 +112,30 @@ dependencies:
140
112
  name: rspec
141
113
  requirement: !ruby/object:Gem::Requirement
142
114
  requirements:
143
- - - "~>"
115
+ - - ">="
144
116
  - !ruby/object:Gem::Version
145
- version: '3'
117
+ version: '0'
146
118
  type: :development
147
119
  prerelease: false
148
120
  version_requirements: !ruby/object:Gem::Requirement
149
121
  requirements:
150
- - - "~>"
122
+ - - ">="
151
123
  - !ruby/object:Gem::Version
152
- version: '3'
124
+ version: '0'
153
125
  - !ruby/object:Gem::Dependency
154
126
  name: i18n
155
127
  requirement: !ruby/object:Gem::Requirement
156
128
  requirements:
157
- - - '='
129
+ - - ">="
158
130
  - !ruby/object:Gem::Version
159
- version: 0.6.1
131
+ version: '0'
160
132
  type: :development
161
133
  prerelease: false
162
134
  version_requirements: !ruby/object:Gem::Requirement
163
135
  requirements:
164
- - - '='
136
+ - - ">="
165
137
  - !ruby/object:Gem::Version
166
- version: 0.6.1
138
+ version: '0'
167
139
  description: Methadone provides a lot of small but useful features for developing
168
140
  a command-line app, including an opinionated bootstrapping process, some helpful
169
141
  cucumber steps, and some classes to bridge logging and output into a simple, unified,
@@ -185,16 +157,6 @@ files:
185
157
  - README.rdoc
186
158
  - Rakefile
187
159
  - bin/methadone
188
- - features/bootstrap.feature
189
- - features/license.feature
190
- - features/readme.feature
191
- - features/rspec_support.feature
192
- - features/step_definitions/bootstrap_steps.rb
193
- - features/step_definitions/license_steps.rb
194
- - features/step_definitions/readme_steps.rb
195
- - features/step_definitions/version_steps.rb
196
- - features/support/env.rb
197
- - features/version.feature
198
160
  - lib/methadone.rb
199
161
  - lib/methadone/argv_parser.rb
200
162
  - lib/methadone/cli.rb
@@ -212,6 +174,8 @@ files:
212
174
  - lib/methadone/main.rb
213
175
  - lib/methadone/process_status.rb
214
176
  - lib/methadone/sh.rb
177
+ - lib/methadone/test/base_integration_test.rb
178
+ - lib/methadone/test/integration_test_assertions.rb
215
179
  - lib/methadone/version.rb
216
180
  - methadone.gemspec
217
181
  - templates/full/.gitignore.erb
@@ -221,27 +185,33 @@ files:
221
185
  - templates/full/apache_LICENSE.txt.erb
222
186
  - templates/full/bin/executable.erb
223
187
  - templates/full/custom_LICENSE.txt.erb
224
- - templates/full/features/executable.feature.erb
225
- - templates/full/features/step_definitions/executable_steps.rb.erb
226
- - templates/full/features/support/env.rb.erb
227
188
  - templates/full/gplv2_LICENSE.txt.erb
228
189
  - templates/full/gplv3_LICENSE.txt.erb
229
190
  - templates/full/mit_LICENSE.txt.erb
230
191
  - templates/rspec/spec/something_spec.rb.erb
231
- - templates/test_unit/test/tc_something.rb.erb
232
- - test/base_test.rb
233
- - test/command_for_tests.sh
234
- - test/execution_strategy/test_base.rb
235
- - test/execution_strategy/test_jvm.rb
236
- - test/execution_strategy/test_mri.rb
237
- - test/execution_strategy/test_open_3.rb
238
- - test/execution_strategy/test_open_4.rb
239
- - test/execution_strategy/test_rbx_open_4.rb
240
- - test/test_cli_logger.rb
241
- - test/test_cli_logging.rb
242
- - test/test_exit_now.rb
243
- - test/test_main.rb
244
- - test/test_sh.rb
192
+ - templates/test_unit/test/integration/test_cli.rb.erb
193
+ - templates/test_unit/test/unit/test_something.rb.erb
194
+ - test/integration/base_integration_test.rb
195
+ - test/integration/test_bootstrap.rb
196
+ - test/integration/test_cli.rb
197
+ - test/integration/test_license.rb
198
+ - test/integration/test_readme.rb
199
+ - test/integration/test_rspec.rb
200
+ - test/integration/test_version.rb
201
+ - test/unit/base_test.rb
202
+ - test/unit/command_for_tests.sh
203
+ - test/unit/execution_strategy/test_base.rb
204
+ - test/unit/execution_strategy/test_jvm.rb
205
+ - test/unit/execution_strategy/test_mri.rb
206
+ - test/unit/execution_strategy/test_open_3.rb
207
+ - test/unit/execution_strategy/test_open_4.rb
208
+ - test/unit/execution_strategy/test_rbx_open_4.rb
209
+ - test/unit/test/test_integration_test_assertions.rb
210
+ - test/unit/test_cli_logger.rb
211
+ - test/unit/test_cli_logging.rb
212
+ - test/unit/test_exit_now.rb
213
+ - test/unit/test_main.rb
214
+ - test/unit/test_sh.rb
245
215
  homepage: http://github.com/davetron5000/methadone
246
216
  licenses: []
247
217
  metadata: {}
@@ -261,31 +231,29 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
231
  version: '0'
262
232
  requirements: []
263
233
  rubyforge_project: methadone
264
- rubygems_version: 2.6.8
234
+ rubygems_version: 2.7.6
265
235
  signing_key:
266
236
  specification_version: 4
267
237
  summary: Kick the bash habit and start your command-line apps off right
268
238
  test_files:
269
- - features/bootstrap.feature
270
- - features/license.feature
271
- - features/readme.feature
272
- - features/rspec_support.feature
273
- - features/step_definitions/bootstrap_steps.rb
274
- - features/step_definitions/license_steps.rb
275
- - features/step_definitions/readme_steps.rb
276
- - features/step_definitions/version_steps.rb
277
- - features/support/env.rb
278
- - features/version.feature
279
- - test/base_test.rb
280
- - test/command_for_tests.sh
281
- - test/execution_strategy/test_base.rb
282
- - test/execution_strategy/test_jvm.rb
283
- - test/execution_strategy/test_mri.rb
284
- - test/execution_strategy/test_open_3.rb
285
- - test/execution_strategy/test_open_4.rb
286
- - test/execution_strategy/test_rbx_open_4.rb
287
- - test/test_cli_logger.rb
288
- - test/test_cli_logging.rb
289
- - test/test_exit_now.rb
290
- - test/test_main.rb
291
- - test/test_sh.rb
239
+ - test/integration/base_integration_test.rb
240
+ - test/integration/test_bootstrap.rb
241
+ - test/integration/test_cli.rb
242
+ - test/integration/test_license.rb
243
+ - test/integration/test_readme.rb
244
+ - test/integration/test_rspec.rb
245
+ - test/integration/test_version.rb
246
+ - test/unit/base_test.rb
247
+ - test/unit/command_for_tests.sh
248
+ - test/unit/execution_strategy/test_base.rb
249
+ - test/unit/execution_strategy/test_jvm.rb
250
+ - test/unit/execution_strategy/test_mri.rb
251
+ - test/unit/execution_strategy/test_open_3.rb
252
+ - test/unit/execution_strategy/test_open_4.rb
253
+ - test/unit/execution_strategy/test_rbx_open_4.rb
254
+ - test/unit/test/test_integration_test_assertions.rb
255
+ - test/unit/test_cli_logger.rb
256
+ - test/unit/test_cli_logging.rb
257
+ - test/unit/test_exit_now.rb
258
+ - test/unit/test_main.rb
259
+ - test/unit/test_sh.rb
@@ -1,153 +0,0 @@
1
- Feature: Bootstrap a new command-line app
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 all kinds of cool things
5
-
6
- Background:
7
- Given the directory "tmp/newgem" does not exist
8
- And the directory "tmp/new-gem" does not exist
9
-
10
- @wip
11
- Scenario: Bootstrap a new app from scratch
12
- When I successfully run `methadone tmp/newgem`
13
- Then the following directories should exist:
14
- |tmp/newgem |
15
- |tmp/newgem/bin |
16
- |tmp/newgem/lib |
17
- |tmp/newgem/lib/newgem |
18
- |tmp/newgem/test |
19
- |tmp/newgem/features |
20
- |tmp/newgem/features/support |
21
- |tmp/newgem/features/step_definitions |
22
- Then the following directories should not exist:
23
- |tmp/newgem/spec |
24
- And the following files should exist:
25
- |tmp/newgem/newgem.gemspec |
26
- |tmp/newgem/Rakefile |
27
- |tmp/newgem/.gitignore |
28
- |tmp/newgem/Gemfile |
29
- |tmp/newgem/bin/newgem |
30
- |tmp/newgem/features/newgem.feature |
31
- |tmp/newgem/features/support/env.rb |
32
- |tmp/newgem/features/step_definitions/newgem_steps.rb |
33
- |tmp/newgem/test/tc_something.rb |
34
- And the file "tmp/newgem/.gitignore" should match /results.html/
35
- And the file "tmp/newgem/.gitignore" should match /html/
36
- And the file "tmp/newgem/.gitignore" should match /pkg/
37
- And the file "tmp/newgem/.gitignore" should match /.DS_Store/
38
- And the file "tmp/newgem/newgem.gemspec" should match /add_development_dependency\('aruba'/
39
- And the file "tmp/newgem/newgem.gemspec" should match /add_development_dependency\('rdoc'/
40
- And the file "tmp/newgem/newgem.gemspec" should match /add_development_dependency "rake"/
41
- And the file "tmp/newgem/newgem.gemspec" should match /add_dependency\('methadone'/
42
- And the file "tmp/newgem/newgem.gemspec" should include "test-unit" if needed
43
- And the file "tmp/newgem/newgem.gemspec" should use the same block variable throughout
44
- Given I cd to "tmp/newgem"
45
- And my app's name is "newgem"
46
- When I successfully run `bin/newgem --help` with "lib" in the library path
47
- Then the banner should be present
48
- And the banner should document that this app takes options
49
- And the following options should be documented:
50
- |--version|
51
- |--help|
52
- |--log-level|
53
- And the banner should document that this app takes no arguments
54
- When I successfully run `rake -T -I../../lib`
55
- Then the output should match /rake clean/
56
- And the output should match /rake clobber/
57
- And the output should match /rake clobber_rdoc/
58
- And the output should match /rake features/
59
- And the output should match /rake rdoc/
60
- And the output should match /rake release/
61
- And the output should match /rake rerdoc/
62
- And the output should match /rake test/
63
- And the output should match /rake install/
64
- And the output should match /rake build/
65
- When I run `rake -I../../../../lib`
66
- Then the exit status should be 0
67
- And the output should match /1 tests, 1 assertions, 0 failures, 0 errors/
68
- And the output should contain:
69
- """
70
- 1 scenario (1 passed)
71
- 6 steps (6 passed)
72
- """
73
-
74
- Scenario Outline: Bootstrap a new app with a dash is OK
75
- Given I successfully run `methadone tmp/new-gem`
76
- And I cd to "tmp/new-gem"
77
- And my app's name is "new-gem"
78
- When I successfully run `bin/new-gem <help>` with "lib" in the library path
79
- Then the banner should be present
80
- And the banner should document that this app takes options
81
- And the following options should be documented:
82
- |--version|
83
- |--log-level|
84
- And the banner should document that this app takes no arguments
85
- When I run `rake -I../../../../lib`
86
- Then the exit status should be 0
87
- And the output should match /1 tests, 1 assertions, 0 failures, 0 errors/
88
- And the output should contain:
89
- """
90
- 1 scenario (1 passed)
91
- 6 steps (6 passed)
92
- """
93
- Examples:
94
- | help |
95
- | -h |
96
- | --help |
97
- | --version |
98
-
99
- Scenario: Version flag can be used to only show the app version
100
- Given I successfully run `methadone tmp/new-gem`
101
- And "bin/new-gem" has configured version to show only the version and not help
102
- And I cd to "tmp/new-gem"
103
- And my app's name is "new-gem"
104
- When I successfully run `bin/new-gem --version` with "lib" in the library path
105
- Then the output should match /new-gem version 0/
106
-
107
- Scenario: Version flag can be used to only show the app version with a custom format
108
- Given I successfully run `methadone tmp/new-gem`
109
- And "bin/new-gem" has configured version to show only the version with a custom format and not help
110
- And I cd to "tmp/new-gem"
111
- And my app's name is "new-gem"
112
- When I successfully run `bin/new-gem --version` with "lib" in the library path
113
- Then the output should match /new-gem V0/
114
-
115
- Scenario: Won't squash an existing dir
116
- When I successfully run `methadone tmp/newgem`
117
- And I run `methadone tmp/newgem`
118
- Then the exit status should not be 0
119
- And the stderr should contain:
120
- """
121
- error: tmp/newgem exists, use --force to override
122
- """
123
-
124
- Scenario: WILL squash an existing dir if we use --force
125
- When I successfully run `methadone tmp/newgem`
126
- And I run `methadone --force tmp/newgem`
127
- Then the exit status should be 0
128
-
129
- Scenario: We must supply a dirname
130
- When I run `methadone`
131
- Then the exit status should not be 0
132
- And the stderr should match /'app_name' is required/
133
-
134
- Scenario: Help is properly documented
135
- When I get help for "methadone"
136
- Then the exit status should be 0
137
- And the following options should be documented:
138
- | --force | |
139
- | --readme | which is negatable |
140
- | -l, --license | which is not negatable |
141
- | --log-level | |
142
- And the banner should be present
143
- And the banner should document that this app takes options
144
- And the banner should document that this app's arguments are:
145
- |app_name|which is required|
146
- And there should be a one line summary of what the app does
147
-
148
- Scenario: The whole initial state of the app has been staged with git
149
- Given I successfully run `methadone -l custom tmp/newgem`
150
- And I cd to "tmp/newgem"
151
- When I successfully run `git ls-files --others --deleted `
152
- Then the output should match /\A\Z/
153
-
@@ -1,43 +0,0 @@
1
- Feature: Users should get the license included
2
- As a user
3
- I'd like to be able to include a license
4
- So that I don't have to hunt it down for every new project
5
-
6
- Background:
7
- Given the directory "tmp/newgem" does not exist
8
-
9
- Scenario: Use a non-stock license
10
- When I successfully run `methadone -l custom tmp/newgem`
11
- Then newgem's license should be an empty file
12
- And the README should reference the need for a license
13
-
14
- Scenario: We only support a few licenses
15
- When I run `methadone -l foobar tmp/newgem`
16
- Then the exit status should not be 0
17
- And the stderr should match /invalid argument: -l foobar/
18
-
19
- Scenario: No license specified
20
- When I successfully run `methadone tmp/newgem`
21
- Then the stderr should contain "warning: your app has no license"
22
- And the README should not reference a license
23
- And the file "tmp/newgem/LICENSE.txt" should not exist
24
-
25
- Scenario: No license specified explicitly
26
- When I successfully run `methadone -l NONE tmp/newgem`
27
- Then the stderr should not contain "warning: your app has no license"
28
- And the README should not reference a license
29
- And the file "tmp/newgem/LICENSE.txt" should not exist
30
-
31
- Scenario Outline: Include one of a few stock licenses
32
- When I successfully run `methadone -l <license> tmp/newgem`
33
- Then newgem's license should be the <license> license
34
- And the README should reference this license
35
- And LICENSE.txt should contain user information and program name
36
-
37
- Examples:
38
- |license|
39
- |apache|
40
- |mit|
41
- |gplv2|
42
- |gplv3|
43
-
@@ -1,26 +0,0 @@
1
- Feature: a README should be generated
2
- As a user
3
- I want a template README
4
- So I don't need to recall the formatting or other info to get started
5
-
6
- Background:
7
- Given the directory "tmp/newgem" does not exist
8
-
9
- Scenario: I don't want a README
10
- When I successfully run `methadone --no-readme tmp/newgem`
11
- Then a README should not be generated
12
- And the file "tmp/newgem/Rakefile" should not match /rd.main = "README.rdoc"/
13
-
14
- Scenario Outline: Generate README
15
- When I successfully run `methadone <flag> tmp/newgem`
16
- Then a README should be generated in RDoc
17
- And the README should contain the project name
18
- And the README should contain my name
19
- And the README should contain links to Github and RDoc.info
20
- And the README should contain empty sections for common elements of a README
21
- And the file "tmp/newgem/Rakefile" should match /rd.main = "README.rdoc"/
22
-
23
- Examples:
24
- |flag|
25
- | |
26
- |--readme|