ggem 1.8.1 → 1.8.3
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/lib/ggem/cli/commands.rb +5 -4
- data/lib/ggem/version.rb +1 -1
- data/test/unit/cli_tests.rb +26 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47b788c7af22b10dae04d58149767be30d8ff7fb
|
4
|
+
data.tar.gz: 60b3328e31c1ec8f17622281805a6ca824b0c8e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e18f2ed64b8a280b01106864e3f098e0828f95ac39994d204214a6e161009ce35d875205bb551ef46dcfefc15e6cbdce9bf1b1c92c3821540e68d42fa4deb3b6
|
7
|
+
data.tar.gz: d55e6b25e1bb96baa96eaa08e6d132661f2469804d973af8b9978cfc6998038d2665df5903935e00d865270da3677c76043e498ed68ab1e1ebf91c3cae6458e4
|
data/lib/ggem/cli/commands.rb
CHANGED
@@ -225,7 +225,8 @@ class GGem::CLI
|
|
225
225
|
|
226
226
|
def run(argv, *args)
|
227
227
|
super
|
228
|
-
@build_command.run(
|
228
|
+
@build_command.run([])
|
229
|
+
|
229
230
|
notify("#{@spec.name} #{@spec.version} installed to system gems") do
|
230
231
|
@spec.run_install_cmd
|
231
232
|
end
|
@@ -254,7 +255,7 @@ class GGem::CLI
|
|
254
255
|
|
255
256
|
def run(argv, *args)
|
256
257
|
super
|
257
|
-
@build_command.run(
|
258
|
+
@build_command.run([])
|
258
259
|
|
259
260
|
@stdout.puts "Pushing #{@spec.gem_file_name} to #{@spec.push_host}..."
|
260
261
|
notify("#{@spec.gem_file_name} received.") do
|
@@ -359,8 +360,8 @@ class GGem::CLI
|
|
359
360
|
|
360
361
|
def run(argv, *args)
|
361
362
|
super
|
362
|
-
@tag_command.run(
|
363
|
-
@push_command.run(
|
363
|
+
@tag_command.run(self.clirb.opts['force-tag'] ? ['--force-tag'] : [])
|
364
|
+
@push_command.run([])
|
364
365
|
end
|
365
366
|
|
366
367
|
def summary
|
data/lib/ggem/version.rb
CHANGED
data/test/unit/cli_tests.rb
CHANGED
@@ -252,6 +252,7 @@ class GGem::CLI
|
|
252
252
|
|
253
253
|
class IOCommandTests < UnitTests
|
254
254
|
setup do
|
255
|
+
@argv = [Factory.string]
|
255
256
|
@stdout, @stderr = IOSpy.new, IOSpy.new
|
256
257
|
end
|
257
258
|
subject{ @cmd }
|
@@ -524,7 +525,6 @@ class GGem::CLI
|
|
524
525
|
Assert.stub(BuildCommand, :new){ |*args| @build_spy = CommandSpy.new(*args) }
|
525
526
|
|
526
527
|
@command_class = InstallCommand
|
527
|
-
@argv = []
|
528
528
|
@cmd = @command_class.new
|
529
529
|
end
|
530
530
|
|
@@ -545,7 +545,7 @@ class GGem::CLI
|
|
545
545
|
assert_equal exp, subject.help
|
546
546
|
end
|
547
547
|
|
548
|
-
should "build a build command
|
548
|
+
should "build a build command" do
|
549
549
|
assert @build_spy
|
550
550
|
end
|
551
551
|
|
@@ -554,7 +554,7 @@ class GGem::CLI
|
|
554
554
|
subject.run(@argv, @stdout, @stderr)
|
555
555
|
|
556
556
|
assert_true @build_spy.run_called
|
557
|
-
assert_equal
|
557
|
+
assert_equal [], @build_spy.argv
|
558
558
|
assert_true @spec_spy.run_install_cmd_called
|
559
559
|
|
560
560
|
exp = ENV['DEBUG'] == '1' ? "install\ninstall cmd was run\n" : ''
|
@@ -583,7 +583,6 @@ class GGem::CLI
|
|
583
583
|
Assert.stub(BuildCommand, :new){ |*args| @build_spy = CommandSpy.new(*args) }
|
584
584
|
|
585
585
|
@command_class = PushCommand
|
586
|
-
@argv = []
|
587
586
|
@cmd = @command_class.new
|
588
587
|
end
|
589
588
|
|
@@ -604,7 +603,7 @@ class GGem::CLI
|
|
604
603
|
assert_equal exp, subject.help
|
605
604
|
end
|
606
605
|
|
607
|
-
should "build a build command
|
606
|
+
should "build a build command" do
|
608
607
|
assert @build_spy
|
609
608
|
end
|
610
609
|
|
@@ -613,7 +612,7 @@ class GGem::CLI
|
|
613
612
|
subject.run(@argv, @stdout, @stderr)
|
614
613
|
|
615
614
|
assert_true @build_spy.run_called
|
616
|
-
assert_equal
|
615
|
+
assert_equal [], @build_spy.argv
|
617
616
|
assert_true @spec_spy.run_push_cmd_called
|
618
617
|
|
619
618
|
exp = "Pushing #{@spec_spy.gem_file_name} to #{@spec_spy.push_host}...\n"
|
@@ -663,8 +662,8 @@ class GGem::CLI
|
|
663
662
|
end
|
664
663
|
|
665
664
|
should "be a git repo, gemspec, force tag option command" do
|
666
|
-
assert_kind_of GitRepoCommand,
|
667
|
-
assert_kind_of GemspecCommand,
|
665
|
+
assert_kind_of GitRepoCommand, subject
|
666
|
+
assert_kind_of GemspecCommand, subject
|
668
667
|
assert_kind_of ForceTagOptionCommand, subject
|
669
668
|
end
|
670
669
|
|
@@ -724,7 +723,7 @@ class GGem::CLI
|
|
724
723
|
err_on = [:run_validate_clean_cmd, :run_validate_committed_cmd].sample
|
725
724
|
Assert.stub(@repo_spy, err_on){ raise GGem::GitRepo::CmdError, err_msg }
|
726
725
|
|
727
|
-
subject.run(['-f'], @stdout, @stderr)
|
726
|
+
subject.run([['--force-tag', '-f'].sample], @stdout, @stderr)
|
728
727
|
exp = "There are files that need to be committed first.\n" \
|
729
728
|
"Forcing tag anyway...\n"
|
730
729
|
assert_equal exp, @stderr.read
|
@@ -773,12 +772,11 @@ class GGem::CLI
|
|
773
772
|
Assert.stub(PushCommand, :new){ |*args| @push_spy = CommandSpy.new(*args) }
|
774
773
|
|
775
774
|
@command_class = ReleaseCommand
|
776
|
-
@argv = []
|
777
775
|
@cmd = @command_class.new
|
778
776
|
end
|
779
777
|
|
780
778
|
should "be a gemspec, force tag option command" do
|
781
|
-
assert_kind_of GemspecCommand,
|
779
|
+
assert_kind_of GemspecCommand, subject
|
782
780
|
assert_kind_of ForceTagOptionCommand, subject
|
783
781
|
end
|
784
782
|
|
@@ -797,7 +795,7 @@ class GGem::CLI
|
|
797
795
|
assert_equal exp, subject.help
|
798
796
|
end
|
799
797
|
|
800
|
-
should "build a tag and push command
|
798
|
+
should "build a tag and push command" do
|
801
799
|
[@tag_spy, @push_spy].each do |spy|
|
802
800
|
assert spy
|
803
801
|
end
|
@@ -806,10 +804,22 @@ class GGem::CLI
|
|
806
804
|
should "run the tag and push command when run" do
|
807
805
|
subject.run(@argv, @stdout, @stderr)
|
808
806
|
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
807
|
+
assert_true @tag_spy.run_called
|
808
|
+
assert_equal [], @tag_spy.argv
|
809
|
+
|
810
|
+
assert_true @push_spy.run_called
|
811
|
+
assert_equal [], @push_spy.argv
|
812
|
+
end
|
813
|
+
|
814
|
+
should "pass any force-tag option to the tag cmd but not the release cmd" do
|
815
|
+
force_tag_argv = [['--force-tag', '-f'].sample]
|
816
|
+
subject.run(force_tag_argv, @stdout, @stderr)
|
817
|
+
|
818
|
+
assert_true @tag_spy.run_called
|
819
|
+
assert_equal ['--force-tag'], @tag_spy.argv
|
820
|
+
|
821
|
+
assert_true @push_spy.run_called
|
822
|
+
assert_equal [], @push_spy.argv
|
813
823
|
end
|
814
824
|
|
815
825
|
end
|