hobby-json 0.0.0
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 +7 -0
- data/hobby-json.gemspec +7 -0
- data/lib/hobby/json.rb +20 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d820dab743e7615d8575ea8c36f0944c0de0066b
|
4
|
+
data.tar.gz: 2678eab42ae8a006a4af0d897cc6d0ebb37febeb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eb668c9b7cea4277a4ba83fb52b07a128b22d4bf23361b772361c4ab9577d45fb01c69289fa58fadef586a16062367cf289978381032ad3072a6f8ae8f12aaca
|
7
|
+
data.tar.gz: bec59290b437cb99e38e6cdae6e22f03d72eeab8a52087fdc14b33b5095bcb37ec15ef0faa0ffe2ca59a33cea0bc3f8735bd26d759955a60bbaffdc891cb6452
|
data/hobby-json.gemspec
ADDED
data/lib/hobby/json.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Hobby
|
4
|
+
module JSON
|
5
|
+
def self.included app
|
6
|
+
app.use Rack::ContentType, 'application/json'
|
7
|
+
app.response.extend Write
|
8
|
+
end
|
9
|
+
|
10
|
+
module Write
|
11
|
+
def write object
|
12
|
+
super object.to_json
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def json
|
17
|
+
@json ||= JSON.parse request.body.read
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hobby-json
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Anatoly Cherno
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- hobby-json.gemspec
|
20
|
+
- lib/hobby/json.rb
|
21
|
+
homepage:
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.5.1
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: A way to work with JSON in Hobby without too much verbosity.
|
44
|
+
test_files: []
|