gemstache 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -68,10 +68,19 @@ class Gem::Commands::StacheCommand < Gem::Command
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def upload_gem(name)
|
71
|
+
config = self.class.read_gemstache_config
|
72
|
+
domain = config.keys.first
|
73
|
+
if config.keys.count > 1
|
74
|
+
say "Which stache would you like to upload to?\n"
|
75
|
+
config.keys.each_with_index { |k,i| say " #{i+1}) #{k}" }
|
76
|
+
index = ask "Selection: "
|
77
|
+
domain = config.keys[index.to_i-1]
|
78
|
+
end
|
79
|
+
|
71
80
|
say "Pushing gem to Gemstache..."
|
72
81
|
|
73
82
|
old_host = ENV['RUBYGEMS_HOST']
|
74
|
-
ENV['RUBYGEMS_HOST'] = "
|
83
|
+
ENV['RUBYGEMS_HOST'] = "https://#{domain}"
|
75
84
|
response = rubygems_api_request(:post, 'api/v1/gems') do |request|
|
76
85
|
request.body = Gem.read_binary name
|
77
86
|
request.add_field "Content-Length", request.body.size
|
@@ -10,7 +10,7 @@ class Gem::RemoteFetcher
|
|
10
10
|
|
11
11
|
if uri.host =~ /\.gemstache\.com/
|
12
12
|
api_key = $override_api_key || Gem::Commands::StacheCommand.read_gemstache_config[uri.host]
|
13
|
-
request.add_field('Authorization', api_key) if api_key
|
13
|
+
request.add_field('Authorization', api_key) if api_key && request.get_fields('Authorization').nil?
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemstache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ken Robertson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-14 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|