gem-release 1.0.0 → 2.0.0.dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +13 -0
  3. data/Gemfile.lock +72 -0
  4. data/{lib/gem_release/templates/LICENSE → MIT-LICENSE.md} +3 -2
  5. data/README.md +646 -0
  6. data/README.md.erb +159 -0
  7. data/TODO.txt +194 -0
  8. data/lib/gem/release.rb +13 -0
  9. data/lib/gem/release/cmds.rb +16 -0
  10. data/lib/gem/release/cmds/base.rb +101 -0
  11. data/lib/gem/release/cmds/bootstrap.rb +222 -0
  12. data/lib/gem/release/cmds/bump.rb +165 -0
  13. data/lib/gem/release/cmds/gemspec.rb +85 -0
  14. data/lib/gem/release/cmds/release.rb +100 -0
  15. data/lib/gem/release/cmds/runner.rb +52 -0
  16. data/lib/gem/release/cmds/tag.rb +93 -0
  17. data/lib/gem/release/config.rb +42 -0
  18. data/lib/gem/release/config/env.rb +49 -0
  19. data/lib/gem/release/config/files.rb +35 -0
  20. data/lib/gem/release/context.rb +76 -0
  21. data/lib/gem/release/context/gem.rb +28 -0
  22. data/lib/gem/release/context/gemspec.rb +41 -0
  23. data/lib/gem/release/context/paths.rb +87 -0
  24. data/lib/gem/release/context/system.rb +36 -0
  25. data/lib/gem/release/data.rb +60 -0
  26. data/lib/gem/release/files/template.rb +61 -0
  27. data/lib/gem/release/files/template/context.rb +30 -0
  28. data/lib/gem/release/files/templates.rb +59 -0
  29. data/lib/gem/release/files/templates/group.rb +47 -0
  30. data/lib/gem/release/files/version.rb +68 -0
  31. data/lib/gem/release/helper.rb +45 -0
  32. data/lib/gem/release/helper/hash.rb +35 -0
  33. data/lib/gem/release/helper/string.rb +43 -0
  34. data/lib/gem/release/support/gem_command.rb +67 -0
  35. data/lib/gem/release/support/registry.rb +59 -0
  36. data/lib/gem/release/templates/.gitignore +8 -0
  37. data/lib/gem/release/templates/Gemfile +3 -0
  38. data/lib/gem/release/templates/gemspec +19 -0
  39. data/lib/gem/release/templates/licenses/mit.md +21 -0
  40. data/lib/gem/release/templates/licenses/mpl-2.md +373 -0
  41. data/lib/gem/release/templates/main.rb +1 -0
  42. data/lib/gem/release/templates/rspec/.rspec +3 -0
  43. data/lib/gem/release/templates/rspec/spec/spec_helper.rb +4 -0
  44. data/lib/gem/release/templates/travis/.travis.yml +1 -0
  45. data/lib/gem/release/templates/version.rb +1 -0
  46. data/lib/gem/release/version.rb +5 -0
  47. data/lib/gem/release/version/number.rb +102 -0
  48. data/lib/rubygems/commands/bootstrap_command.rb +4 -93
  49. data/lib/rubygems/commands/bump_command.rb +4 -110
  50. data/lib/rubygems/commands/gemspec_command.rb +5 -29
  51. data/lib/rubygems/commands/release_command.rb +4 -70
  52. data/lib/rubygems/commands/tag_command.rb +5 -46
  53. data/lib/rubygems_plugin.rb +8 -2
  54. metadata +56 -83
  55. data/lib/core_ext/hash/symbolize_keys.rb +0 -13
  56. data/lib/core_ext/kernel/silence.rb +0 -18
  57. data/lib/core_ext/string/camelize.rb +0 -5
  58. data/lib/gem_release.rb +0 -10
  59. data/lib/gem_release/command_options.rb +0 -31
  60. data/lib/gem_release/configuration.rb +0 -33
  61. data/lib/gem_release/gemspec_template.rb +0 -35
  62. data/lib/gem_release/helpers.rb +0 -104
  63. data/lib/gem_release/template.rb +0 -52
  64. data/lib/gem_release/templates/Gemfile +0 -3
  65. data/lib/gem_release/templates/README.md +0 -1
  66. data/lib/gem_release/templates/Rakefile +0 -10
  67. data/lib/gem_release/templates/gemspec +0 -18
  68. data/lib/gem_release/templates/gitignore +0 -25
  69. data/lib/gem_release/templates/test/test_helper.rb +0 -2
  70. data/lib/gem_release/templates/version.rb +0 -12
  71. data/lib/gem_release/version.rb +0 -3
  72. data/lib/gem_release/version_file.rb +0 -115
  73. data/lib/gem_release/version_template.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 201775120690dc66801c9b25e6f8101838955726
