ridley 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/ridley/connection.rb +3 -0
- data/lib/ridley/version.rb +1 -1
- data/spec/unit/ridley/connection_spec.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a78cdade0a4199cf9793a2f4eca28e61baf9e7
|
4
|
+
data.tar.gz: 9dd018fd3730ce690dad3be7eabb725621bb5ca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a23d46b865752707d88c46f48fcde018fe0f3643251d07b414f9029ba6c536d4c46e64ddd7a193b53058a034669ef2515cf67e4a27cd7bdbccbce8f7e3476e2a
|
7
|
+
data.tar.gz: 1c54de6e0a88d546024e42de38b0cfb0a633de0b1e03f3515fc75f8dd357c6cc40c451b105da999c01323561072f296dd04ad3f1a63cdb70d635ac3b28d5fb6e
|
data/CHANGELOG.md
ADDED
data/lib/ridley/connection.rb
CHANGED
@@ -122,6 +122,8 @@ module Ridley
|
|
122
122
|
# a URL to stream the response body from
|
123
123
|
# @param [String] destination
|
124
124
|
# a location on disk to stream the content of the response body to
|
125
|
+
#
|
126
|
+
# @return [Boolean] true when the destination file exists
|
125
127
|
def stream(target, destination)
|
126
128
|
FileUtils.mkdir_p(File.dirname(destination))
|
127
129
|
|
@@ -157,6 +159,7 @@ module Ridley
|
|
157
159
|
local.flush
|
158
160
|
|
159
161
|
FileUtils.cp(local.path, destination)
|
162
|
+
File.exists?(destination)
|
160
163
|
rescue OpenURI::HTTPError => ex
|
161
164
|
abort(ex)
|
162
165
|
ensure
|
data/lib/ridley/version.rb
CHANGED
@@ -65,6 +65,10 @@ describe Ridley::Connection do
|
|
65
65
|
File.exist?(destination).should be_true
|
66
66
|
end
|
67
67
|
|
68
|
+
it "returns true when the file was copied" do
|
69
|
+
expect(subject.stream(target, destination)).to be_true
|
70
|
+
end
|
71
|
+
|
68
72
|
it "contains the contents of the response body" do
|
69
73
|
subject.stream(target, destination)
|
70
74
|
|
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: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -288,6 +288,7 @@ files:
|
|
288
288
|
- .gitignore
|
289
289
|
- .ruby-version
|
290
290
|
- .travis.yml
|
291
|
+
- CHANGELOG.md
|
291
292
|
- Gemfile
|
292
293
|
- Guardfile
|
293
294
|
- LICENSE
|