gemcutter 0.3.0.pre → 0.3.0
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/Rakefile +1 -1
- data/lib/commands/webhook.rb +4 -6
- data/test/push_command_test.rb +10 -10
- data/test/webhook_command_test.rb +0 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ begin
|
|
13
13
|
require 'jeweler'
|
14
14
|
Jeweler::Tasks.new do |gem|
|
15
15
|
gem.name = "gemcutter"
|
16
|
-
gem.version = "0.3.0
|
16
|
+
gem.version = "0.3.0"
|
17
17
|
gem.summary = "Commands to interact with gemcutter.org"
|
18
18
|
gem.description = "Adds several commands to RubyGems for managing gems and more on Gemcutter.org."
|
19
19
|
gem.email = "nick@quaran.to"
|
data/lib/commands/webhook.rb
CHANGED
@@ -2,12 +2,10 @@ class Gem::Commands::WebhookCommand < Gem::AbstractCommand
|
|
2
2
|
|
3
3
|
def description
|
4
4
|
<<-EOF
|
5
|
-
Register a webhook that will be called any time a gem is updated on Gemcutter.
|
6
|
-
|
7
5
|
Webhooks can be created for either specific gems or all gems. In both cases
|
8
6
|
you'll get a POST request of the gem in JSON format at the URL you specify in
|
9
|
-
the command. You can also use this command to test fire a webhook.
|
10
|
-
|
7
|
+
the command. You can also use this command to test fire a webhook for any gem.
|
8
|
+
EOF
|
11
9
|
end
|
12
10
|
|
13
11
|
def arguments
|
@@ -15,11 +13,11 @@ the command. You can also use this command to test fire a webhook.
|
|
15
13
|
end
|
16
14
|
|
17
15
|
def usage
|
18
|
-
"#{program_name} GEM_NAME"
|
16
|
+
"#{program_name} [GEM_NAME]"
|
19
17
|
end
|
20
18
|
|
21
19
|
def initialize
|
22
|
-
super 'webhook',
|
20
|
+
super 'webhook', "Register a webhook that will be called any time a gem is updated on Gemcutter."
|
23
21
|
option_text = "The URL of the webhook to"
|
24
22
|
|
25
23
|
add_option('-a', '--add URL', "#{option_text} add") do |value, options|
|
data/test/push_command_test.rb
CHANGED
@@ -31,8 +31,8 @@ class PushCommandTest < CommandTest
|
|
31
31
|
stub(@command).options { {:args => [@gem_path]} }
|
32
32
|
stub(Gem).read_binary(@gem_path) { @gem_binary }
|
33
33
|
stub_config({ :rubygems_api_key => "key" })
|
34
|
-
|
35
|
-
|
34
|
+
stub_request(:post, @url).to_return(:body => "Success!")
|
35
|
+
|
36
36
|
@command.send_gem
|
37
37
|
end
|
38
38
|
|
@@ -43,14 +43,14 @@ class PushCommandTest < CommandTest
|
|
43
43
|
|
44
44
|
should "post to api" do
|
45
45
|
# webmock doesn't pass body params on correctly :[
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
46
|
+
assert_requested(:post, @url,
|
47
|
+
:times => 1)
|
48
|
+
assert_requested(:post, @url,
|
49
|
+
:headers => {'Authorization' => 'key' })
|
50
|
+
assert_requested(:post, @url,
|
51
|
+
:headers => {'Content-Length' => @gem_binary.size})
|
52
|
+
assert_requested(:post, @url,
|
53
|
+
:headers => {'Content-Type' => 'application/octet-stream'})
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemcutter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Quaranto
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-05 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|