ridley 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/lib/ridley/chef_objects/cookbook_object.rb +2 -2
- data/lib/ridley/connection.rb +8 -2
- data/lib/ridley/errors.rb +4 -0
- data/lib/ridley/resource.rb +1 -1
- data/lib/ridley/version.rb +1 -1
- metadata +3 -3
data/Gemfile
CHANGED
@@ -118,7 +118,7 @@ module Ridley
|
|
118
118
|
#
|
119
119
|
# @return [nil]
|
120
120
|
def download_file(filetype, path, destination)
|
121
|
-
|
121
|
+
file_list = case filetype.to_sym
|
122
122
|
when :attribute, :attributes; attributes
|
123
123
|
when :definition, :definitions; definitions
|
124
124
|
when :file, :files; files
|
@@ -132,7 +132,7 @@ module Ridley
|
|
132
132
|
raise Errors::UnknownCookbookFileType.new(filetype)
|
133
133
|
end
|
134
134
|
|
135
|
-
file =
|
135
|
+
file = file_list.find { |f| f[:path] == path }
|
136
136
|
return nil if file.nil?
|
137
137
|
|
138
138
|
destination = File.expand_path(destination)
|
data/lib/ridley/connection.rb
CHANGED
@@ -99,8 +99,14 @@ module Ridley
|
|
99
99
|
# we expect. Caught exceptions are re-raised with Celluloid#abort so we don't crash the connection.
|
100
100
|
def run_request(*args)
|
101
101
|
defer { super }
|
102
|
-
rescue Errors::HTTPError
|
103
|
-
abort
|
102
|
+
rescue Errors::HTTPError => ex
|
103
|
+
abort ex
|
104
|
+
rescue Faraday::Error::ConnectionFailed => ex
|
105
|
+
abort Errors::ConnectionFailed.new(ex)
|
106
|
+
rescue Faraday::Error::TimeoutError => ex
|
107
|
+
abort Errors::TimeoutError.new(ex)
|
108
|
+
rescue Faraday::Error::ClientError => ex
|
109
|
+
abort Errors::ClientError.new(ex)
|
104
110
|
end
|
105
111
|
|
106
112
|
def server_url
|
data/lib/ridley/errors.rb
CHANGED
@@ -5,6 +5,10 @@ module Ridley
|
|
5
5
|
class InternalError < RidleyError; end
|
6
6
|
class ArgumentError < InternalError; end
|
7
7
|
|
8
|
+
class ClientError < RidleyError; end
|
9
|
+
class ConnectionFailed < ClientError; end
|
10
|
+
class TimeoutError < ClientError; end
|
11
|
+
|
8
12
|
class ResourceNotFound < RidleyError; end
|
9
13
|
class ValidatorNotFound < RidleyError; end
|
10
14
|
|
data/lib/ridley/resource.rb
CHANGED
data/lib/ridley/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridley
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
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: 2013-05-
|
12
|
+
date: 2013-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -455,7 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
455
455
|
version: '0'
|
456
456
|
segments:
|
457
457
|
- 0
|
458
|
-
hash:
|
458
|
+
hash: -3737954718774524860
|
459
459
|
requirements: []
|
460
460
|
rubyforge_project:
|
461
461
|
rubygems_version: 1.8.23
|