collection-json 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 652b732bd385605d20ccca73d5f196d5a0a0edef
4
+ data.tar.gz: 3a7979c04c027d5e92b84a6db7e47d57b7928384
5
+ SHA512:
6
+ metadata.gz: 68c270e30e42e8334d7fdbd410a06f48d18a51b529ab6127fde6e1548cc237ca373416f5870a3fa26014208608fdff9ea708815e2b4fdee8ec7d7b9579e32654
7
+ data.tar.gz: 08f06e73ad0a5d85e216e35616eab49d6b22c9a2daa488d114276327423b91fbf813f4f835dde9a286d6ecc66f9f76a76c83f4ceb9259d75edd552f16b5250b8
data/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Copyright 2011-2012 Sebastian Edwards
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+ All of the files in this project are under the project-wide license
16
+ unless they are otherwise marked.
17
+
@@ -13,7 +13,7 @@ module CollectionJSON
13
13
  def self.attribute(name, opts={})
14
14
  nested_attributes << name
15
15
  define_method(name) do |arg=nil|
16
- if arg
16
+ if arg != nil
17
17
  if opts[:transform]
18
18
  instance_variable_set(:"@#{name}", opts[:transform].call(arg))
19
19
  else
@@ -5,7 +5,7 @@ module CollectionJSON
5
5
  end
6
6
 
7
7
  def set_error(params = {})
8
- @collection.error = params
8
+ @collection.error params
9
9
  end
10
10
 
11
11
  def add_link(href, rel, params = {})
@@ -1,3 +1,3 @@
1
1
  module CollectionJSON
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'collection-json/attributes/data'
3
+
4
+ describe CollectionJSON::Data do
5
+ it 'displays value "false"' do
6
+ CollectionJSON::Data.from_hash(value: false).to_json.should == "{\"value\":false}"
7
+ end
8
+ end
metadata CHANGED
@@ -1,27 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collection-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sebastian Edwards
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
- requirement: &70308908269160 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *70308908269160
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  description: Lightweight gem for building Collection+JSON responses.
26
28
  email:
27
29
  - sebastian@uprise.co.nz
@@ -29,8 +31,9 @@ executables: []
29
31
  extensions: []
30
32
  extra_rdoc_files: []
31
33
  files:
32
- - .gitignore
34
+ - ".gitignore"
33
35
  - Gemfile
36
+ - LICENSE
34
37
  - README.md
35
38
  - Rakefile
36
39
  - collection-json.gemspec
@@ -48,6 +51,7 @@ files:
48
51
  - lib/collection-json/transformers/uri.rb
49
52
  - lib/collection-json/version.rb
50
53
  - spec/collection-json/attributes/collection_spec.rb
54
+ - spec/collection-json/attributes/data_spec.rb
51
55
  - spec/collection-json/attributes/item_spec.rb
52
56
  - spec/collection-json/attributes/template_spec.rb
53
57
  - spec/collection-json/transformers/uri_spec.rb
@@ -55,30 +59,30 @@ files:
55
59
  - spec/spec_helper.rb
56
60
  homepage: https://github.com/sebastianedwards/collection-json
57
61
  licenses: []
62
+ metadata: {}
58
63
  post_install_message:
59
64
  rdoc_options: []
60
65
  require_paths:
61
66
  - lib
62
67
  required_ruby_version: !ruby/object:Gem::Requirement
63
- none: false
64
68
  requirements:
65
- - - ! '>='
69
+ - - ">="
66
70
  - !ruby/object:Gem::Version
67
71
  version: '0'
68
72
  required_rubygems_version: !ruby/object:Gem::Requirement
69
- none: false
70
73
  requirements:
71
- - - ! '>='
74
+ - - ">="
72
75
  - !ruby/object:Gem::Version
73
76
  version: '0'
74
77
  requirements: []
75
78
  rubyforge_project: collection-json
76
- rubygems_version: 1.8.15
79
+ rubygems_version: 2.2.0
77
80
  signing_key:
78
- specification_version: 3
81
+ specification_version: 4
79
82
  summary: Builds Collection+JSON responses.
80
83
  test_files:
81
84
  - spec/collection-json/attributes/collection_spec.rb
85
+ - spec/collection-json/attributes/data_spec.rb
82
86
  - spec/collection-json/attributes/item_spec.rb
83
87
  - spec/collection-json/attributes/template_spec.rb
84
88
  - spec/collection-json/transformers/uri_spec.rb