hockeybrake 0.0.3 → 0.0.4
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/lib/hockeybrake/hockey_sender.rb +9 -13
- data/lib/hockeybrake/version.rb +1 -1
- metadata +2 -2
|
@@ -18,32 +18,28 @@ module HockeyBrake
|
|
|
18
18
|
# generate the log
|
|
19
19
|
logstr = HockeyLog.generate(data)
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
file.write(logstr)
|
|
24
|
-
file.close
|
|
21
|
+
# generate the stirng io
|
|
22
|
+
logio = StringIO.new(logstr)
|
|
25
23
|
|
|
26
24
|
# buidl the url
|
|
27
25
|
url = URI.parse(HockeyBrake.configuration.hockey_url)
|
|
28
26
|
|
|
29
27
|
# send the request
|
|
30
28
|
response = begin
|
|
31
|
-
File.open(file.path) do |log|
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
# build the request
|
|
31
|
+
req = Net::HTTP::Post::Multipart.new( url.path, "log" => UploadIO.new(logio, 'application/octet-stream', "log.txt") )
|
|
32
|
+
|
|
33
|
+
# start the upload
|
|
34
|
+
Net::HTTP.start(url.host, url.port, :use_ssl => url.scheme == 'https') do |http|
|
|
35
|
+
http.request(req)
|
|
38
36
|
end
|
|
37
|
+
|
|
39
38
|
rescue *HTTP_ERRORS => e
|
|
40
39
|
log :error, "Unable to contact the HockeyApp server. HTTP Error=#{e}"
|
|
41
40
|
nil
|
|
42
41
|
end
|
|
43
42
|
|
|
44
|
-
# remove the file
|
|
45
|
-
file.unlink
|
|
46
|
-
|
|
47
43
|
case response
|
|
48
44
|
when Net::HTTPSuccess then
|
|
49
45
|
log :info, "Success: #{response.class}", response
|
data/lib/hockeybrake/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hockeybrake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
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-09-
|
|
12
|
+
date: 2012-09-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: airbrake
|