gemfury 0.4.10 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
- Gemfury
2
- =======
1
+ Gemfury CLI
2
+ ===========
3
+
4
+ [![RubyGem Version](https://fury-badge.herokuapp.com/rb/gemfury.png)](http://badge.fury.io/rb/gemfury)
5
+ [![Build Status](https://secure.travis-ci.org/gemfury/gemfury.png?branch=master)](https://travis-ci.org/gemfury/gemfury)
3
6
 
4
7
  Gemfury is your personal cloud for your private and custom RubyGems.
5
8
  Once you upload your RubyGem and enable Gemfury as a source, you can
@@ -10,6 +10,7 @@ require 'gemfury/platform'
10
10
  require 'gemfury/configuration'
11
11
 
12
12
  require 'gemfury/client/filters'
13
+ require 'gemfury/client/middleware'
13
14
  require 'gemfury/client'
14
15
 
15
16
  module Gemfury
@@ -114,6 +114,7 @@ module Gemfury
114
114
  builder.use Faraday::Request::UrlEncoded
115
115
  #builder.use Faraday::Response::Logger
116
116
  builder.use Faraday::Response::ParseJson
117
+ builder.use Handle503
117
118
  builder.adapter :net_http
118
119
  end
119
120
  end
@@ -124,6 +125,7 @@ module Gemfury
124
125
  error_class = case response.status
125
126
  when 401 then Gemfury::Unauthorized
126
127
  when 404 then Gemfury::NotFound
128
+ when 503 then Gemfury::TimeoutError
127
129
  when 400
128
130
  case error['type']
129
131
  when 'Forbidden' then Gemfury::Forbidden
@@ -0,0 +1,12 @@
1
+ module Gemfury
2
+ class Client
3
+ class Handle503 < Faraday::Middleware
4
+ def call(env)
5
+ # This prevents errors in ParseJson
6
+ @app.call(env).on_complete do |out|
7
+ out[:body] = '' if out[:status] == 503
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -113,7 +113,7 @@ class Gemfury::Command::App < Thor
113
113
  desc "migrate DIR", "Upload all gems within a directory"
114
114
  def migrate(*paths)
115
115
  with_checks_and_rescues do
116
- gem_paths = Dir[*(paths.map do |p|
116
+ gem_paths = Dir.glob(paths.map do |p|
117
117
  if File.directory?(p)
118
118
  "#{p}/**/*.gem"
119
119
  elsif File.file?(p)
@@ -121,7 +121,7 @@ class Gemfury::Command::App < Thor
121
121
  else
122
122
  nil
123
123
  end
124
- end.compact)]
124
+ end.compact)
125
125
 
126
126
  if gem_paths.empty?
127
127
  shell.say "Problem: No valid gems found", :red
@@ -181,6 +181,9 @@ private
181
181
  shell.say "- done"
182
182
  rescue Gemfury::CorruptGemFile
183
183
  shell.say "- problem processing this gem", :red
184
+ rescue Gemfury::TimeoutError, Errno::EPIPE
185
+ shell.say "- this file is too much to handle", :red
186
+ shell.say " Visit http://www.gemfury.com/large-package for more info"
184
187
  rescue => e
185
188
  shell.say "- oops", :red
186
189
  throw e
@@ -16,4 +16,7 @@ module Gemfury
16
16
 
17
17
  # Corrupt Gem File
18
18
  CorruptGemFile = Class.new(Error)
19
+
20
+ # TimeoutError for 503s
21
+ TimeoutError = Class.new(Error)
19
22
  end
@@ -1,3 +1,3 @@
1
1
  module Gemfury
2
- VERSION = '0.4.10'
2
+ VERSION = '0.4.11'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemfury
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-19 00:00:00.000000000 Z
12
+ date: 2013-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -130,6 +130,7 @@ files:
130
130
  - bin/gemfury
131
131
  - lib/faraday/request/multipart_with_file.rb
132
132
  - lib/gemfury/client/filters.rb
133
+ - lib/gemfury/client/middleware.rb
133
134
  - lib/gemfury/client.rb
134
135
  - lib/gemfury/command/app.rb
135
136
  - lib/gemfury/command/authorization.rb