croket 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/croket.rb +16 -14
  3. data/lib/croket/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8807b21688381b37af1d8677b657628acc42f878
4
- data.tar.gz: d3479936f895ad06b1e7d7f5d8c47a8c92403e4f
3
+ metadata.gz: 0b7692e4bd8759efa523ca8ec3be7496f36a7ce3
4
+ data.tar.gz: 748a0a8131af7d1c7ef337f66bdcb31ffa063ffe
5
5
  SHA512:
6
- metadata.gz: 010627710f99d987d3cf4c2c48ddca4d283fd18472b2b007fd5b41e1348beca239363655b3e00039ea2a2defa983892832ac0da89261ee76863e9c72060ba64e
7
- data.tar.gz: d5d1b1a48ddc6f067eba05827678a964de7523edfa1f94d7a541b32c993b878a712e8a3e73fe273946646c3a219bb1cc901ff6d8056113acb291bc40229e4f6a
6
+ metadata.gz: 8930f92e4ec5ea6a64423bcbe41bc5869a7244d2de501d97b956c6f9c2fc2529d061de7034260c92b5e008ef447ff8e9ecd017c3f9a112304d1fb1f226dfbbb3
7
+ data.tar.gz: c49be86f6f6f70a465fa33100c0b97f3c018748aed941c956935306c915a13ca3acd58698c7cca80f04485e2236027a4a5e2c08116d025f129698f543a91d874
@@ -34,20 +34,22 @@ module Croket
34
34
  request = ::Rack::Request.new(opts)
35
35
  params = request.env['action_dispatch.request.parameters']
36
36
  version = "Rails/#{::Rails.version}" if defined?(::Rails)
37
- r = RestClient::Request.execute url: "http://#{configuration.host}/v1/issues.json", method: :post,
38
- payload: {
39
- issue: {
40
- title: "#{exception}",
41
- description: generate_description(request, controller, params, exception),
42
- category: 'crash',
43
- package: configuration.package,
44
- environment: configuration.environment,
45
- version: version
46
- }
47
- }, headers: {'Authorization' => "Token token=#{configuration.api_key}"}, content_type: :json, accept: :json
48
- r = JSON.parse r
49
- l.debug "[CROKET] id: #{r['issue']['id']}, number: #{r['issue']['tracker_number']}, dup: #{r['issue']['duplication']}"
50
-
37
+ begin
38
+ r = RestClient::Request.execute url: "http://#{configuration.host}/v1/issues.json", method: :post,
39
+ payload: {
40
+ issue: {
41
+ description: "#{exception}\n#{generate_description(request, controller, params, exception)}",
42
+ category: 'crash',
43
+ package: configuration.package,
44
+ environment: configuration.environment,
45
+ version: version
46
+ }
47
+ }, headers: {'Authorization' => "Token token=#{configuration.api_key}"}, content_type: :json, accept: :json
48
+ r = JSON.parse r
49
+ l.debug "[CROKET] id: #{r['issue']['id']}, number: #{r['issue']['tracker_number']}, dup: #{r['issue']['duplication']}"
50
+ rescue RestClient::RequestFailed => e
51
+ l.error "Request to http://#{configuration.host}/v1/issues.json was failed:" + e.message
52
+ end
51
53
  end
52
54
 
53
55
  private
@@ -1,3 +1,3 @@
1
1
  module Croket
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: croket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikolay Moskvin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-25 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.4.5.1
105
+ rubygems_version: 2.5.1
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Croket for Ruby