4
- data.tar.gz: e0a277ab1d51cb97406c3a6877a5001fa9cff1bc
3
+ metadata.gz: de3c02037630d812e94714ef4d9bd64d0cb05b1c
4
+ data.tar.gz: ac73a1c14c2cac5899f1e6589d5082ec20b50bb6
5
5
  SHA512:
6
- metadata.gz: d24b734983fc16c15ebdebc40678b157a5011917b5a62628624bd5d50fc740f76610e6f34cc2b9447acc7b612524209c197fa05b004f9f39aa255b279c2c8051
7
- data.tar.gz: 3468a51a7c0c003f1253cf627a7eee4d8ff3b1b69d654aa45306a24d45a238f23e8bcc2c91d45925ba45737031d15abc61e0f6dfd03fc5b6de85465839d71e11
6
+ metadata.gz: 43770ee60ea5a82409423671417c88498a0abd6fddabe4a75297552447eb1e12e3ad63acbf3ed7586c1f6af69de9c4c656efd3f39847602aa793f11e9bcb4195
7
+ data.tar.gz: 643a26ffc6a0bb321a02b26481a7b8ced8689b1d9e3939f49dc333fb9137576404d52a73b00075f84c9b8ab7d493dee18379d32c5de72289a0b713538ceffa52
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'gem-release', path: '.'
4
+
5
+ group :development do
6
+ gem 'geminabox'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rspec'
11
+ gem 'simplecov'
12
+ gem 'coveralls'
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gem-release (2.0.0.dev.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ builder (3.2.3)
10
+ coveralls (0.8.21)
11
+ json (>= 1.8, < 3)
12
+ simplecov (~> 0.14.1)
13
+ term-ansicolor (~> 1.3)
14
+ thor (~> 0.19.4)
15
+ tins (~> 1.6)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ faraday (0.12.0.1)
19
+ multipart-post (>= 1.2, < 3)
20
+ geminabox (0.13.5)
21
+ builder
22
+ faraday
23
+ httpclient (>= 2.2.7)
24
+ nesty
25
+ sinatra (>= 1.2.7)
26
+ httpclient (2.6.0.1)
27
+ json (2.1.0)
28
+ multipart-post (2.0.0)
29
+ nesty (1.0.2)
30
+ rack (1.6.5)
31
+ rack-protection (1.5.3)
32
+ rack
33
+ rspec (3.5.0)
34
+ rspec-core (~> 3.5.0)
35
+ rspec-expectations (~> 3.5.0)
36
+ rspec-mocks (~> 3.5.0)
37
+ rspec-core (3.5.4)
38
+ rspec-support (~> 3.5.0)
39
+ rspec-expectations (3.5.0)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.5.0)
42
+ rspec-mocks (3.5.0)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.5.0)
45
+ rspec-support (3.5.0)
46
+ simplecov (0.14.1)
47
+ docile (~> 1.1.0)
48
+ json (>= 1.8, < 3)
49
+ simplecov-html (~> 0.10.0)
50
+ simplecov-html (0.10.0)
51
+ sinatra (1.4.8)
52
+ rack (~> 1.5)
53
+ rack-protection (~> 1.4)
54
+ tilt (>= 1.3, < 3)
55
+ term-ansicolor (1.6.0)
56
+ tins (~> 1.0)
57
+ thor (0.19.4)
58
+ tilt (2.0.7)
59
+ tins (1.13.2)
60
+
61
+ PLATFORMS
62
+ ruby
63
+
64
+ DEPENDENCIES
65
+ coveralls
66
+ gem-release!
67
+ geminabox
68
+ rspec
69
+ simplecov
70
+
71
+ BUNDLED WITH
72
+ 1.14.6
@@ -1,6 +1,6 @@
1
- MIT LICENSE
1
+ # MIT LICENSE
2
2
 
