gemfury 0.9.1 → 0.10.0.rc1
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.
- checksums.yaml +4 -4
- data/lib/gemfury.rb +2 -1
- data/lib/gemfury/client.rb +7 -0
- data/lib/gemfury/command/app.rb +45 -9
- data/lib/gemfury/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 624ab4a41068c6d17c63693ff3bc4de20641ee87390f68df9f7d02c29a59e16e
|
4
|
+
data.tar.gz: f4657867345ca219161a3090be0fb2ba19c475cb3fb33ac637213aa0c32916c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 569f391a1d8230204d9b1778042a57e53a72afae523ae7f1b4646971ad2db1918dc1260792f0fce000e995619d78f5c2bc3ca013945883cb01c6292463694219
|
7
|
+
data.tar.gz: f3906e7e9b1e360ba75f8615f5728009b3e8c01915be185777ea2fdef9d1207990abe3c86f405a18e8275461eef334efb8c1c738ceb62eb74765d63d24fa063e
|
data/lib/gemfury.rb
CHANGED
@@ -2,6 +2,7 @@ gem "multi_json", "~> 1.10"
|
|
2
2
|
gem "faraday", ">= 0.9.0", "< 0.16.0.pre"
|
3
3
|
gem "netrc", ">= 0.10.0", "< 0.12.0.pre"
|
4
4
|
|
5
|
+
require 'time'
|
5
6
|
require 'cgi'
|
6
7
|
require 'uri'
|
7
8
|
require 'netrc'
|
@@ -49,4 +50,4 @@ class Hash
|
|
49
50
|
hash.is_a?(Hash) ? hash[part] : nil
|
50
51
|
end
|
51
52
|
end
|
52
|
-
end
|
53
|
+
end
|
data/lib/gemfury/client.rb
CHANGED
@@ -18,6 +18,13 @@ module Gemfury
|
|
18
18
|
checked_response_body(response)
|
19
19
|
end
|
20
20
|
|
21
|
+
# Get the information for the current account
|
22
|
+
def accounts
|
23
|
+
ensure_ready!(:authorization)
|
24
|
+
response = connection.get('accounts')
|
25
|
+
checked_response_body(response)
|
26
|
+
end
|
27
|
+
|
21
28
|
# Uploading a gem file
|
22
29
|
def push_gem(file, options = {})
|
23
30
|
ensure_ready!(:authorization)
|
data/lib/gemfury/command/app.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
class Gemfury::Command::App < Thor
|
2
2
|
include Gemfury::Command::Authorization
|
3
|
+
UserAgent = "Gemfury CLI #{Gemfury::VERSION}".freeze
|
3
4
|
PackageExtensions = %w(gem egg tar.gz tgz nupkg)
|
4
5
|
|
5
6
|
# Impersonation
|
@@ -26,11 +27,15 @@ class Gemfury::Command::App < Thor
|
|
26
27
|
with_checks_and_rescues do
|
27
28
|
gems = client.list
|
28
29
|
shell.say "\n*** GEMFURY PACKAGES ***\n\n"
|
30
|
+
|
31
|
+
va = [ %w{ name kind version privacy } ]
|
29
32
|
gems.each do |g|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
+
va << [ g['name'], g['language'],
|
34
|
+
g.path('latest_version.version') || 'beta',
|
35
|
+
g['private'] ? 'private' : 'public ' ]
|
33
36
|
end
|
37
|
+
|
38
|
+
shell.print_table(va)
|
34
39
|
end
|
35
40
|
end
|
36
41
|
|
@@ -39,9 +44,15 @@ class Gemfury::Command::App < Thor
|
|
39
44
|
with_checks_and_rescues do
|
40
45
|
versions = client.versions(gem_name)
|
41
46
|
shell.say "\n*** #{gem_name.capitalize} Versions ***\n\n"
|
47
|
+
|
48
|
+
va = []
|
49
|
+
va = [ %w{ version uploaded uploaded_by } ]
|
42
50
|
versions.each do |v|
|
43
|
-
|
51
|
+
uploaded = Time.parse(v['created_at']).strftime('%F %R %z')
|
52
|
+
va << [ v['version'], uploaded, v['created_by']['name'] ]
|
44
53
|
end
|
54
|
+
|
55
|
+
shell.print_table(va)
|
45
56
|
end
|
46
57
|
end
|
47
58
|
|
@@ -82,6 +93,20 @@ class Gemfury::Command::App < Thor
|
|
82
93
|
end
|
83
94
|
end
|
84
95
|
|
96
|
+
desc "accounts", "Show info about your Gemfury accounts"
|
97
|
+
def accounts
|
98
|
+
with_checks_and_rescues do
|
99
|
+
accounts = client.accounts
|
100
|
+
|
101
|
+
va = [ %w{ name kind permission } ]
|
102
|
+
accounts.each do |a|
|
103
|
+
va << [ a['name'], a['type'], a['viewer_permission'].downcase ]
|
104
|
+
end
|
105
|
+
|
106
|
+
shell.print_table(va)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
85
110
|
### COLLABORATION MANAGEMENT ###
|
86
111
|
map "sharing:add" => 'sharing_add'
|
87
112
|
map "sharing:remove" => 'sharing_remove'
|
@@ -191,7 +216,9 @@ private
|
|
191
216
|
opts = {}
|
192
217
|
opts[:user_api_key] = @user_api_key if @user_api_key
|
193
218
|
opts[:account] = options[:as] if options[:as]
|
194
|
-
Gemfury::Client.new(opts)
|
219
|
+
client = Gemfury::Client.new(opts)
|
220
|
+
client.user_agent = UserAgent
|
221
|
+
return client
|
195
222
|
end
|
196
223
|
|
197
224
|
def with_checks_and_rescues(&block)
|
@@ -230,24 +257,33 @@ private
|
|
230
257
|
push_options[:public] = options[:public]
|
231
258
|
end
|
232
259
|
|
260
|
+
error_ex = nil
|
261
|
+
|
233
262
|
# Let's get uploading
|
234
263
|
files.each do |file|
|
235
264
|
begin
|
236
265
|
shell.say "Uploading #{File.basename(file.path)} "
|
237
266
|
client.push_gem(file, push_options)
|
238
267
|
shell.say "- done"
|
239
|
-
rescue Gemfury::CorruptGemFile
|
268
|
+
rescue Gemfury::CorruptGemFile => e
|
240
269
|
shell.say "- problem processing this package", :red
|
241
|
-
|
270
|
+
error_ex = e
|
271
|
+
rescue Gemfury::DupeVersion => e
|
242
272
|
shell.say "- this version already exists", :red
|
243
|
-
|
273
|
+
error_ex = e
|
274
|
+
rescue Gemfury::TimeoutError, Errno::EPIPE => e
|
244
275
|
shell.say "- this file is too much to handle", :red
|
245
276
|
shell.say " Visit http://www.gemfury.com/large-package for more info"
|
277
|
+
error_ex = e
|
246
278
|
rescue => e
|
247
279
|
shell.say "- oops", :red
|
248
|
-
|
280
|
+
error_ex = e
|
249
281
|
end
|
250
282
|
end
|
283
|
+
|
284
|
+
unless error_ex.nil?
|
285
|
+
die!('There was a problem uploading at least 1 package', error_ex)
|
286
|
+
end
|
251
287
|
end
|
252
288
|
|
253
289
|
def die!(msg, err = nil, command = nil)
|
data/lib/gemfury/version.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
|
+
version: 0.10.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Rykov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -165,12 +165,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
167
|
requirements:
|
168
|
-
- - "
|
168
|
+
- - ">"
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
170
|
+
version: 1.3.1
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.7.
|
173
|
+
rubygems_version: 2.7.8
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Hosted repo for your public and private packages
|