gem_publisher 1.4.1 → 1.4.2
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.
- data/lib/gem_publisher/version.rb +1 -1
- data/lib/rubygems_plugin.rb +1 -1
- data/test/rubygems_plugin_test.rb +52 -0
- metadata +5 -4
data/lib/rubygems_plugin.rb
CHANGED
|
@@ -9,7 +9,7 @@ class Gem::Commands::PublishCommand < Gem::Command
|
|
|
9
9
|
defaults.merge! :gem_repository => "rubygems"
|
|
10
10
|
|
|
11
11
|
add_option(
|
|
12
|
-
"-
|
|
12
|
+
"-rREPOSITORY", "--repository=REPOSITORY",
|
|
13
13
|
"Set the gem repository (rubygems or gemfury)",
|
|
14
14
|
"Default: #{options[:gem_repository]}") do |value, options|
|
|
15
15
|
options[:gem_repository] = value
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require File.expand_path("../common", __FILE__)
|
|
2
|
+
require "rubygems_plugin"
|
|
3
|
+
require "rubygems/test_case"
|
|
4
|
+
|
|
5
|
+
module GemPublisher
|
|
6
|
+
class PublishCommandTest < Gem::TestCase
|
|
7
|
+
def setup
|
|
8
|
+
super
|
|
9
|
+
@command = Gem::Commands::PublishCommand.new
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def test_should_report_published_gem
|
|
13
|
+
GemPublisher.expects(:publish_if_updated).
|
|
14
|
+
with("awesome.gemspec", "rubygems").
|
|
15
|
+
returns("awesome-1.0.0.gem")
|
|
16
|
+
$stderr.expects(:puts).with("Published awesome-1.0.0.gem")
|
|
17
|
+
|
|
18
|
+
@command.handle_options ["awesome.gemspec"]
|
|
19
|
+
@command.execute
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def test_should_not_report_unpublished_gem
|
|
23
|
+
GemPublisher.expects(:publish_if_updated).
|
|
24
|
+
with("awesome.gemspec", "rubygems").
|
|
25
|
+
returns(nil)
|
|
26
|
+
$stderr.expects(:puts).with("Nothing to do for awesome.gemspec")
|
|
27
|
+
|
|
28
|
+
@command.handle_options ["awesome.gemspec"]
|
|
29
|
+
@command.execute
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_should_use_gemfury_if_requested
|
|
33
|
+
GemPublisher.expects(:publish_if_updated).
|
|
34
|
+
with("awesome.gemspec", "gemfury").
|
|
35
|
+
returns("awesome-1.0.0.gem")
|
|
36
|
+
$stderr.expects(:puts).with(anything)
|
|
37
|
+
|
|
38
|
+
@command.handle_options ["-r", "gemfury", "awesome.gemspec"]
|
|
39
|
+
@command.execute
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def test_should_use_gemfury_with_long_option
|
|
43
|
+
GemPublisher.expects(:publish_if_updated).
|
|
44
|
+
with("awesome.gemspec", "gemfury").
|
|
45
|
+
returns("awesome-1.0.0.gem")
|
|
46
|
+
$stderr.expects(:puts).with(anything)
|
|
47
|
+
|
|
48
|
+
@command.handle_options ["--repository=gemfury", "awesome.gemspec"]
|
|
49
|
+
@command.execute
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gem_publisher
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-
|
|
12
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mocha
|
|
@@ -73,6 +73,7 @@ files:
|
|
|
73
73
|
- lib/gem_publisher/cli_facade.rb
|
|
74
74
|
- lib/gem_publisher/pusher.rb
|
|
75
75
|
- lib/gem_publisher/publisher.rb
|
|
76
|
+
- test/rubygems_plugin_test.rb
|
|
76
77
|
- test/cli_facade_test.rb
|
|
77
78
|
- test/common.rb
|
|
78
79
|
- test/builder_test.rb
|
|
@@ -98,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
98
99
|
version: '0'
|
|
99
100
|
segments:
|
|
100
101
|
- 0
|
|
101
|
-
hash:
|
|
102
|
+
hash: -1286813029055654775
|
|
102
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
104
|
none: false
|
|
104
105
|
requirements:
|
|
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
107
108
|
version: '0'
|
|
108
109
|
segments:
|
|
109
110
|
- 0
|
|
110
|
-
hash:
|
|
111
|
+
hash: -1286813029055654775
|
|
111
112
|
requirements: []
|
|
112
113
|
rubyforge_project:
|
|
113
114
|
rubygems_version: 1.8.23.2
|