spine-content_types 0.1.0 → 0.1.1

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: 96a41bba390eb00ef2d5e02d22fcd2ce6073ef91
4
- data.tar.gz: d5a6d0ba639a11ac3f4cf106839b75910c4a4d2a
3
+ metadata.gz: 7d847819bb0d756fd72d02cd44904efe8298197d
4
+ data.tar.gz: e8b1d7bc4f91776af1e9c0b236f1832d5a41c7ad
5
5
  SHA512:
6
- metadata.gz: c2e97cf22afa3f33293e51bd3389e55779cded610f31283c85087409f755946972d80c5feb5382571542688d23664ec3493e97e5039217eaa69d16c3bb96db98
7
- data.tar.gz: 7117284b507fc9929a2c5814040e77e48139865195138919f3b23a9141aa817112f3c6e3bbe1aad3fbeb52fb381a8ceb3912f94a4665d7edc350674f523514b4
6
+ metadata.gz: f63f8f893f6e32dd5221c5d2ce0e840cce493033156ba73e09893ac8e49f330c8b988df06545bf134f39bdd644e88b7d3707458dcd7cdb5236fb364d6b522e67
7
+ data.tar.gz: 8d477f944640511796b86a0170aeffdb76f554af06fc1b50d6518e03320f1e48a9f1d7faf87bdb3004d257f09afbedc38cb96b1c73529094ff3d8b749c28c43e
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ Changelog
2
+ =========
3
+
4
+ 0.1.1
5
+ -----
6
+ - Keeps Json default options in separate namespace
7
+
8
+ 0.1.0
9
+ -----
10
+ - First public release
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Spine::ContentTypes
2
2
 
3
- [![Gem Version](http://img.shields.io/gem/v/spine-content_types.svg)][gem]
3
+ [![Gem Version](https://badge.fury.io/rb/spine-content_types.svg)](http://badge.fury.io/rb/spine-content_types)
4
4
  [![Dependency Status](https://gemnasium.com/rspine/content_types.svg)](https://gemnasium.com/rspine/content_types)
5
5
  [![Code Climate](https://codeclimate.com/github/rspine/content_types/badges/gpa.svg)](https://codeclimate.com/github/rspine/content_types)
6
6
 
@@ -2,13 +2,28 @@ require 'multi_json'
2
2
 
3
3
  module Spine
4
4
  module ContentTypes
5
- module JsonMimeType
5
+ module Json
6
+ extend self
7
+
8
+ def load(data, options = {})
9
+ MultiJson.load(data, default_load_options.merge(options))
10
+ end
11
+
12
+ def dump(data, options)
13
+ MultiJson.dump(data, default_dump_options.merge(options))
14
+ end
15
+
6
16
  def mime_type
7
17
  'application/json'
8
18
  end
9
- end
10
19
 
11
- Json = MultiJson.extend(JsonMimeType)
12
- Json.default_load_options[:symbolize_keys] = true
20
+ def default_load_options
21
+ @default_load_options ||= { symbolize_keys: true }
22
+ end
23
+
24
+ def default_dump_options
25
+ @default_dump_options ||= {}
26
+ end
27
+ end
13
28
  end
14
29
  end
@@ -1,5 +1,5 @@
1
1
  module Spine
2
2
  module ContentTypes
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'spine/content_types/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spine-content_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TOGGL LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - Gemfile.lock
65
66
  - LICENSE