sendl 0.0.6 → 0.0.7
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.
- data/CHANGELOG +4 -0
- data/lib/sendl/uploader.rb +18 -4
- data/lib/sendl/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/sendl/uploader.rb
CHANGED
@@ -28,9 +28,13 @@ module Sendl
|
|
28
28
|
upload_file(f)
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
if success?
|
32
|
+
debug("success? was true, finalising the share")
|
33
|
+
r = Curl::Easy.new(url_for("shares/#{@share_id}/finalise.json")) do |curl|
|
34
|
+
curl.http_post Curl::PostField.content("auth_token", api_key)
|
35
|
+
end
|
36
|
+
else
|
37
|
+
STDERR.puts "Could not complete share as there were errors"
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
@@ -75,9 +79,19 @@ module Sendl
|
|
75
79
|
end
|
76
80
|
curl.http_post Curl::PostField.content("auth_token", api_key), Curl::PostField.content("_method", "PUT"), Curl::PostField.file("file_data[data]", f.filename, f.desired_name)
|
77
81
|
end
|
82
|
+
|
83
|
+
# Deal specifically with a request entity too large
|
84
|
+
if r.response_code == 413
|
85
|
+
debug("File was too large")
|
86
|
+
@errors << "Could not create share, a file was too big"
|
87
|
+
elsif r.response_code != 200
|
88
|
+
debug("An unknown error occurred")
|
89
|
+
@errors << "An unknown error occurred, the response code was #{r.response_code}"
|
90
|
+
end
|
91
|
+
|
78
92
|
STDERR.puts
|
79
93
|
else
|
80
|
-
@errors << "
|
94
|
+
@errors << "Something went wrong, please tell us if you continue to see problems (response code was #{r.response_code})"
|
81
95
|
end
|
82
96
|
end
|
83
97
|
|
data/lib/sendl/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: sendl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Will Jessop
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-25 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: getopt
|