3
- Copyright (c) <% year %> <%= author %> <<%= email %>>
3
+ Copyright (c) 2010-2017 Sven Fuchs <me@svenfuchs.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,646 @@
1
+ # gem release [![Build Status](https://secure.travis-ci.org/svenfuchs/gem-release.png)](http://travis-ci.org/svenfuchs/gem-release)
2
+
3
+ This gem plugin aims at making gem development easier by automating repetitive work based on conventions, configuration, and templates.
4
+
5
+ It adds the commands `bootstrap`, `gemspec`, `bump`, `tag` and a `release` to the rubygems `gem` command.
6
+
7
+ | Project | Gem Release |
8
+ | ---------------------- | ------------ |
9
+ | Gem name | gem-release |
10
+ | License | [MIT](https://github.com/svenfuchs/gem-release/blob/master/LICENSE.md) |
11
+ | Version | [![Gem Version](https://badge.fury.io/rb/gem-release.png)](http://badge.fury.io/rb/gem-release) |
12
+ | Continuous integration | [![Build Status](https://secure.travis-ci.org/svenfuchs/gem-release.png?branch=master)](https://travis-ci.org/svenfuchs/gem-release) |
13
+ | Test coverage | [![Coverage Status](https://coveralls.io/repos/svenfuchs/gem-release/badge.png)](https://coveralls.io/r/svenfuchs/gem-release) |
14
+ | Documentation | [Documentation](http://rdoc.info/github/svenfuchs/gem-release/frames) |
15
+ | Credits | [Contributors](https://github.com/svenfuchs/gem-release/graphs/contributors) |
16
+
17
+ # Table of contents
18
+
19
+ * [Demo](#demo)
20
+ * [Installation](#installation)
21
+ * [Configuration](#configuration)
22
+ * [Conventions](#conventions)
23
+ * [Reference](#reference)
24
+ * [Scenarios](#scenarios)
25
+ * [Development](#development)
26
+
27
+ # Demo
28
+
29
+ This gif demos some of the things you can do with this plugin:
30
+
31
+ ![gem-relase-demo](https://cloud.githubusercontent.com/assets/2208/25568627/12a3b468-2e07-11e7-8d7b-055b5d7c71b9.gif)
32
+
33
+ ## Installation
34
+
35
+ The gem provides a rubygems plugin, so it's just:
36
+
37
+ ```
38
+ gem install gem-release
39
+ ```
40
+
41
+
42
+ # Configuration
43
+
44
+ Defaults for all options can be specified in a config file at either one of
45
+ these locations:
46
+
47
+ * `~/.gem_release/config.yml`
48
+ * `~/.gem_release.yml`
49
+ * `./.gem_release/config.yml`
50
+ * `./.gem_release.yml`
51
+
52
+ Config files must be in the [YAML](http://www.yaml.org/) format, and list
53
+ options per command. Common options can be set on the root.
54
+
55
+ For instance, the following entries will set the `quiet` flag for all commands,
56
+ and a custom host name with `gem release`:
57
+
58
+ ```yaml
59
+ quiet: true
60
+
61
+ release:
62
+ host: https://example.com
63
+ ```
64
+
65
+ Defaults for all options also can be specified as environment variables, for
66
+ example `GEM_RELEASE_PRETEND=true`.
67
+
68
+ Defaults specified in config files and environment variables can be overridden
69
+ as command line options when issuing the respective `gem` command.
70
+
71
+ Only the first config file found in the locations given above will be used, if
72
+ any, and defaults from this config file will be merged with both environment
73
+ variables and given command line options.
74
+
75
+
76
+ # Conventions
77
+
78
+ When bootstrapping a new gem:
79
+
80
+ * A gem name `gem_name` is left untouched when mapped to the path `lib/gem_name`, and the Ruby constant name `GemName`.
81
+ * A gem name `gem-name` is mapped to the path `lib/gem/name`, and the Ruby constant name `Gem::Name`
82
+
83
+ When bumping the version of an existing gem `gem-name` the following locations are checked:
84
+
85
+ * `lib/gem/name/version.rb`
86
+ * `lib/gem-name/version.rb`
87
+
88
+
89
+ # Reference
90
+
91
+ The gem `gem-release` adds the following commands to the rubygems `gem` command:
92
+
93
+ * [gem bootstrap](#gem-bootstrap) - Scaffolds a new gem from template files.
94
+ * [gem bump](#gem-bump) - Bumps one, several, or all gems in this directory.
95
+ * [gem gemspec](#gem-gemspec) - Generates a gemspec.
96
+ * [gem release](#gem-release) - Releases one or all gems in this directory.
97
+ * [gem tag](#gem-tag) - Tags the HEAD commit with the gem's current version.
98
+
99
+ ## gem bootstrap
100
+
101
+ Scaffolds a new gem from template files.
102
+
103
+ ### Arguments
104
+
105
+ ```
106
+ gem_name - name of the gem (optional, will default to the current directory name if not specified)
107
+ ```
108
+
109
+ ### Options
110
+
111
+ ```
112
+ --[no]-scaffold Scaffold gem files
113
+ --dir DIR Directory to place the gem in (defaults to the given name, or the current working dir)
114
+ -t, --template NAME Template groups to use for scaffolding
115
+ --rspec Use the rspec group (by default adds .rspec and spec/spec_helper.rb)
116
+ --travis Use the rspec group (by default adds .travis.yml)
117
+ -l, --no-license NAME
118
+ -s, --strategy NAME Strategy for collecting files [glob|git] in .gemspec
119
+ --git Initialize a git repo
120
+ --github Initialize a git repo, create on github
121
+ --remote Git remote repository
122
+ --push Push the git repo to github
123
+ --pretend
124
+ ```
125
+
126
+ ### Description
127
+
128
+ Scaffolds a new gem from template files. Optionally initialize a git
129
+ repository, set a git remote, and push to the remote repository.
130
+
131
+ If no argument is given the current directory name is used as the gem
132
+ name. If one or many arguments are given then these will be used as
133
+ gem names, and new directories will be created accordingly.
134
+
135
+ By default the following files will be created:
136
+
137
+ * `.gitignore`
138
+ * `Gemspec`
139
+ * `[gem-name].gemspec`
140
+ * `LICENSE.md`
141
+ * `lib/[gem]/[name].rb`
142
+ * `lib/[gem]/[name]/version.rb`
143
+
144
+ Templates in the first existing one of these directories will always
145
+ be used to create additional files:
146
+
147
+ * `./.gem-release/default` (local)
148
+ * `~/.gem-release/default` (global)
149
+
150
+ If `--template [group]` is given additional files will be created from
151
+ the first existing one of these directories:
152
+
153
+ * `./.gem-release/[group]` (local)
154
+ * `~/.gem-release/[group]` (global)
155
+
156
+ It is possible to specify several template groups in order to add
157
+ files from several custom template directories.
158
+
159
+ If `--template rspec` is given then additionally the files `.rspec`
160
+ and `spec/spec_helper.rb` will be created, or whatever files exist in
161
+ a local or global directory `.gem-release/templates/rspec`.
162
+
163
+ If `--template travis` is given then additionally the file
164
+ `.travis.yml` will be created, or whatever files exist in a local or
165
+ global directory `.gem-release/templates/travis`.
166
+
167
+ The license added by default is the MIT License. If `--license [name]`
168
+ is given then this license will be added. The only other license file
169
+ shipped is the Mozilla Public License v2.0. Other licenses must be
170
+ present in the local or global directory `.gem-release/licenses`.
171
+
172
+ ## gem bump
173
+
174
+ Bumps one, several, or all gems in this directory.
175
+
176
+ ### Arguments
177
+
178
+ ```
179
+ gem_name - name of the gem (optional, will use the directory name, or all gemspecs if --recurse is given)
180
+ ```
181
+
182
+ ### Options
183
+
184
+ ```
185
+ -c, --[no-]commit Perform a commit after incrementing gem version
186
+ -p, --[no-]push Push the new commit to the git remote repository
187
+ --remote REMOTE Git remote to push to (defaults to origin)
188
+ -v, --version VERSION Target version: next [major|minor|patch|pre|release] or a given version number [x.x.x]
189
+ -t, --tag Shortcut for running the `gem tag` command
190
+ -r, --release Shortcut for the `gem release` command
191
+ --recurse Recurse into directories that contain gemspec files
192
+ --pretend
193
+ ```
194
+
195
+ ### Description
196
+
197
+ Bumps the version number defined in lib/[gem_name]/version.rb to to a
198
+ given, specific version number, or to the next major, minor, patch, or
199
+ pre-release level.
200
+
201
+ Optionally it pushes to the origin repository. Also, optionally it
202
+ invokes the `gem tag` and/or `gem release` command.
203
+
204
+ If no argument is given the first gemspec's name is assumed as the gem
205
+ name. If one or many arguments are given then these will be used as
206
+ gem names. If `--recurse` is given then all gem names from all
207
+ gemspecs in this directory or any of its subdirectories will be used.
208
+
209
+ The version can be bumped to either one of these targets:
210
+
211
+ ```
212
+ major
213
+ 1.1.1 # Bump to the given, specific version number
214
+ major # Bump to the next major level (e.g. 0.0.1 to 1.0.0)
215
+ minor # Bump to the next minor level (e.g. 0.0.1 to 0.1.0)
216
+ patch # Bump to the next patch level (e.g. 0.0.1 to 0.0.2)
217
+ pre|rc|etc # Bump to the next pre-release level (e.g. 0.0.1 to
218
+ # 0.1.0.pre.1, 1.0.0.pre.1 to 1.0.0.pre.2)
219
+ ```
220
+
221
+ When searching for the version file for a gem named `gem-name`: the
222
+ following paths will be searched relative to the gemspec's directory.
223
+
224
+ * `lib/gem-name/version.rb`
225
+ * `lib/gem/name/version.rb`
226
+
227
+ ## gem gemspec
228
+
229
+ Generates a gemspec.
230
+
231
+ ### Arguments
232
+
233
+ ```
234
+ gem_name - name of the gem (optional, will default to the current directory name if not specified)
235
+ ```
236
+
237
+ ### Options
238
+
239
+ ```
240
+ --dir DIR Directory to place the gem in (defaults to the given name, or the current working dir)
241
+ -l, --[no]-license[s] NAMES License(s) to list in the gemspec
242
+ -s, --strategy Strategy for collecting files [glob|git] in gemspec
243
+ --pretend
244
+ ```
245
+
246
+ ### Description
247
+
248
+ Generates a gemspec.
249
+
250
+ If no argument is given the current directory name is used as the gem
251
+ name. If one or many arguments are given then these will be used as
252
+ gem names, and new directories will be created accordingly.
253
+
254
+ The generated `gemspec` file will use the `glob` strategy for finding
255
+ files by default. Known strategies are:
256
+
257
+ * `glob` - uses the glob pattern `{bin/*,lib/**/*,[A-Z]*}`
258
+ * `git` - uses the git command `git ls-files app lib`
259
+
260
+ ## gem release
261
+
262
+ Releases one or all gems in this directory.
263
+
264
+ ### Arguments
265
+
266
+ ```
267
+ gem_name - name of the gem (optional, will use the first gemspec, or all gemspecs if --recurse is given)
268
+ ```
269
+
270
+ ### Options
271
+
272
+ ```
273
+ --host HOST Push to a compatible host other than rubygems.org
274
+ -k, --key KEY Use the API key from ~/.gem/credentials
275
+ -t, --tag Shortcut for running the `gem tag` command
276
+ --recurse Recurse into directories that contain gemspec files
277
+ --pretend
278
+ ```
279
+
280
+ ### Description
281
+
282
+ Builds one or many gems from the given gemspec(s), pushes them to
283
+ rubygems.org (or another, compatible host), and removes the left over
284
+ gem file.
285
+
286
+ Optionally invoke `gem tag`.
287
+
288
+ If no argument is given the first gemspec's name is assumed as the gem
289
+ name. If one or many arguments are given then these will be used. If
290
+ `--recurse` is given then all gem names from all gemspecs in this
291
+ directory or any of its subdirectories will be used.
292
+
293
+ ## gem tag
294
+
295
+ Tags the HEAD commit with the gem's current version.
296
+
297
+ ### Options
298
+
299
+ ```
300
+ -p, --[no]-push Push tag to the remote git repository
301
+ --remote REMOTE Git remote to push to (defaults to origin)
302
+ --pretend
303
+ ```
304
+
305
+ ### Description
306
+
307
+ Creates an annotated tag for the current HEAD commit, using the gem's
308
+ current version.
309
+
310
+ Optionally pushes the tag to the origin repository.
311
+
312
+ If one or many arguments are given then gemspecs with the same names
313
+ will be searched, and the working directory changed to their
314
+ respective directories. If `--recurse` is given then the directories
315
+ all gem names from all gemspecs in this directory or any of its
316
+ subdirectories will be used. This assumes that these directories are
317
+ separate git repositories.
318
+
319
+ The tag name will be `v[version]`. For example, if the current
320
+ version is `1.0.0`, then The tag is created using the command `git tag
321
+ -am "tag v1.0.0" v1.0.0`.
322
+
323
+
324
+ # Scenarios
325
+
326
+ * [Single gem in root](#scenario-1-single-gem-in-root)
327
+ * [Multiple gems in root](#scenario-2-multiple-gems-in-root)
328
+ * [Multiple gems in sub directories](#scenario-3-multiple-gems-in-sub-directories)
329
+ * [Nested gem with a conventional sub directory name](#scenario-4-nested-gem-with-a-conventional-sub-directory-name)
330
+ * [Nested gem with an irregular sub directory name](#scenario-5-nested-gem-with-an-irregular-sub-directory-name)
331
+
332
+ ## Scenario 1: Single gem in root
333
+
334
+ ### Setup
335
+
336
+ ```
337
+ export GEM_RELEASE_PUSH=false
338
+ cd /tmp
339
+ rm -rf foo
340
+ gem bootstrap foo
341
+ tree
342
+ ```
343
+
344
+ ### Directory structure
345
+
346
+ ```
347
+ .
348
+ ├── Gemfile
349
+ ├── LICENSE.md
350
+ ├── foo.gemspec
351
+ └── lib
352
+ ├── foo
353
+ │   └── version.rb
354
+ └── foo.rb
355
+ ```
356
+
357
+ ### Behaviour
358
+
359
+ ```
360
+ # this bumps foo
361
+ cd /tmp/foo
362
+ gem bump
363
+
364
+ # this also bumps foo
365
+ cd /tmp/foo
366
+ gem bump foo
367
+ ```
368
+
369
+ ## Scenario 2: Multiple gems in root
370
+
371
+ ### Setup
372
+
373
+ ```
374
+ export GEM_RELEASE_PUSH=false
375
+ cd /tmp
376
+ rm -rf foo
377
+ gem bootstrap foo
378
+ cd foo
379
+ gem bootstrap bar --dir .
380
+ tree
381
+ ```
382
+
383
+ ### Directory structure
384
+
385
+ ```
386
+ .
387
+ ├── Gemfile
388
+ ├── LICENSE.md
389
+ ├── bar.gemspec
390
+ ├── foo.gemspec
391
+ └── lib
392
+ ├── bar
393
+ │   └── version.rb
394
+ ├── bar.rb
395
+ ├── foo
396
+ │   └── version.rb
397
+ └── foo.rb
398
+ ```
399
+
400
+ ### Behaviour
401
+
402
+ ```
403
+ # this bumps both foo and bar
404
+ cd /tmp/foo
405
+ gem bump --recurse
406
+
407
+ # this also bumps both foo and bar
408
+ cd /tmp/foo
409
+ gem bump foo bar
410
+
411
+ # this bumps foo (because it's the first gemspec found)
412
+ cd /tmp/foo
413
+ gem bump
414
+
415
+ # this bumps foo
416
+ cd /tmp/foo
417
+ gem bump foo
418
+
419
+ # this bumps bar
420
+ cd /tmp/foo
421
+ gem bump bar
422
+ ```
423
+
424
+ ## Scenario 3: Multiple gems in sub directories
425
+
426
+ ### Setup
427
+
428
+ ```
429
+ export GEM_RELEASE_PUSH=false
430
+ cd /tmp
431
+ rm -rf root
432
+ mkdir root
433
+ cd root
434
+ gem bootstrap foo
435
+ gem bootstrap bar
436
+ tree
437
+ ```
438
+
439
+ ### Directory structure
440
+
441
+ ```
442
+ .
443
+ ├── bar
444
+ │   ├── Gemfile
445
+ │   ├── LICENSE.md
446
+ │   ├── bar.gemspec
447
+ │   └── lib
448
+ │   ├── bar
449
+ │   │   └── version.rb
450
+ │   └── bar.rb
451
+ └── foo
452
+ ├── Gemfile
453
+ ├── LICENSE.md
454
+ ├── foo.gemspec
455
+ └── lib
456
+ ├── foo
457
+ │   └── version.rb
458
+ └── foo.rb
459
+ ```
460
+
461
+ ### Behaviour
462
+
463
+ ```
464
+ # this bumps both foo and bar
465
+ cd /tmp/root
466
+ gem bump --recurse
467
+
468
+ # this also bumps both foo and bar
469
+ cd /tmp/root
470
+ gem bump foo bar
471
+
472
+ # this does bumps both foo and bar
473
+ cd /tmp/root
474
+ gem bump
475
+
476
+ # this bumps foo
477
+ cd /tmp/root
478
+ gem bump foo
479
+
480
+ # this bumps bar
481
+ cd /tmp/root
482
+ gem bump bar
483
+ ```
484
+
485
+ ## Scenario 4: Nested gem with a conventional sub directory name
486
+
487
+ ### Setup
488
+
489
+ ```
490
+ export GEM_RELEASE_PUSH=false
491
+ cd /tmp
492
+ rm -rf sinja
493
+ gem bootstrap sinja
494
+ cd sinja
495
+ mkdir extensions
496
+ cd extensions
497
+ gem bootstrap sinja-sequel
498
+ cd /tmp/sinja
499
+ tree
500
+ ```
501
+
502
+ ### Directory structure
503
+
504
+ ```
505
+ .
506
+ ├── Gemfile
507
+ ├── LICENSE.md
508
+ ├── extensions
509
+ │   └── sinja-sequel
510
+ │   ├── Gemfile
511
+ │   ├── LICENSE.md
512
+ │   ├── lib
513
+ │   │   └── sinja
514
+ │   │   ├── sequel
515
+ │   │   │   └── version.rb
516
+ │   │   └── sequel.rb
517
+ │   └── sinja-sequel.gemspec
518
+ ├── lib
519
+ │   ├── sinja
520
+ │   │   └── version.rb
521
+ │   └── sinja.rb
522
+ └── sinja.gemspec
523
+ ```
524
+
525
+ ### Behaviour
526
+
527
+ ```
528
+ # this bumps both sinja and sinja-sequel
529
+ cd /tmp/sinja
530
+ gem bump --recurse
531
+
532
+ # this bumps sinja
533
+ cd /tmp/sinja
534
+ gem bump
535
+
536
+ # this also bumps sinja
537
+ cd /tmp/sinja
538
+ gem bump sinja
539
+
540
+ # this bumps sinja-sequel
541
+ cd /tmp/sinja
542
+ gem bump sinja-sequel
543
+
544
+ # this also bumps sinja-sequel
545
+ cd /tmp/sinja/extensions/sinja-sequel
546
+ gem bump
547
+
548
+ # this also bumps sinja-sequel
549
+ cd /tmp/sinja/extensions/sinja-sequel
550
+ gem bump sinja-sequel
551
+ ```
552
+
553
+ ## Scenario 5: Nested gem with an irregular sub directory name
554
+
555
+ ### Setup
556
+
557
+ ```
558
+ export GEM_RELEASE_PUSH=false
559
+ cd /tmp
560
+ rm -rf sinja
561
+ gem bootstrap sinja
562
+ cd sinja
563
+ mkdir -p extensions
564
+ cd extensions
565
+ gem bootstrap sinja-sequel
566
+ mv sinja-sequel sequel
567
+ cd /tmp/sinja
568
+ tree
569
+ ```
570
+
571
+ ### Directory structure
572
+
573
+ ```
574
+ .
575
+ ├── Gemfile
576
+ ├── LICENSE.md
577
+ ├── extensions
578
+ │   └── sequel
579
+ │   ├── Gemfile
580
+ │   ├── LICENSE.md
581
+ │   ├── lib
582
+ │   │   └── sinja
583
+ │   │   ├── sequel
584
+ │   │   │   └── version.rb
585
+ │   │   └── sequel.rb
586
+ │   └── sinja-sequel.gemspec
587
+ ├── lib
588
+ │   ├── sinja
589
+ │   │   └── version.rb
590
+ │   └── sinja.rb
591
+ └── sinja.gemspec
592
+ ```
593
+
594
+ ### Behaviour
595
+
596
+ ```
597
+ # this bumps both sinja and sinja-sequel
598
+ cd /tmp/sinja
599
+ gem bump --recurse
600
+
601
+ # this bumps sinja
602
+ cd /tmp/sinja
603
+ gem bump
604
+
605
+ # this also bumps sinja
606
+ cd /tmp/sinja
607
+ gem bump sinja
608
+
609
+ # this bumps sinja-sequel only
610
+ cd /tmp/sinja
611
+ gem bump sinja-sequel
612
+
613
+ # this also bumps sinja-sequel only
614
+ cd /tmp/sinja/extensions/sequel
615
+ gem bump
616
+
617
+ # this also bumps sinja-sequel only
618
+ cd /tmp/sinja/extensions/sequel
619
+ gem bump sinja-sequel
620
+ ```
621
+
622
+
623
+ # Development
624
+
625
+ Running tests:
626
+
627
+ ```
628
+ bundle install
629
+ bundle exec rspec
630
+ ```
631
+
632
+ Testing commands against a [Geminabox](https://github.com/geminabox/geminabox) instance:
633
+
634
+ ```
635
+ # start geminabox
636
+ bundle install
637
+ bundle exec rackup
638
+
639
+ # workaround rubygems issue with a missing key
640
+ # see https://github.com/geminabox/geminabox/issues/153
641
+ echo ':localhost: none' >> ~/.gem/credentials
642
+
643
+ # test release
644
+ bundle exec gem release --host=http://localhost:9292 --key localhost
645
+ ```
646
+