gemfury 0.4.25 → 0.4.26.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1b0011bbbc90b499a9e523479a9f4940a1a1f067
4
- data.tar.gz: fb80ad4c387bf7e00912347e5e2359a910ad616e
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTlmMmNjOWNiZGU4ZTE3ZmI0MGQ2OWE0YmViMmFjZDY0MTBlODU3Yg==
5
+ data.tar.gz: !binary |-
6
+ Y2QzNTUwY2RjYTM4OWMxMzU3MTQxYTQ5MmMzM2FiODc2YWQ3YTJlMA==
5
7
  SHA512:
6
- metadata.gz: b5af75198d77c88fece87f4c6363c10caee6950de2f7385ee318a81981abe15c447e53f82163c2de75e5e8d4b493eb3732f30be32e82e4e26876ed67f9d5c5b1
7
- data.tar.gz: beb883de3fdb76599c43c4984870ab711c5d541bf9a87b1db26557b5a5e64188c696e852dae5c5dca668ea72c27f2021c368dac3bfc202ab4cd104c02a07caa6
8
+ metadata.gz: !binary |-
9
+ YzAxOTRiZGFiY2VhZmExODRlNjk0ODg0MmY0NTAyZDJlZGYwZmRhZjI2M2Ni
10
+ MjQ2NDY1NGYxODRiNjM3N2MzNmNhOTBlMjMwYmY4NmMxMzdlOTgxODg4NGY5
11
+ NTViMTg1ZTM3ODA3ZGEzZGZmZDExN2ExZTk5NTY2YTVkMDU0NGU=
12
+ data.tar.gz: !binary |-
13
+ NzY5NWExZDk4YjdmNjhiOTNlODM4MjEwMDc3OWYxOTA1OGFjNmNlMDQ1ODg5
14
+ Y2U2NWM3MTE0MGU3ODhkOTVhZjM2MTIyNzU0OGEwN2UyOWY0ZTZlNjQ1YTg5
15
+ ODBmZDEwZWY4ZGY5OTllMWZjNDJmYzkyNzYyM2M5MjM0OGY1Nzk=
@@ -15,8 +15,7 @@ module Gemfury
15
15
  def account_info
16
16
  ensure_ready!(:authorization)
17
17
  response = connection.get('users/me')
18
- ensure_successful_response!(response)
19
- response.body
18
+ checked_response_body(response)
20
19
  end
21
20
 
22
21
  # Uploading a gem file
@@ -26,26 +25,25 @@ module Gemfury
26
25
  # Generate upload link
27
26
  api2 = connection(:url => self.endpoint2)
28
27
  response = api2.post('uploads')
29
- ensure_successful_response!(response)
28
+ checked_response_body(response)
30
29
 
31
30
  # Upload to S3
32
31
  upload = response.body['upload']
33
32
  id, s3url = upload['id'], upload['blob']['put']
34
33
  response = s3_put_file(s3url, gem_file)
35
- ensure_successful_response!(response)
34
+ checked_response_body(response)
36
35
 
37
36
  # Notify Gemfury that the upload is ready
38
37
  options[:name] ||= File.basename(gem_file.path)
39
38
  response = api2.put("uploads/#{id}", options)
40
- ensure_successful_response!(response)
39
+ checked_response_body(response)
41
40
  end
42
41
 
43
42
  # List available gems
44
43
  def list(options = {})
45
44
  ensure_ready!(:authorization)
46
45
  response = connection.get('gems', options)
47
- ensure_successful_response!(response)
48
- response.body
46
+ checked_response_body(response)
49
47
  end
50
48
 
51
49
  # List versions for a gem
@@ -53,8 +51,7 @@ module Gemfury
53
51
  ensure_ready!(:authorization)
54
52
  url = "gems/#{escape(name)}/versions"
55
53
  response = connection.get(url, options)
56
- ensure_successful_response!(response)
57
- response.body
54
+ checked_response_body(response)
58
55
  end
59
56
 
60
57
  # Delete a gem version
@@ -62,27 +59,26 @@ module Gemfury
62
59
  ensure_ready!(:authorization)
63
60
  url = "gems/#{escape(name)}/versions/#{escape(version)}"
64
61
  response = connection.delete(url, options)
65
- ensure_successful_response!(response)
66
- response.body
62
+ checked_response_body(response)
67
63
  end
68
64
 
69
- # Get Authentication token via email/password
70
- def get_access_token(email, password, options = {})
71
- ensure_ready!
72
- response = connection.post('access_token', options.merge(
73
- :email => email, :password => password
74
- ))
65
+ # LEGACY: Authentication token via email/password
66
+ def get_access_token(*args)
67
+ login(*args)['access_token']
68
+ end
75
69
 
76
- ensure_successful_response!(response)
77
- response.body['access_token']
70
+ # Get authentication info via email/password
71
+ def login(email, password, opts = {})
72
+ ensure_ready!
73
+ opts = opts.merge(:email => email, :password => password)
74
+ checked_response_body(connection.post('access_token', opts))
78
75
  end
