keycutter 0.1.1 → 0.2.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/features/add.feature +14 -6
- data/features/default.feature +22 -40
- data/features/list.feature +47 -0
- data/features/remove.feature +4 -5
- data/features/step_definitions/keycutter_steps.rb +26 -19
- data/features/support/hooks.rb +2 -2
- data/lib/keycutter.rb +1 -1
- data/lib/keycutter/configuration.rb +13 -9
- data/lib/keycutter/testing.rb +5 -5
- data/lib/keycutter/version.rb +1 -1
- data/lib/rubygems/commands/keys_command.rb +42 -24
- data/spec/configuration_spec.rb +15 -12
- metadata +7 -14
- data/features/support/fakeweb.rb +0 -8
- data/features/use.feature +0 -29
data/features/add.feature
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
@fakeweb
|
2
|
-
|
3
1
|
Feature: Adding keys
|
4
2
|
As a developer
|
5
3
|
I want to add an API key
|
@@ -10,9 +8,9 @@ Feature: Adding keys
|
|
10
8
|
When I run "gem keys <command> <key>" interactively
|
11
9
|
And I type "josh@vitamin-j.com"
|
12
10
|
And I type "12345"
|
13
|
-
Then the output should contain "Added <key>
|
14
|
-
And I should have a "<key>"
|
15
|
-
And the "<key>"
|
11
|
+
Then the output should contain "Added <key> API key"
|
12
|
+
And I should have a "<key>" api key
|
13
|
+
And the "<key>" api key should be the response body
|
16
14
|
|
17
15
|
Examples:
|
18
16
|
|command|key |
|
@@ -25,4 +23,14 @@ Feature: Adding keys
|
|
25
23
|
And I type "josh@vitamin-j.com"
|
26
24
|
And I type "12345"
|
27
25
|
Then the output should contain "Access denied"
|
28
|
-
And I should not have a "bogus"
|
26
|
+
And I should not have a "bogus" api key
|
27
|
+
|
28
|
+
@1.4
|
29
|
+
Scenario: Adding a key from a compatible host
|
30
|
+
Given a gemcutter host at "https://nubygems.org"
|
31
|
+
And a valid gemcutter account
|
32
|
+
When I run "gem keys --add personal --host https://nubygems.org" interactively
|
33
|
+
And I type "josh@vitamin-j.com"
|
34
|
+
And I type "12345"
|
35
|
+
Then the output should contain "Enter your nubygems.org credentials"
|
36
|
+
And the "personal" api key should be the response body
|
data/features/default.feature
CHANGED
@@ -1,47 +1,29 @@
|
|
1
|
-
Feature:
|
2
|
-
As
|
3
|
-
I want to
|
4
|
-
|
1
|
+
Feature: Using gem keys
|
2
|
+
As an open source developer
|
3
|
+
I want to switch between rubygems API keys
|
4
|
+
In order to push all of my sweet gems
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
Then the output should contain "keycutter"
|
9
|
-
|
10
|
-
Scenario: Calling the plugin with no options
|
11
|
-
Given I have the following rubygems keys:
|
6
|
+
Background:
|
7
|
+
Given I have the following api keys:
|
12
8
|
|name |key |
|
13
9
|
|personal|11111111111111111111111111111111|
|
14
10
|
|work |22222222222222222222222222222222|
|
15
|
-
|oss_1 |33333333333333333333333333333333|
|
16
|
-
|oss_2 |44444444444444444444444444444444|
|
17
|
-
And my current rubygems key is "personal"
|
18
|
-
When I run "gem keys"
|
19
|
-
Then the output should contain:
|
20
|
-
"""
|
21
|
-
*** CURRENT KEYS ***
|
22
11
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
""
|
28
|
-
|
29
|
-
Scenario Outline: Using the list option
|
30
|
-
Given I have the following rubygems keys:
|
31
|
-
|name |key |
|
32
|
-
|personal|11111111111111111111111111111111|
|
33
|
-
|work |22222222222222222222222222222222|
|
34
|
-
And my current rubygems key is "work"
|
35
|
-
When I run "gem keys <option>"
|
36
|
-
Then the output should contain:
|
37
|
-
"""
|
38
|
-
*** CURRENT KEYS ***
|
39
|
-
|
40
|
-
personal
|
41
|
-
* work
|
42
|
-
"""
|
12
|
+
Scenario Outline: Using a different key
|
13
|
+
Given my current rubygems key is "work"
|
14
|
+
When I run "gem keys <command> <key>"
|
15
|
+
Then the output should contain "Now using <key> API key"
|
16
|
+
And my current rubygems key should be "<key>"
|
43
17
|
|
44
18
|
Examples:
|
45
|
-
|
|
46
|
-
|-
|
47
|
-
|--
|
19
|
+
|command|key |
|
20
|
+
|-d |personal|
|
21
|
+
|--default |personal|
|
22
|
+
|-d |work |
|
23
|
+
|
24
|
+
Scenario: Using a bogus key
|
25
|
+
Given my current rubygems key is "personal"
|
26
|
+
When I run "gem keys -d bogus"
|
27
|
+
Then the output should contain "No such API key. You can add it with: gem keys -a bogus"
|
28
|
+
And the exit status should be 1
|
29
|
+
And my current rubygems key should be "personal"
|
@@ -0,0 +1,47 @@
|
|
1
|
+
Feature: Default commands
|
2
|
+
As a new user
|
3
|
+
I want to find out what my options are
|
4
|
+
So I can put keycutter to best use
|
5
|
+
|
6
|
+
Scenario: Installing the gem
|
7
|
+
When I run "gem q"
|
8
|
+
Then the output should contain "keycutter"
|
9
|
+
|
10
|
+
Scenario: Calling the plugin with no options
|
11
|
+
Given I have the following api keys:
|
12
|
+
|name |key |
|
13
|
+
|rubygems|11111111111111111111111111111111|
|
14
|
+
|work |22222222222222222222222222222222|
|
15
|
+
|oss_1 |33333333333333333333333333333333|
|
16
|
+
|oss_2 |44444444444444444444444444444444|
|
17
|
+
And my current rubygems key is "rubygems"
|
18
|
+
When I run "gem keys"
|
19
|
+
Then the output should contain:
|
20
|
+
"""
|
21
|
+
*** CURRENT KEYS ***
|
22
|
+
|
23
|
+
oss_1
|
24
|
+
oss_2
|
25
|
+
* rubygems
|
26
|
+
work
|
27
|
+
"""
|
28
|
+
|
29
|
+
Scenario Outline: Using the list option
|
30
|
+
Given I have the following api keys:
|
31
|
+
|name |key |
|
32
|
+
|rubygems|11111111111111111111111111111111|
|
33
|
+
|work |22222222222222222222222222222222|
|
34
|
+
And my current rubygems key is "work"
|
35
|
+
When I run "gem keys <option>"
|
36
|
+
Then the output should contain:
|
37
|
+
"""
|
38
|
+
*** CURRENT KEYS ***
|
39
|
+
|
40
|
+
rubygems
|
41
|
+
* work
|
42
|
+
"""
|
43
|
+
|
44
|
+
Examples:
|
45
|
+
|option |
|
46
|
+
|-l |
|
47
|
+
|--list |
|
data/features/remove.feature
CHANGED
@@ -4,15 +4,15 @@ Feature: Remove API keys
|
|
4
4
|
So I can get rid of cruft
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I have the following
|
7
|
+
Given I have the following api keys:
|
8
8
|
|name |key |
|
9
9
|
|personal|11111111111111111111111111111111|
|
10
10
|
|work |22222222222222222222222222222222|
|
11
11
|
|
12
12
|
Scenario Outline:
|
13
13
|
When I run "gem keys <command> <key>"
|
14
|
-
Then the output should contain "Removed <key>
|
15
|
-
And I should not have a "<key>"
|
14
|
+
Then the output should contain "Removed <key> API key"
|
15
|
+
And I should not have a "<key>" api key
|
16
16
|
|
17
17
|
Examples:
|
18
18
|
|command |key |
|
@@ -21,5 +21,4 @@ Feature: Remove API keys
|
|
21
21
|
|
22
22
|
Scenario: Removing a bogus key
|
23
23
|
When I run "gem keys -r bogus"
|
24
|
-
Then the output should contain "No such
|
25
|
-
And the exit status should be 1
|
24
|
+
Then the output should contain "No such API key"
|
@@ -1,41 +1,48 @@
|
|
1
|
-
Given /^I have the following
|
2
|
-
|
3
|
-
hash[row[:name]] = row[:key]
|
1
|
+
Given /^I have the following api keys:$/ do |table|
|
2
|
+
keys = table.hashes.inject({}) do |hash,row|
|
3
|
+
hash[row[:name].to_sym] = row[:key]
|
4
4
|
hash
|
5
5
|
end
|
6
|
-
Gem.configuration.
|
6
|
+
Gem.configuration.api_keys = keys
|
7
7
|
end
|
8
8
|
|
9
9
|
Given /^my current rubygems key is "([^"]*)"$/ do |key|
|
10
|
-
Gem.configuration.rubygems_api_key = Gem.configuration.
|
10
|
+
Gem.configuration.rubygems_api_key = Gem.configuration.api_keys[key.to_sym]
|
11
11
|
end
|
12
12
|
|
13
13
|
Given /^a valid gemcutter account$/ do
|
14
|
-
|
15
|
-
|
14
|
+
set_env 'FAKEWEB_BODY', '3'*32
|
15
|
+
set_env 'FAKEWEB_STATUS', '200'
|
16
|
+
set_env 'FAKEWEB_MESSAGE', 'OK'
|
16
17
|
end
|
17
18
|
|
18
19
|
Given /^an invalid gemcutter account$/ do
|
19
|
-
|
20
|
-
|
20
|
+
set_env 'FAKEWEB_BODY', 'HTTP Basic: Access denied.'
|
21
|
+
set_env 'FAKEWEB_STATUS', '401'
|
22
|
+
set_env 'FAKEWEB_MESSAGE', 'Unauthorized'
|
21
23
|
end
|
22
24
|
|
25
|
+
Given /^a gemcutter host at "([^"]*)"$/ do |host|
|
26
|
+
set_env 'FAKEWEB_HOST', host
|
27
|
+
end
|
28
|
+
|
29
|
+
|
23
30
|
Then /^my current rubygems key should be "([^"]*)"$/ do |key|
|
24
31
|
Gem.configuration.load_rubygems_api_key
|
25
|
-
Gem.configuration.rubygems_api_key.should == Gem.configuration.
|
32
|
+
Gem.configuration.rubygems_api_key.should == Gem.configuration.api_keys[key.to_sym]
|
26
33
|
end
|
27
34
|
|
28
|
-
Then /^I should have a "([^"]*)"
|
29
|
-
Gem.configuration.
|
30
|
-
Gem.configuration.
|
35
|
+
Then /^I should have a "([^"]*)" api key$/ do |key|
|
36
|
+
Gem.configuration.load_api_keys
|
37
|
+
Gem.configuration.api_keys.should have_key(key.to_sym)
|
31
38
|
end
|
32
39
|
|
33
|
-
Then /^I should not have a "([^"]*)"
|
34
|
-
Gem.configuration.
|
35
|
-
Gem.configuration.
|
40
|
+
Then /^I should not have a "([^"]*)" api key$/ do |key|
|
41
|
+
Gem.configuration.load_api_keys
|
42
|
+
Gem.configuration.api_keys.should_not have_key(key.to_sym)
|
36
43
|
end
|
37
44
|
|
38
|
-
Then /^the "([^"]*)"
|
39
|
-
Gem.configuration.
|
40
|
-
Gem.configuration.
|
45
|
+
Then /^the "([^"]*)" api key should be the response body$/ do |key|
|
46
|
+
Gem.configuration.load_api_keys
|
47
|
+
Gem.configuration.api_keys[key.to_sym].should == ENV['FAKEWEB_BODY']
|
41
48
|
end
|
data/features/support/hooks.rb
CHANGED
@@ -5,12 +5,12 @@ end
|
|
5
5
|
|
6
6
|
Before do
|
7
7
|
@original_api_key = Gem.configuration.rubygems_api_key
|
8
|
-
@original_accounts = Gem.configuration.
|
8
|
+
@original_accounts = Gem.configuration.api_keys
|
9
9
|
end
|
10
10
|
|
11
11
|
After do
|
12
12
|
Gem.configuration.rubygems_api_key = @original_api_key
|
13
|
-
Gem.configuration.
|
13
|
+
Gem.configuration.api_keys = @original_accounts
|
14
14
|
end
|
15
15
|
|
16
16
|
at_exit do
|
data/lib/keycutter.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'rubygems/config_file'
|
2
2
|
|
3
3
|
class Gem::ConfigFile
|
4
|
-
def
|
5
|
-
@
|
4
|
+
def api_keys
|
5
|
+
@api_keys || load_api_keys
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def api_keys=(keys)
|
9
|
+
keys.merge!(:rubygems_api_key => @rubygems_api_key) if defined? @rubygems_api_key
|
10
10
|
|
11
11
|
dirname = File.dirname(credentials_path)
|
12
12
|
Dir.mkdir(dirname) unless File.exists?(dirname)
|
@@ -14,14 +14,18 @@ class Gem::ConfigFile
|
|
14
14
|
require 'yaml'
|
15
15
|
|
16
16
|
File.open(credentials_path, 'w') do |f|
|
17
|
-
f.write
|
17
|
+
f.write keys.to_yaml
|
18
18
|
end
|
19
19
|
|
20
|
-
@
|
20
|
+
@api_keys = keys
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
|
25
|
-
@
|
23
|
+
def load_api_keys
|
24
|
+
@api_keys = File.exists?(credentials_path) ? load_file(credentials_path) : @hash
|
25
|
+
if @api_keys.key?(:rubygems_api_key)
|
26
|
+
rubygems_api_key = @api_keys.delete(:rubygems_api_key)
|
27
|
+
@api_keys[:rubygems] = rubygems_api_key unless @api_keys.key?(:rubygems)
|
28
|
+
end
|
29
|
+
@api_keys
|
26
30
|
end
|
27
31
|
end
|
data/lib/keycutter/testing.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require 'drb'
|
2
1
|
require 'fakeweb'
|
3
2
|
|
4
|
-
DRb.start_service
|
5
|
-
remote = DRbObject.new(nil, "druby://localhost:3333")
|
6
|
-
|
7
3
|
FakeWeb.allow_net_connect = false
|
8
|
-
|
4
|
+
fakeweb_host = ENV['FAKEWEB_HOST'] || 'https://rubygems.org'
|
5
|
+
FakeWeb.register_uri :get, "#{fakeweb_host}/api/v1/api_key", {
|
6
|
+
:body => ENV['FAKEWEB_BODY'],
|
7
|
+
:status => [ENV['FAKEWEB_STATUS'], ENV['FAKEWEB_MESSAGE']]
|
8
|
+
}
|
data/lib/keycutter/version.rb
CHANGED
@@ -3,6 +3,10 @@ require 'rubygems/gemcutter_utilities'
|
|
3
3
|
class Gem::Commands::KeysCommand < Gem::Command
|
4
4
|
include Gem::GemcutterUtilities
|
5
5
|
|
6
|
+
OptionParser.accept Symbol do |value|
|
7
|
+
value.to_sym
|
8
|
+
end
|
9
|
+
|
6
10
|
def initialize
|
7
11
|
super 'keys', "Adds management for multiple gemcutter accounts"
|
8
12
|
|
@@ -10,17 +14,23 @@ class Gem::Commands::KeysCommand < Gem::Command
|
|
10
14
|
options[:list] = value
|
11
15
|
end
|
12
16
|
|
13
|
-
add_option '-
|
14
|
-
options[:
|
17
|
+
add_option '-d', '--default KEYNAME', Symbol, 'Set the default API key' do |value,options|
|
18
|
+
options[:default] = value
|
15
19
|
end
|
16
20
|
|
17
|
-
add_option '-r', '--remove KEYNAME', 'Remove the given API key' do |value,options|
|
21
|
+
add_option '-r', '--remove KEYNAME', Symbol, 'Remove the given API key' do |value,options|
|
18
22
|
options[:remove] = value
|
19
23
|
end
|
20
24
|
|
21
|
-
add_option '-a', '--add KEYNAME', 'Add an API key with the given name' do |value,options|
|
25
|
+
add_option '-a', '--add KEYNAME', Symbol, 'Add an API key with the given name' do |value,options|
|
22
26
|
options[:add] = value
|
23
27
|
end
|
28
|
+
|
29
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.4.0')
|
30
|
+
add_option '--host HOST', 'Use another gemcutter-compatible host' do |value,options|
|
31
|
+
options[:host] = value
|
32
|
+
end
|
33
|
+
end
|
24
34
|
end
|
25
35
|
|
26
36
|
def arguments
|
@@ -38,45 +48,53 @@ class Gem::Commands::KeysCommand < Gem::Command
|
|
38
48
|
def execute
|
39
49
|
require 'keycutter'
|
40
50
|
|
41
|
-
options[:list] = !(options[:
|
51
|
+
options[:list] = !(options[:default] || options[:remove] || options[:add])
|
42
52
|
|
43
53
|
if options[:add] then
|
44
|
-
|
54
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.4.0')
|
55
|
+
gem_host = URI.parse(options[:host] || Gem.host).host
|
56
|
+
else
|
57
|
+
gem_host = 'Rubygems.org'
|
58
|
+
end
|
59
|
+
|
60
|
+
say "Enter your #{gem_host} credentials."
|
45
61
|
say "Don't have an account yet? Create one at http://rubygems.org/sign_up"
|
46
62
|
|
47
63
|
email = ask " Email: "
|
48
64
|
password = ask_for_password "Password: "
|
49
65
|
say
|
50
66
|
|
51
|
-
|
67
|
+
args = [:get, 'api/v1/api_key']
|
68
|
+
args << options[:host] if options[:host]
|
69
|
+
|
70
|
+
response = rubygems_api_request(*args) do |request|
|
52
71
|
request.basic_auth email, password
|
53
72
|
end
|
54
73
|
|
55
74
|
with_response response do |resp|
|
56
|
-
accounts = Gem.configuration.
|
57
|
-
Gem.configuration.
|
58
|
-
say "Added #{options[:add]}
|
75
|
+
accounts = Gem.configuration.api_keys.merge(options[:add] => resp.body)
|
76
|
+
Gem.configuration.api_keys = accounts
|
77
|
+
say "Added #{options[:add]} API key"
|
59
78
|
end
|
60
79
|
end
|
61
80
|
|
62
81
|
if options[:remove] then
|
63
|
-
accounts = Gem.configuration.
|
82
|
+
accounts = Gem.configuration.api_keys
|
64
83
|
if accounts.has_key? options[:remove]
|
65
84
|
accounts.delete(options[:remove])
|
66
|
-
Gem.configuration.
|
67
|
-
say "Removed #{options[:remove]}
|
85
|
+
Gem.configuration.api_keys = accounts
|
86
|
+
say "Removed #{options[:remove]} API key"
|
68
87
|
else
|
69
|
-
say "No such
|
70
|
-
terminate_interaction 1
|
88
|
+
say "No such API key"
|
71
89
|
end
|
72
90
|
end
|
73
91
|
|
74
|
-
if options[:
|
75
|
-
if Gem.configuration.
|
76
|
-
Gem.configuration.rubygems_api_key = Gem.configuration.
|
77
|
-
say "Now using #{options[:
|
92
|
+
if options[:default] then
|
93
|
+
if Gem.configuration.api_keys.has_key? options[:default]
|
94
|
+
Gem.configuration.rubygems_api_key = Gem.configuration.api_keys[options[:default]]
|
95
|
+
say "Now using #{options[:default]} API key"
|
78
96
|
else
|
79
|
-
say "No such
|
97
|
+
say "No such API key. You can add it with: gem keys -a #{options[:default]}"
|
80
98
|
terminate_interaction 1
|
81
99
|
end
|
82
100
|
end
|
@@ -84,10 +102,10 @@ class Gem::Commands::KeysCommand < Gem::Command
|
|
84
102
|
if options[:list] then
|
85
103
|
say "*** CURRENT KEYS ***"
|
86
104
|
say
|
87
|
-
|
88
|
-
|
89
|
-
name, key =
|
90
|
-
say "
|
105
|
+
api_keys = Gem.configuration.api_keys.sort_by {|k,v| k.to_s}
|
106
|
+
api_keys.each do |api_key|
|
107
|
+
name, key = api_key
|
108
|
+
say " #{Gem.configuration.rubygems_api_key == key ? '*' : ' '} #{name}"
|
91
109
|
end
|
92
110
|
end
|
93
111
|
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -7,29 +7,32 @@ describe Gem::ConfigFile do
|
|
7
7
|
@config.stub(:credentials_path) { @credentials }
|
8
8
|
end
|
9
9
|
|
10
|
-
describe "#
|
10
|
+
describe "#api_keys" do
|
11
11
|
it "should load from credentials file" do
|
12
|
-
credentials = {:
|
12
|
+
credentials = {:personal => '1'*32, :work => '2'*32}
|
13
13
|
File.open(@credentials, 'w') { |f| f.write credentials.to_yaml }
|
14
|
-
@config.
|
14
|
+
@config.api_keys.should == credentials
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should add existing rubygems key to the hash" do
|
18
|
+
credentials = {:rubygems_api_key => '0'*32}
|
19
|
+
File.open(@credentials, 'w') { |f| f.write credentials.to_yaml }
|
20
|
+
@config.api_keys.should == {:rubygems => '0'*32}
|
15
21
|
end
|
16
22
|
end
|
17
23
|
|
18
|
-
describe "#
|
24
|
+
describe "#api_keys=" do
|
19
25
|
it "should write to credentials file" do
|
20
26
|
File.open(@credentials, 'w') { |f| f.write '' }
|
21
|
-
accounts = {
|
22
|
-
@config.
|
27
|
+
accounts = {:personal => '1'*32, :work => '2'*32}
|
28
|
+
@config.api_keys = accounts
|
23
29
|
|
24
|
-
File.read(@credentials).should ==
|
30
|
+
File.read(@credentials).should == accounts.to_yaml
|
25
31
|
end
|
26
32
|
|
27
33
|
it "should preserve existing credentials" do
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
accounts = {'personal' => '1'*32, 'work' => '2'*32}
|
32
|
-
@config.rubygems_accounts = accounts
|
34
|
+
@config.rubygems_api_key = '0'*32
|
35
|
+
@config.api_keys = {:personal => '1'*32, :work => '2'*32}
|
33
36
|
|
34
37
|
credentials = YAML.load_file(@credentials)
|
35
38
|
credentials[:rubygems_api_key].should == '0'*32
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keycutter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 25
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Josh French
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2011-01-04 00:00:00 -05:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|
@@ -38,12 +37,11 @@ files:
|
|
38
37
|
- Rakefile
|
39
38
|
- features/add.feature
|
40
39
|
- features/default.feature
|
40
|
+
- features/list.feature
|
41
41
|
- features/remove.feature
|
42
42
|
- features/step_definitions/keycutter_steps.rb
|
43
43
|
- features/support/env.rb
|
44
|
-
- features/support/fakeweb.rb
|
45
44
|
- features/support/hooks.rb
|
46
|
-
- features/use.feature
|
47
45
|
- keycutter.gemspec
|
48
46
|
- lib/keycutter.rb
|
49
47
|
- lib/keycutter/configuration.rb
|
@@ -63,38 +61,33 @@ rdoc_options: []
|
|
63
61
|
require_paths:
|
64
62
|
- lib
|
65
63
|
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
64
|
requirements:
|
68
65
|
- - ">="
|
69
66
|
- !ruby/object:Gem::Version
|
70
|
-
hash: 3
|
71
67
|
segments:
|
72
68
|
- 0
|
73
69
|
version: "0"
|
74
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
71
|
requirements:
|
77
72
|
- - ">="
|
78
73
|
- !ruby/object:Gem::Version
|
79
|
-
hash: 3
|
80
74
|
segments:
|
81
75
|
- 0
|
82
76
|
version: "0"
|
83
77
|
requirements: []
|
84
78
|
|
85
79
|
rubyforge_project: keycutter
|
86
|
-
rubygems_version: 1.3.
|
80
|
+
rubygems_version: 1.3.6
|
87
81
|
signing_key:
|
88
82
|
specification_version: 3
|
89
83
|
summary: Gemcutter key management
|
90
84
|
test_files:
|
91
85
|
- features/add.feature
|
92
86
|
- features/default.feature
|
87
|
+
- features/list.feature
|
93
88
|
- features/remove.feature
|
94
89
|
- features/step_definitions/keycutter_steps.rb
|
95
90
|
- features/support/env.rb
|
96
|
-
- features/support/fakeweb.rb
|
97
91
|
- features/support/hooks.rb
|
98
|
-
- features/use.feature
|
99
92
|
- spec/configuration_spec.rb
|
100
93
|
- spec/spec_helper.rb
|
data/features/support/fakeweb.rb
DELETED
data/features/use.feature
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
Feature: Using gem keys
|
2
|
-
As an open source developer
|
3
|
-
I want to switch between rubygems API keys
|
4
|
-
In order to push all of my sweet gems
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given I have the following rubygems keys:
|
8
|
-
|name |key |
|
9
|
-
|personal|11111111111111111111111111111111|
|
10
|
-
|work |22222222222222222222222222222222|
|
11
|
-
|
12
|
-
Scenario Outline: Using a different key
|
13
|
-
Given my current rubygems key is "work"
|
14
|
-
When I run "gem keys <command> <key>"
|
15
|
-
Then the output should contain "Now using <key> rubygems API key"
|
16
|
-
And my current rubygems key should be "<key>"
|
17
|
-
|
18
|
-
Examples:
|
19
|
-
|command|key |
|
20
|
-
|-u |personal|
|
21
|
-
|--use |personal|
|
22
|
-
|-u |work |
|
23
|
-
|
24
|
-
Scenario: Using a bogus key
|
25
|
-
Given my current rubygems key is "personal"
|
26
|
-
When I run "gem keys -u bogus"
|
27
|
-
Then the output should contain "No such rubygems API key. You can add it with: gem keys -a bogus"
|
28
|
-
And the exit status should be 1
|
29
|
-
And my current rubygems key should be "personal"
|