granola-schema 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -8
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93aa9c33c0236c4695f9049b64214ff25510f819
4
- data.tar.gz: 05c2c7105c8b6525bd64d504e332cb926969ec86
3
+ metadata.gz: 02cf64484c5f354c2a89a84f30e1ca45a304c8c0
4
+ data.tar.gz: fa604062d1279a33bad7eb7eb70844e0a2311754
5
5
  SHA512:
6
- metadata.gz: f35c0b422fafd8864e5bf0d2f3b4fa5d416dd191c66e6be93b51f316f641cd37275ead27057bd309c4eb4d6c497ca13b12012ad24c12b97b4322e1f5a5966652
7
- data.tar.gz: 7c9ccdaef365f48ea0131f1081cf3ee9b3ae9fa723b9a53fcaee00f109e5a9a8cfb4d4a95575d39f57393ea980aded4afe54b3e1682e606d7db6328174e59152
6
+ metadata.gz: 1adb7a313efb88297ff27fb377479c17c91b02d9c11c2dff31635ce6ed92cbb66fd8693ec54c2a09da0f3743160ad49fbb8220c858d2d3772da244ebd295ac6a
7
+ data.tar.gz: 344ab9d3184b53f732eb3d6b5b9f40ef6b7441019b354c6748bc17f64b31f663b2864663775921544e3dc876c6e08649927405190ffbb19c9ffff31c7666a75a
data/README.md CHANGED
@@ -30,16 +30,13 @@ PersonSerializer.new(person).to_json #=> '{"name":"John Doe",...}'
30
30
  ## JSON serialization
31
31
 
32
32
  Granola doesn't make assumptions about your code, so it shouldn't depend on a
33
- specific JSON backend. It uses [MultiJson][] to serialize your objects with your
34
- favorite backend.
33
+ specific JSON backend. It defaults to the native JSON backend, but you're free
34
+ to change it. For example, if you were using [Yajl][]:
35
35
 
36
- Try to avoid using the default, which is the `stdlib`'s pure-ruby JSON library,
37
- since it's slow. If in doubt, I like [Yajl][].
38
-
39
- If you want to pass options to `MultiJson` (like `pretty: true`), any keywords
40
- passed to `#to_json` will be forwarded to `MultiJson.dump`.
36
+ ``` ruby
37
+ Granola.json = ->(obj, **opts) { Yajl::Encoder.encode(obj, opts) }
38
+ ```
41
39
 
42
- [MultiJson]: https://github.com/intridea/multi_json
43
40
  [Yajl]: https://github.com/brianmario/yajl-ruby
44
41
 
45
42
  ## Handling lists of models
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: granola-schema
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
  - Nicolas Sanguinetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-11 00:00:00.000000000 Z
11
+ date: 2015-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: granola
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.3
19
+ version: 0.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.3
26
+ version: 0.0.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json-schema
29
29
  requirement: !ruby/object:Gem::Requirement