79
76
 
80
77
  # List collaborators for this account
81
78
  def list_collaborators(options = {})
82
79
  ensure_ready!(:authorization)
83
80
  response = connection.get('collaborators', options)
84
- ensure_successful_response!(response)
85
- response.body
81
+ checked_response_body(response)
86
82
  end
87
83
 
88
84
  # Add a collaborator to the account
@@ -90,7 +86,7 @@ module Gemfury
90
86
  ensure_ready!(:authorization)
91
87
  url = "collaborators/#{escape(login)}"
92
88
  response = connection.put(url, options)
93
- ensure_successful_response!(response)
89
+ checked_response_body(response)
94
90
  end
95
91
 
96
92
  # Remove a collaborator to the account
@@ -98,7 +94,7 @@ module Gemfury
98
94
  ensure_ready!(:authorization)
99
95
  url = "collaborators/#{escape(login)}"
100
96
  response = connection.delete(url, options)
101
- ensure_successful_response!(response)
97
+ checked_response_body(response)
102
98
  end
103
99
 
104
100
  private
@@ -136,8 +132,10 @@ module Gemfury
136
132
  end
137
133
  end
138
134
 
139
- def ensure_successful_response!(response)
140
- unless response.success?
135
+ def checked_response_body(response)
136
+ if response.success?
137
+ return response.body
138
+ else
141
139
  error = (response.body || {})['error'] || {}
142
140
  error_class = case response.status
143
141
  when 401 then Gemfury::Unauthorized
@@ -1,3 +1,3 @@
1
1
  module Gemfury
2
- VERSION = '0.4.25'
2
+ VERSION = '0.4.26.beta1'
3
3
  end
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.25
4
+ version: 0.4.26.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rykov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-02 00:00:00.000000000 Z
11
+ date: 2014-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -56,7 +56,7 @@ dependencies:
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.14.0
62
62
  - - <
@@ -66,7 +66,7 @@ dependencies:
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ! '>='
70
70
  - !ruby/object:Gem::Version
71
71
  version: 0.14.0
72
72
  - - <
@@ -76,7 +76,7 @@ dependencies:
76
76
  name: faraday
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ! '>='
80
80
  - !ruby/object:Gem::Version
81
81
  version: 0.9.0
82
82
  - - <
@@ -86,14 +86,15 @@ dependencies:
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - '>='
89
+ - - ! '>='
90
90
  - !ruby/object:Gem::Version
91
91
  version: 0.9.0
92
92
  - - <
93
93
  - !ruby/object:Gem::Version
94
94
  version: 0.10.0.pre
95
- description: |
96
- Cloud Gem Server for your private RubyGems at http://gemfury.com
95
+ description: ! 'Cloud Gem Server for your private RubyGems at http://gemfury.com
96
+
97
+ '
97
98
  email: mrykov@gmail.com
98
99
  executables:
99
100
  - gemfury
@@ -125,38 +126,27 @@ homepage: http://www.gemfury.com
125
126
  licenses:
126
127
  - MIT
127
128
  metadata: {}
128
- post_install_message: |
129
- ************************************************************************
130
-
131
- Upload your first package to start using Gemfury:
132
- fury push my-package-1.0.0.gem
133
-
134
- If you have a directory with packages, you can use:
135
- fury migrate ./path/to/codez
136
-
137
- Find out what else you can do:
138
- fury help
139
-
140
- Follow @gemfury on Twitter for announcements, updates, and news.
141
- https://twitter.com/gemfury
142
-
143
- ************************************************************************
129
+ post_install_message: ! "************************************************************************\n\n
130
+ \ Upload your first package to start using Gemfury:\n fury push my-package-1.0.0.gem\n\n
131
+ \ If you have a directory with packages, you can use:\n fury migrate ./path/to/codez\n\n
132
+ \ Find out what else you can do:\n fury help\n\n Follow @gemfury on Twitter for
133
+ announcements, updates, and news.\n https://twitter.com/gemfury\n\n************************************************************************\n"
144
134
  rdoc_options: []
145
135
  require_paths:
146
136
  - lib
147
137
  required_ruby_version: !ruby/object:Gem::Requirement
148
138
  requirements:
149
- - - '>='
139
+ - - ! '>='
150
140
  - !ruby/object:Gem::Version
151
141
  version: '0'
152
142
  required_rubygems_version: !ruby/object:Gem::Requirement
153
143
  requirements:
154
- - - '>='
144
+ - - ! '>'
155
145
  - !ruby/object:Gem::Version
156
- version: '0'
146
+ version: 1.3.1
157
147
  requirements: []
158
148
  rubyforge_project:
159
- rubygems_version: 2.2.1
149
+ rubygems_version: 2.4.2
160
150
  signing_key:
161
151
  specification_version: 4
162
152
  summary: Cloud Gem Server for your private RubyGems