hobby-json 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b84e5a7d8db34627e1f5bec5d24c64627e102cb
4
- data.tar.gz: df2792d1288bc19f6883fd7f15d7db0c6d628a16
3
+ metadata.gz: d7c3bf7ba50a139dc0c243eb7c4363d024a8a614
4
+ data.tar.gz: 1f71511667ebdb36ef7175c67253cfff4d655d82
5
5
  SHA512:
6
- metadata.gz: b7505c89b687929c3428a71234428cb100341482ceff937db8df559b1c8ae74e95a6258eceb1484f4a700423c11d1907e47f5259ea0f5477dc3fed437b4a829b
7
- data.tar.gz: 853a766ea9250ae063acfb4434dd2865613cd415ea9ac2fb042fa7b8186efd048b92ba5f3832d4d82661b0fee8cdbc1ace4740ab403c067667136870a86546b5
6
+ metadata.gz: 93b8392838c910474c3c2dcdd6765ea780753842235cefacb5c3140864ab73717eb9ad2fd984adbaa2360df81c6c1c1e01a7eb82925595b9437ee0a77bf86b01
7
+ data.tar.gz: 4bc44b77be297b77488db23a91f633124a308521f0505d63464835aa12bb2649b55b0c4642ea45c36880b586d5b30097582aaf9f1b98ed9735af64447160bd94
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'hobby-devtools'
3
+ gem 'hobby-devtools', '>=0.0.5'
data/hobby-json.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |g|
2
2
  g.name = 'hobby-json'
3
3
  g.files = `git ls-files`.split($/)
4
- g.version = '0.0.3'
4
+ g.version = '0.0.4'
5
5
  g.summary = 'A way to work with JSON in Hobby without too much verbosity.'
6
6
  g.authors = ['Anatoly Chernow']
7
7
 
data/lib/hobby/json.rb CHANGED
@@ -19,6 +19,7 @@ module Hobby
19
19
  ::JSON.parse request.body.read
20
20
  rescue
21
21
  response.status = 400
22
+ throw :halt, response
22
23
  end
23
24
  end
24
25
  end
@@ -0,0 +1,6 @@
1
+ - get:
2
+ path: /access_key
3
+ body: not very json
4
+
5
+ response:
6
+ status: 400
data/spec/http_spec.rb CHANGED
@@ -6,7 +6,7 @@ Hobby::Devtools::RSpec.describe do
6
6
  include Hobby
7
7
  include Hobby::JSON
8
8
  get { json }
9
+ get('/access_key') { json['key'] }
9
10
  end.new
10
11
  end
11
- path 'spec/http/*.yml'
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobby-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoly Chernow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-23 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -36,6 +36,7 @@ files:
36
36
  - lib/hobby/json.rb
37
37
  - spec/helper.rb
38
38
  - spec/http/bad_request.yml
39
+ - spec/http/bad_request_when_json_key_accessed.yml
39
40
  - spec/http/echo.yml
40
41
  - spec/http_spec.rb
41
42
  homepage: