gemfury 0.4.20.beta3 → 0.4.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gemfury.rb +2 -0
- data/lib/gemfury/command/authorization.rb +18 -5
- data/lib/gemfury/version.rb +1 -1
- data/lib/rubygems_plugin.rb +0 -6
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c694aba98d65385ee9ff199b2224633dbea7f805
|
4
|
+
data.tar.gz: 66378125693c7382a484fbe03ace6258ae6dcf1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de6a50353915de51c282f5109a2435b2b4c4fc09df9a5624813f5885743477f5fa70391ac456bc19deca1088e16f0fe7aeb34ada1d98a35ca9c5b09e248c4338
|
7
|
+
data.tar.gz: da3c807d72fde4f8020da870bc400c5d304d8d8d12fd94cc97bdc24db95816810f72432677611560e604481a28c774304100f48f4b4a50400472f6cfc305801f
|
data/lib/gemfury.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
gem "netrc", "~> 0.7.7"
|
1
2
|
gem "multi_json", "~> 1.0"
|
2
3
|
gem "faraday", ">= 0.7.4", "< 0.9.0.pre"
|
3
4
|
gem "faraday_middleware", ">= 0.7", "< 0.10.0.pre"
|
4
5
|
|
5
6
|
require 'cgi'
|
7
|
+
require 'netrc'
|
6
8
|
require 'multi_json'
|
7
9
|
require 'faraday_middleware'
|
8
10
|
require 'faraday/request/multipart_with_file'
|
@@ -3,9 +3,12 @@ module Gemfury::Command::Authorization
|
|
3
3
|
|
4
4
|
def wipe_credentials!
|
5
5
|
FileUtils.rm(config_path, :force => true) # never raises exception
|
6
|
+
netrc_conf.delete(netrc_host)
|
7
|
+
netrc_conf.save
|
6
8
|
end
|
7
9
|
|
8
10
|
def has_credentials?
|
11
|
+
!!netrc_conf[netrc_host] ||
|
9
12
|
read_config_file.key?(:gemfury_api_key)
|
10
13
|
end
|
11
14
|
|
@@ -40,22 +43,32 @@ private
|
|
40
43
|
# Request and save the API access token
|
41
44
|
if !email.empty? && !passw.empty?
|
42
45
|
@user_api_key = client.get_access_token(email, passw)
|
43
|
-
write_credentials!
|
46
|
+
write_credentials!(email)
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
47
50
|
def load_credentials!
|
51
|
+
# Get credentials from ~/.netrc
|
52
|
+
email, @user_api_key = netrc_conf[netrc_host]
|
53
|
+
# Legacy loading from ~/.gem/gemfury
|
48
54
|
conf = read_config_file
|
49
55
|
@user_api_key = conf[:gemfury_api_key] if conf[:gemfury_api_key]
|
50
56
|
end
|
51
57
|
|
52
|
-
def write_credentials!
|
53
|
-
|
54
|
-
|
55
|
-
File.open(config_path, 'w') { |f| f.write(YAML.dump(config)) }
|
58
|
+
def write_credentials!(email)
|
59
|
+
netrc_conf[netrc_host] = email, @user_api_key
|
60
|
+
netrc_conf.save
|
56
61
|
end
|
57
62
|
|
58
63
|
def read_config_file
|
59
64
|
File.exist?(config_path) ? YAML.load_file(config_path) : {}
|
60
65
|
end
|
66
|
+
|
67
|
+
def netrc_conf
|
68
|
+
@netrc ||= Netrc.read
|
69
|
+
end
|
70
|
+
|
71
|
+
def netrc_host
|
72
|
+
URI.parse(client.endpoint).host
|
73
|
+
end
|
61
74
|
end
|
data/lib/gemfury/version.rb
CHANGED
data/lib/rubygems_plugin.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemfury
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.20
|
4
|
+
version: 0.4.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Rykov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - <
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: netrc
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.7.7
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.7.7
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: multi_json
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,9 +170,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
170
|
version: '0'
|
157
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
172
|
requirements:
|
159
|
-
- - '
|
173
|
+
- - '>='
|
160
174
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
175
|
+
version: '0'
|
162
176
|
requirements: []
|
163
177
|
rubyforge_project:
|
164
178
|
rubygems_version: 2.0.14
|