limbo 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/limbo/client.rb CHANGED
@@ -21,7 +21,7 @@ module Limbo
21
21
 
22
22
  def post
23
23
  headers = { "X-LIMBO-KEY" => Limbo.key,
24
- "content-type" => "application/json"}
24
+ "content-type" => "application/json;charset=utf-8"}
25
25
  path = '/log'
26
26
  request = Net::HTTP::Post.new(path, headers)
27
27
 
@@ -39,10 +39,12 @@ module Limbo
39
39
 
40
40
  def body
41
41
  begin
42
- JSON.generate(@body)
43
- rescue JSON::GeneratorError
42
+ JSON.generate(@body).encode("UTF-8", invalid: :replace, undef: :replace)
43
+ rescue => e
44
44
  @valid_data = false
45
- '{"client-error": "error generating JSON"}'
45
+ %Q|{"client-error": "error generating JSON",
46
+ "message": #{e.message.inspect},
47
+ "backtrace": "#{e.backtrace.join('\n')}"}|
46
48
  end
47
49
  end
48
50
 
data/lib/limbo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Limbo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limbo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-07-02 00:00:00.000000000 Z
12
+ date: 2012-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec