gem-release 2.0.0.dev.3 → 2.0.0.dev.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3379c9a8fe1a960836949e5167f96f83d10c71c7
4
- data.tar.gz: a59c0b440b3d1ffd6cc862f2d696b267b478268d
3
+ metadata.gz: c266a1ed9b7d5a3b2f1594b0aa4a14e98faafd87
4
+ data.tar.gz: ed1b9717bc85dbf71f9adf5d17b389e2a1b26a78
5
5
  SHA512:
6
- metadata.gz: 3c31dd8dadfea502f17759e37228e920e773d7a7584d84cbc2c58ea5752ea9fd6bfd9ee2499866756feea1a6297d203c13384dee10d7a6b74aaa7a44a5309f82
7
- data.tar.gz: 6e23a458c04035355e4e62c78992e125f17f39a9d1a5d24f26326cdb906ab1477263619b8f6fd88927b27490bba13d205af9384466bdc644f24116141f5dbba9
6
+ metadata.gz: cc5fe621e481c9aeae16e3bca40ca475a1c6d3f708c5c4ee4bf225d783e581f7a10b6f235dcf490b6d853174f2a605c1d2da9b9ef65505c0dbf0c807babb2926
7
+ data.tar.gz: 2db3a96f254bd5bda9ebfd4f6900643de49e9a921e87be4cb4410c96184a20f35d7ac907441dfb2960bf73eb0093594e5345f884f9be249e38b8cd9b29a282b7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gem-release (2.0.0.dev.1)
4
+ gem-release (2.0.0.dev.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -182,13 +182,17 @@ gem_name - name of the gem (optional, will use the directory name, or all gemspe
182
182
  ### Options
183
183
 
184
184
  ```
185
- -c, --[no-]commit Perform a commit after incrementing gem version
185
+ -v, --version VERSION Target version: next [major|minor|patch|pre|release] or a given version number [x.x.x]
186
+ -c, --[no-]commit Create a commit after incrementing gem version
187
+ -m, --message Commit message template
188
+ --skip-ci Add the [skip ci] tag to the commit message
186
189
  -p, --[no-]push Push the new commit to the git remote repository
187
190
  --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]
191
+ -s, --sign GPG sign the commit message
189
192
  -t, --tag Shortcut for running the `gem tag` command
190
193
  -r, --release Shortcut for the `gem release` command
191
194
  --recurse Recurse into directories that contain gemspec files
195
+ --file Full path to the version file
192
196
  --pretend
193
197
  ```
194
198
 
@@ -334,11 +338,11 @@ version is `1.0.0`, then The tag is created using the command `git tag
334
338
  ### Setup
335
339
 
336
340
  ```
337
- export GEM_RELEASE_PUSH=false
338
341
  cd /tmp
339
342
  rm -rf foo
340
343
  gem bootstrap foo
341
- tree
344
+ cd foo
345
+ tree -a -I .git
342
346
  ```
343
347
 
344
348
  ### Directory structure
@@ -358,26 +362,28 @@ tree
358
362
 
359
363
  ```
360
364
  # this bumps foo
361
- cd /tmp/foo
362
- gem bump
365
+ cd /tmp/foo; gem bump
363
366
 
364
367
  # this also bumps foo
365
- cd /tmp/foo
366
- gem bump foo
368
+ cd /tmp/foo; gem bump foo
367
369
  ```
368
370
 
371
+ ### Demo
372
+
373
+ ![gem-release-scenario-1](https://cloud.githubusercontent.com/assets/2208/25634572/68d1fd20-2f7b-11e7-83bc-9e11f60438f3.gif)
374
+
375
+
369
376
  ## Scenario 2: Multiple gems in root
370
377
 
371
378
  ### Setup
372
379
 
373
380
  ```
374
- export GEM_RELEASE_PUSH=false
375
381
  cd /tmp
376
- rm -rf foo
382
+ rm -rf foo bar
377
383
  gem bootstrap foo
378
384
  cd foo
379
385
  gem bootstrap bar --dir .
380
- tree
386
+ tree -a -I .git
381
387
  ```
382
388
 
383
389
  ### Directory structure
@@ -401,39 +407,37 @@ tree
401
407
 
402
408
  ```
403
409
  # this bumps both foo and bar
404
- cd /tmp/foo
405
- gem bump --recurse
410
+ cd /tmp/foo; gem bump --recurse
406
411
 
407
412
  # this also bumps both foo and bar
408
- cd /tmp/foo
409
- gem bump foo bar
413
+ cd /tmp/foo; gem bump foo bar
410
414
 
411
415
  # this bumps foo (because it's the first gemspec found)
412
- cd /tmp/foo
413
- gem bump
416
+ cd /tmp/foo; gem bump
414
417
 
415
418
  # this bumps foo
416
- cd /tmp/foo
417
- gem bump foo
419
+ cd /tmp/foo; gem bump foo
418
420
 
419
421
  # this bumps bar
420
- cd /tmp/foo
421
- gem bump bar
422
+ cd /tmp/foo; gem bump bar
422
423
  ```
423
424
 
425
+ ### Demo
426
+
427
+ ![gem-release-scenario-2](https://cloud.githubusercontent.com/assets/2208/25634575/68dcb670-2f7b-11e7-991e-901283164d21.gif)
428
+
424
429
  ## Scenario 3: Multiple gems in sub directories
425
430
 
426
431
  ### Setup
427
432
 
428
433
  ```
429
- export GEM_RELEASE_PUSH=false
430
434
  cd /tmp
431
435
  rm -rf root
432
436
  mkdir root
433
437
  cd root
434
438
  gem bootstrap foo
435
439
  gem bootstrap bar
436
- tree
440
+ tree -a -I .git
437
441
  ```
438
442
 
439
443
  ### Directory structure
@@ -462,32 +466,31 @@ tree
462
466
 
463
467
  ```
464
468
  # this bumps both foo and bar
465
- cd /tmp/root
466
- gem bump --recurse
469
+ cd /tmp/root; gem bump --recurse
467
470
 
468
471
  # this also bumps both foo and bar
469
- cd /tmp/root
470
- gem bump foo bar
472
+ cd /tmp/root; gem bump foo bar
471
473
 
472
474
  # this does bumps both foo and bar
473
- cd /tmp/root
474
- gem bump
475
+ cd /tmp/root; gem bump
475
476
 
476
477
  # this bumps foo
477
- cd /tmp/root
478
- gem bump foo
478
+ cd /tmp/root; gem bump foo
479
479
 
480
480
  # this bumps bar
481
- cd /tmp/root
482
- gem bump bar
481
+ cd /tmp/root; gem bump bar
483
482
  ```
484
483
 
484
+ ### Demo
485
+
486
+ ![gem-release-scenario-3](https://cloud.githubusercontent.com/assets/2208/25634573/68d51c3a-2f7b-11e7-8ec8-629bc8019d16.gif)
487
+
488
+
485
489
  ## Scenario 4: Nested gem with a conventional sub directory name
486
490
 
487
491
  ### Setup
488
492
 
489
493
  ```
490
- export GEM_RELEASE_PUSH=false
491
494
  cd /tmp
492
495
  rm -rf sinja
493
496
  gem bootstrap sinja
@@ -496,7 +499,7 @@ mkdir extensions
496
499
  cd extensions
497
500
  gem bootstrap sinja-sequel
498
501
  cd /tmp/sinja
499
- tree
502
+ tree -a -I .git
500
503
  ```
501
504
 
502
505
  ### Directory structure
@@ -526,36 +529,33 @@ tree
526
529
 
527
530
  ```
528
531
  # this bumps both sinja and sinja-sequel
529
- cd /tmp/sinja
530
- gem bump --recurse
532
+ cd /tmp/sinja; gem bump --recurse
531
533
 
532
534
  # this bumps sinja
533
- cd /tmp/sinja
534
- gem bump
535
+ cd /tmp/sinja; gem bump
535
536
 
536
537
  # this also bumps sinja
537
- cd /tmp/sinja
538
- gem bump sinja
538
+ cd /tmp/sinja; gem bump sinja
539
539
 
540
540
  # this bumps sinja-sequel
541
- cd /tmp/sinja
542
- gem bump sinja-sequel
541
+ cd /tmp/sinja; gem bump sinja-sequel
543
542
 
544
543
  # this also bumps sinja-sequel
545
- cd /tmp/sinja/extensions/sinja-sequel
546
- gem bump
544
+ cd /tmp/sinja/extensions/sinja-sequel; gem bump
547
545
 
548
546
  # this also bumps sinja-sequel
549
- cd /tmp/sinja/extensions/sinja-sequel
550
- gem bump sinja-sequel
547
+ cd /tmp/sinja/extensions/sinja-sequel; gem bump sinja-sequel
551
548
  ```
552
549
 
550
+ ### Demo
551
+
552
+ ![gem-release-scenario-4](https://cloud.githubusercontent.com/assets/2208/25634576/68dce4a6-2f7b-11e7-9d6b-571d672e4998.gif)
553
+
553
554
  ## Scenario 5: Nested gem with an irregular sub directory name
554
555
 
555
556
  ### Setup
556
557
 
557
558
  ```
558
- export GEM_RELEASE_PUSH=false
559
559
  cd /tmp
560
560
  rm -rf sinja
561
561
  gem bootstrap sinja
@@ -565,7 +565,7 @@ cd extensions
565
565
  gem bootstrap sinja-sequel
566
566
  mv sinja-sequel sequel
567
567
  cd /tmp/sinja
568
- tree
568
+ tree -a -I .git
569
569
  ```
570
570
 
571
571
  ### Directory structure
@@ -595,30 +595,28 @@ tree
595
595
 
596
596
  ```
597
597
  # this bumps both sinja and sinja-sequel
598
- cd /tmp/sinja
599
- gem bump --recurse
598
+ cd /tmp/sinja; gem bump --recurse
600
599
 
601
600
  # this bumps sinja
602
- cd /tmp/sinja
603
- gem bump
601
+ cd /tmp/sinja; gem bump
604
602
 
605
603
  # this also bumps sinja
606
- cd /tmp/sinja
607
- gem bump sinja
604
+ cd /tmp/sinja; gem bump sinja
608
605
 
609
606
  # this bumps sinja-sequel only
610
- cd /tmp/sinja
611
- gem bump sinja-sequel
607
+ cd /tmp/sinja; gem bump sinja-sequel
612
608
 
613
609
  # this also bumps sinja-sequel only
614
- cd /tmp/sinja/extensions/sequel
615
- gem bump
610
+ cd /tmp/sinja/extensions/sequel; gem bump
616
611
 
617
612
  # this also bumps sinja-sequel only
618
- cd /tmp/sinja/extensions/sequel
619
- gem bump sinja-sequel
613
+ cd /tmp/sinja/extensions/sequel; gem bump sinja-sequel
620
614
  ```
621
615
 
616
+ ### Demo
617
+
618
+ ![gem-release-scenario-5](https://cloud.githubusercontent.com/assets/2208/25634574/68d6d138-2f7b-11e7-9e64-e4c86cb85b9a.gif)
619
+
622
620
 
623
621
  # Development
624
622
 
@@ -95,11 +95,11 @@ module Gem
95
95
  end
96
96
 
97
97
  opt '--rspec', DESCR[:rspec] do |value|
98
- (opts[:templates] ||= []) << value
98
+ (opts[:templates] ||= []) << :rspec
99
99
  end
100
100
 
101
101
  opt '--travis', DESCR[:travis] do |value|
102
- (opts[:templates] ||= []) << value
102
+ (opts[:templates] ||= []) << :travis
103
103
  end
104
104
 
105
105
  opt '-l', '--no-license NAME', DESCR[:license] do |value|
@@ -45,6 +45,7 @@ module Gem
45
45
  version: 'Target version: next [major|minor|patch|pre|release] or a given version number [x.x.x]',
46
46
  commit: 'Create a commit after incrementing gem version',
47
47
  message: 'Commit message template',
48
+ skip_ci: 'Add the [skip ci] tag to the commit message',
48
49
  push: 'Push the new commit to the git remote repository',
49
50
  remote: 'Git remote to push to (defaults to origin)',
50
51
  sign: 'GPG sign the commit message',
@@ -56,7 +57,7 @@ module Gem
56
57
 
57
58
  DEFAULTS = {
58
59
  commit: true,
59
- message: 'Bump to %{to} [skip ci]',
60
+ message: 'Bump to %{to} %{skip_ci}',
60
61
  push: false,
61
62
  remote: 'origin'
62
63
  }
@@ -65,12 +66,16 @@ module Gem
65
66
  opts[:version] = value
66
67
  end
67
68
 
69
+ opt '-c', '--[no-]commit', DESCR[:commit] do |value|
70
+ opts[:commit] = value
71
+ end
72
+
68
73
  opt '-m', '--message', DESCR[:message] do |value|
69
74
  opts[:message] = value
70
75
  end
71
76
 
72
- opt '-c', '--[no-]commit', DESCR[:commit] do |value|
73
- opts[:commit] = value
77
+ opt '--skip-ci', DESCR[:skip_ci] do |value|
78
+ opts[:skip_ci] = value
74
79
  end
75
80
 
76
81
  opt '-p', '--[no-]push', DESCR[:push] do |value|
@@ -147,7 +152,7 @@ module Gem
147
152
 
148
153
  def commit
149
154
  cmd :git_add, version.path
150
- cmd :git_commit, message, opts[:sign] ? '-S' : ''
155
+ cmd :git_commit, message.strip, opts[:sign] ? '-S' : ''
151
156
  end
152
157
 
153
158
  def push
@@ -167,7 +172,9 @@ module Gem
167
172
  end
168
173
 
169
174
  def message
170
- opts[:message] % version.to_h
175
+ args = version.to_h
176
+ args = args.merge(skip_ci: opts[:skip_ci] ? '[skip ci]' : '')
177
+ opts[:message] % args
171
178
  end
172
179
 
173
180
  def version
@@ -28,7 +28,7 @@ module Gem
28
28
  end
29
29
 
30
30
  def success
31
- context.announce "All is good, thanks my friend." unless quiet?
31
+ context.success "All is good, thanks my friend." unless quiet?
32
32
  end
33
33
 
34
34
  def quiet?
@@ -46,6 +46,11 @@ module Gem
46
46
  puts colored(:red, with_spacing(str, true))
47
47
  end
48
48
 
49
+ def success(str)
50
+ announce(str)
51
+ puts
52
+ end
53
+
49
54
  def abort(str)
50
55
  error(str)
51
56
  exit 1
@@ -66,7 +71,7 @@ module Gem
66
71
  end
67
72
 
68
73
  def with_spacing(str, space)
69
- space = false if self.class.last.nil?
74
+ # space = false if self.class.last.nil?
70
75
  str = "\n#{str}" if space && !self.class.last
71
76
  self.class.last = space
72
77
  str
@@ -58,13 +58,6 @@ module Gem
58
58
  abort
59
59
  end
60
60
 
61
- def show_help
62
- p "KEKSE"
63
- exit
64
- parser.program_name = usage
65
- say parser
66
- end
67
-
68
61
  def cmd
69
62
  self.class.cmd
70
63
  end
@@ -1,5 +1,5 @@
1
1
  module Gem
2
2
  module Release
3
- VERSION = '2.0.0.dev.3'
3
+ VERSION = '2.0.0.dev.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.dev.3
4
+ version: 2.0.0.dev.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs