ggem 1.8.0 → 1.8.1
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/ggem.gemspec +2 -2
- data/lib/ggem/cli/commands.rb +31 -3
- data/lib/ggem/template_file/gemspec.erb +1 -1
- data/lib/ggem/template_file/test_helper.rb.erb +9 -0
- data/lib/ggem/version.rb +1 -1
- data/test/helper.rb +9 -0
- data/test/support/cmd_tests_helpers.rb +1 -1
- data/test/unit/cli_tests.rb +51 -11
- data/test/unit/gem_tests.rb +1 -1
- data/test/unit/gemspec_tests.rb +1 -1
- metadata +13 -14
- data/Rakefile +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78af14258ae315c8ee616b840770779d1084d591
|
4
|
+
data.tar.gz: 227aff8e65f1aca57f6a9b18e30fd67da6c967f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9652f4d234a556ce6259f83aad0208b1b6ab175ef07b1a426408873ec01d669c55463daf7e91e8d50d840ad0fcc552eafe5934489a2db1320e3af518975d6ff9
|
7
|
+
data.tar.gz: adbb62ae9184ec3ddf508b7a80a6633154de627c41ed60b212567ab026d28642ed6a8827a9ecff82995466e6fc32fb6077711b7a0fec070df65ac168d1fd2d24
|
data/Gemfile
CHANGED
data/ggem.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = GGem::VERSION
|
9
9
|
gem.authors = ["Kelly Redding", "Collin Redding"]
|
10
10
|
gem.email = ["kelly@kellyredding.com", "collin.redding@me.com"]
|
11
|
-
gem.description = %q{"Juh Gem", baby! (a gem utility CLI)}
|
12
11
|
gem.summary = %q{"Juh Gem", baby! (a gem utility CLI)}
|
12
|
+
gem.description = %q{"Juh Gem", baby! (a gem utility CLI)}
|
13
13
|
gem.homepage = "http://github.com/redding/ggem"
|
14
14
|
gem.license = 'MIT'
|
15
15
|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_development_dependency("assert", ["~> 2.
|
21
|
+
gem.add_development_dependency("assert", ["~> 2.16.1"])
|
22
22
|
|
23
23
|
gem.add_dependency("much-plugin", ["~> 0.1.0"])
|
24
24
|
gem.add_dependency("scmd", ["~> 3.0.1"])
|
data/lib/ggem/cli/commands.rb
CHANGED
@@ -42,8 +42,8 @@ class GGem::CLI
|
|
42
42
|
|
43
43
|
module InstanceMethods
|
44
44
|
|
45
|
-
def initialize
|
46
|
-
@clirb
|
45
|
+
def initialize(&clirb_build)
|
46
|
+
@clirb = CLIRB.new(&clirb_build)
|
47
47
|
end
|
48
48
|
|
49
49
|
def clirb; @clirb; end
|
@@ -275,9 +275,32 @@ class GGem::CLI
|
|
275
275
|
|
276
276
|
end
|
277
277
|
|
278
|
+
module ForceTagOptionCommand
|
279
|
+
include MuchPlugin
|
280
|
+
|
281
|
+
plugin_included do
|
282
|
+
include ValidCommand
|
283
|
+
include InstanceMethods
|
284
|
+
end
|
285
|
+
|
286
|
+
module InstanceMethods
|
287
|
+
|
288
|
+
def initialize
|
289
|
+
super do
|
290
|
+
option 'force-tag', 'force tagging even with uncommitted files', {
|
291
|
+
:abbrev => 'f'
|
292
|
+
}
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
end
|
297
|
+
|
298
|
+
end
|
299
|
+
|
278
300
|
class TagCommand
|
279
301
|
include GitRepoCommand
|
280
302
|
include GemspecCommand
|
303
|
+
include ForceTagOptionCommand
|
281
304
|
|
282
305
|
def run(argv, *args)
|
283
306
|
super
|
@@ -287,7 +310,11 @@ class GGem::CLI
|
|
287
310
|
cmd{ @repo.run_validate_committed_cmd }
|
288
311
|
rescue GGem::GitRepo::CmdError => err
|
289
312
|
@stderr.puts "There are files that need to be committed first."
|
290
|
-
|
313
|
+
if self.clirb.opts['force-tag']
|
314
|
+
@stderr.puts "Forcing tag anyway..."
|
315
|
+
else
|
316
|
+
raise CommandExitError
|
317
|
+
end
|
291
318
|
end
|
292
319
|
|
293
320
|
cmd{ @repo.run_add_version_tag_cmd(@spec.version, @spec.version_tag) }
|
@@ -322,6 +349,7 @@ class GGem::CLI
|
|
322
349
|
|
323
350
|
class ReleaseCommand
|
324
351
|
include GemspecCommand
|
352
|
+
include ForceTagOptionCommand
|
325
353
|
|
326
354
|
def initialize(*args)
|
327
355
|
super
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_development_dependency("assert", ["~> 2.
|
21
|
+
gem.add_development_dependency("assert", ["~> 2.16.1"])
|
22
22
|
# TODO: gem.add_dependency("gem-name", ["~> 0.0.0"])
|
23
23
|
|
24
24
|
end
|
@@ -9,4 +9,13 @@ require 'pry'
|
|
9
9
|
|
10
10
|
require 'test/support/factory'
|
11
11
|
|
12
|
+
# 1.8.7 backfills
|
13
|
+
|
14
|
+
# Array#sample
|
15
|
+
if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
|
16
|
+
class Array
|
17
|
+
alias_method :sample, :choice
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
12
21
|
# TODO: put test helpers here...
|
data/lib/ggem/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -12,3 +12,12 @@ TEST_SUPPORT_PATH = ROOT_PATH.join('test/support')
|
|
12
12
|
require 'pry'
|
13
13
|
|
14
14
|
require 'test/support/factory'
|
15
|
+
|
16
|
+
# 1.8.7 backfills
|
17
|
+
|
18
|
+
# Array#sample
|
19
|
+
if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
|
20
|
+
class Array
|
21
|
+
alias_method :sample, :choice
|
22
|
+
end
|
23
|
+
end
|
data/test/unit/cli_tests.rb
CHANGED
@@ -231,7 +231,7 @@ class GGem::CLI
|
|
231
231
|
end
|
232
232
|
|
233
233
|
should "raise a help exit if its name is empty" do
|
234
|
-
cmd = @command_class.new([nil, ''].
|
234
|
+
cmd = @command_class.new([nil, ''].sample)
|
235
235
|
argv = [Factory.string, Factory.string]
|
236
236
|
assert_raises(CLIRB::HelpExit){ cmd.new.run(argv) }
|
237
237
|
end
|
@@ -277,6 +277,14 @@ class GGem::CLI
|
|
277
277
|
assert_equal argv, subject.clirb.args
|
278
278
|
end
|
279
279
|
|
280
|
+
should "take custom CLIRB build procs" do
|
281
|
+
cmd = @command_class.new do
|
282
|
+
option 'test', 'testing', :abbrev => 't'
|
283
|
+
end
|
284
|
+
cmd.run(['-t'], @stdout, @stderr)
|
285
|
+
assert_true cmd.clirb.opts['test']
|
286
|
+
end
|
287
|
+
|
280
288
|
should "default its summary" do
|
281
289
|
assert_equal '', subject.summary
|
282
290
|
end
|
@@ -485,7 +493,7 @@ class GGem::CLI
|
|
485
493
|
end
|
486
494
|
|
487
495
|
should "call the spec's run build cmd when run" do
|
488
|
-
ENV['DEBUG'] = [nil, '1'].
|
496
|
+
ENV['DEBUG'] = [nil, '1'].sample
|
489
497
|
subject.run([], @stdout, @stderr)
|
490
498
|
|
491
499
|
assert_true @spec_spy.run_build_cmd_called
|
@@ -542,7 +550,7 @@ class GGem::CLI
|
|
542
550
|
end
|
543
551
|
|
544
552
|
should "run the build command and call the spec's run install cmds when run" do
|
545
|
-
ENV['DEBUG'] = [nil, '1'].
|
553
|
+
ENV['DEBUG'] = [nil, '1'].sample
|
546
554
|
subject.run(@argv, @stdout, @stderr)
|
547
555
|
|
548
556
|
assert_true @build_spy.run_called
|
@@ -601,7 +609,7 @@ class GGem::CLI
|
|
601
609
|
end
|
602
610
|
|
603
611
|
should "run the build command and call the spec's run push cmds when run" do
|
604
|
-
ENV['DEBUG'] = [nil, '1'].
|
612
|
+
ENV['DEBUG'] = [nil, '1'].sample
|
605
613
|
subject.run(@argv, @stdout, @stderr)
|
606
614
|
|
607
615
|
assert_true @build_spy.run_called
|
@@ -626,6 +634,24 @@ class GGem::CLI
|
|
626
634
|
|
627
635
|
end
|
628
636
|
|
637
|
+
class ForceTagOptionCommandTests < IOCommandTests
|
638
|
+
desc "ForceTagOptionCommand"
|
639
|
+
setup do
|
640
|
+
@command_class = Class.new{ include ForceTagOptionCommand }
|
641
|
+
@cmd = @command_class.new
|
642
|
+
end
|
643
|
+
|
644
|
+
should "be a valid command" do
|
645
|
+
assert_kind_of ValidCommand, subject
|
646
|
+
end
|
647
|
+
|
648
|
+
should "add a force-tag CLIRB option" do
|
649
|
+
subject.run(['-f'], @stdout, @stderr)
|
650
|
+
assert_true subject.clirb.opts['force-tag']
|
651
|
+
end
|
652
|
+
|
653
|
+
end
|
654
|
+
|
629
655
|
class TagCommandTests < IOCommandTests
|
630
656
|
include GitRepoSpyTests
|
631
657
|
include GemspecSpyTests
|
@@ -636,8 +662,10 @@ class GGem::CLI
|
|
636
662
|
@cmd = @command_class.new
|
637
663
|
end
|
638
664
|
|
639
|
-
should "be a gemspec command" do
|
665
|
+
should "be a git repo, gemspec, force tag option command" do
|
666
|
+
assert_kind_of GitRepoCommand, subject
|
640
667
|
assert_kind_of GemspecCommand, subject
|
668
|
+
assert_kind_of ForceTagOptionCommand, subject
|
641
669
|
end
|
642
670
|
|
643
671
|
should "know its summary" do
|
@@ -654,7 +682,7 @@ class GGem::CLI
|
|
654
682
|
end
|
655
683
|
|
656
684
|
should "call the repo's run build/push cmds when run" do
|
657
|
-
ENV['DEBUG'] = [nil, '1'].
|
685
|
+
ENV['DEBUG'] = [nil, '1'].sample
|
658
686
|
subject.run([], @stdout, @stderr)
|
659
687
|
|
660
688
|
assert_true @repo_spy.run_validate_clean_cmd_called
|
@@ -683,7 +711,7 @@ class GGem::CLI
|
|
683
711
|
|
684
712
|
should "handle validation cmd errors when run" do
|
685
713
|
err_msg = Factory.string
|
686
|
-
err_on = [:run_validate_clean_cmd, :run_validate_committed_cmd].
|
714
|
+
err_on = [:run_validate_clean_cmd, :run_validate_committed_cmd].sample
|
687
715
|
Assert.stub(@repo_spy, err_on){ raise GGem::GitRepo::CmdError, err_msg }
|
688
716
|
|
689
717
|
assert_raises(CommandExitError){ subject.run([], @stdout, @stderr) }
|
@@ -691,9 +719,20 @@ class GGem::CLI
|
|
691
719
|
assert_equal exp, @stderr.read
|
692
720
|
end
|
693
721
|
|
722
|
+
should "ignore validation cmd errors when run with the force-tag option" do
|
723
|
+
err_msg = Factory.string
|
724
|
+
err_on = [:run_validate_clean_cmd, :run_validate_committed_cmd].sample
|
725
|
+
Assert.stub(@repo_spy, err_on){ raise GGem::GitRepo::CmdError, err_msg }
|
726
|
+
|
727
|
+
subject.run(['-f'], @stdout, @stderr)
|
728
|
+
exp = "There are files that need to be committed first.\n" \
|
729
|
+
"Forcing tag anyway...\n"
|
730
|
+
assert_equal exp, @stderr.read
|
731
|
+
end
|
732
|
+
|
694
733
|
should "handle non-validation cmd errors when run" do
|
695
734
|
err_msg = Factory.string
|
696
|
-
err_on = [:run_add_version_tag_cmd, :run_push_cmd].
|
735
|
+
err_on = [:run_add_version_tag_cmd, :run_push_cmd].sample
|
697
736
|
Assert.stub(@repo_spy, err_on){ raise GGem::GitRepo::CmdError, err_msg }
|
698
737
|
|
699
738
|
assert_raises(CommandExitError){ subject.run([], @stdout, @stderr) }
|
@@ -738,8 +777,9 @@ class GGem::CLI
|
|
738
777
|
@cmd = @command_class.new
|
739
778
|
end
|
740
779
|
|
741
|
-
should "be a gemspec command" do
|
780
|
+
should "be a gemspec, force tag option command" do
|
742
781
|
assert_kind_of GemspecCommand, subject
|
782
|
+
assert_kind_of ForceTagOptionCommand, subject
|
743
783
|
end
|
744
784
|
|
745
785
|
should "know its summary" do
|
@@ -802,14 +842,14 @@ class GGem::CLI
|
|
802
842
|
exp_strs << "add1 # #{subject['add1'].summary}"
|
803
843
|
|
804
844
|
@cmd_spy = CommandSpy.new
|
805
|
-
Assert.stub(@cmd_spy, :summary){ [nil, ''].
|
845
|
+
Assert.stub(@cmd_spy, :summary){ [nil, ''].sample }
|
806
846
|
Assert.stub(CommandSpy, :new){ @cmd_spy }
|
807
847
|
|
808
848
|
subject.add(CommandSpy, 'add2', 'add')
|
809
849
|
exp_strs << "add2 (add) "
|
810
850
|
|
811
851
|
subject.add(CommandSpy, 'add3')
|
812
|
-
Assert.stub(subject['add3'], :summary){ [nil, ''].
|
852
|
+
Assert.stub(subject['add3'], :summary){ [nil, ''].sample }
|
813
853
|
exp_strs << "add3 "
|
814
854
|
|
815
855
|
assert_equal exp_strs.join("\n"), subject.to_s
|
data/test/unit/gem_tests.rb
CHANGED
data/test/unit/gemspec_tests.rb
CHANGED
@@ -71,7 +71,7 @@ class GGem::Gemspec
|
|
71
71
|
# prefer the env push hosts over configured and default hosts
|
72
72
|
prev_env_push_host = ENV['GGEM_PUSH_HOST']
|
73
73
|
ENV['GGEM_PUSH_HOST'] = Factory.string
|
74
|
-
spec = @gemspec_class.new(TEST_SUPPORT_PATH.join(['gem1', 'gem2'].
|
74
|
+
spec = @gemspec_class.new(TEST_SUPPORT_PATH.join(['gem1', 'gem2'].sample))
|
75
75
|
assert_equal ENV['GGEM_PUSH_HOST'], spec.push_host
|
76
76
|
ENV['GGEM_PUSH_HOST'] = prev_env_push_host
|
77
77
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ggem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,38 +10,38 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2016-01
|
13
|
+
date: 2016-06-01 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
|
16
|
+
prerelease: false
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
18
|
requirements:
|
18
19
|
- - ~>
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.
|
21
|
+
version: 2.16.1
|
21
22
|
type: :development
|
22
|
-
requirement: *id001
|
23
23
|
name: assert
|
24
|
-
|
24
|
+
version_requirements: *id001
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
|
26
|
+
prerelease: false
|
27
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
27
28
|
requirements:
|
28
29
|
- - ~>
|
29
30
|
- !ruby/object:Gem::Version
|
30
31
|
version: 0.1.0
|
31
32
|
type: :runtime
|
32
|
-
requirement: *id002
|
33
33
|
name: much-plugin
|
34
|
-
|
34
|
+
version_requirements: *id002
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
39
|
- - ~>
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: 3.0.1
|
41
42
|
type: :runtime
|
42
|
-
requirement: *id003
|
43
43
|
name: scmd
|
44
|
-
|
44
|
+
version_requirements: *id003
|
45
45
|
description: "\"Juh Gem\", baby! (a gem utility CLI)"
|
46
46
|
email:
|
47
47
|
- kelly@kellyredding.com
|
@@ -57,7 +57,6 @@ files:
|
|
57
57
|
- Gemfile
|
58
58
|
- LICENSE
|
59
59
|
- README.md
|
60
|
-
- Rakefile
|
61
60
|
- bin/ggem
|
62
61
|
- ggem.gemspec
|
63
62
|
- lib/ggem.rb
|
@@ -111,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
110
|
requirements: []
|
112
111
|
|
113
112
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.6.4
|
115
114
|
signing_key:
|
116
115
|
specification_version: 4
|
117
116
|
summary: "\"Juh Gem\", baby! (a gem utility CLI)"
|
data/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|