halogen 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 +4 -4
- data/.rspec +1 -0
- data/examples/simple.rb +0 -2
- data/halogen.gemspec +0 -2
- data/lib/halogen.rb +4 -2
- data/lib/halogen/collection.rb +4 -2
- data/lib/halogen/configuration.rb +0 -2
- data/lib/halogen/definition.rb +0 -2
- data/lib/halogen/definitions.rb +0 -2
- data/lib/halogen/embeds.rb +0 -2
- data/lib/halogen/embeds/definition.rb +0 -2
- data/lib/halogen/errors.rb +0 -2
- data/lib/halogen/links.rb +0 -2
- data/lib/halogen/links/definition.rb +0 -2
- data/lib/halogen/properties.rb +0 -2
- data/lib/halogen/properties/definition.rb +0 -2
- data/lib/halogen/railtie.rb +0 -2
- data/lib/halogen/resource.rb +0 -2
- data/lib/halogen/version.rb +1 -3
- data/spec/halogen/collection_spec.rb +8 -4
- data/spec/halogen/configuration_spec.rb +0 -4
- data/spec/halogen/definition_spec.rb +0 -4
- data/spec/halogen/definitions_spec.rb +0 -4
- data/spec/halogen/embeds/definition_spec.rb +0 -4
- data/spec/halogen/embeds_spec.rb +0 -4
- data/spec/halogen/links/definition_spec.rb +0 -4
- data/spec/halogen/links_spec.rb +0 -4
- data/spec/halogen/properties_spec.rb +1 -5
- data/spec/halogen/resource_spec.rb +8 -4
- data/spec/halogen_spec.rb +0 -4
- data/spec/spec_helper.rb +0 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c62f14505c88ffe62f4e1e1af9c33042085487a0
|
4
|
+
data.tar.gz: dd50a9b49f2dde6dcc5a98f4574781705f4bc0f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd96db9e68d366e50b9f2a5c389a12c488e96026204637718ab15af0b4fa3fbbe6f82423a8205e2b5a99067af550d3bbcde8677c8a735ac6baecf28b41cb8d39
|
7
|
+
data.tar.gz: 773469f71d6634b3a02dbbca72d444d2d1057e1a1986040677ef8f889c43f6d50f10c26a8557ea2715a095a00ca237aea2f74bd1568c15a0d09b67fcbcec40fd
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/examples/simple.rb
CHANGED
data/halogen.gemspec
CHANGED
data/lib/halogen.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# encoding: utf-8
|
3
|
-
#
|
4
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__)))
|
5
3
|
|
6
4
|
require 'json'
|
@@ -90,6 +88,10 @@ module Halogen
|
|
90
88
|
@depth ||= parent ? parent.depth + 1 : 0
|
91
89
|
end
|
92
90
|
|
91
|
+
def collection?
|
92
|
+
false
|
93
|
+
end
|
94
|
+
|
93
95
|
protected
|
94
96
|
|
95
97
|
# Allow included modules to decorate rendered hash
|
data/lib/halogen/collection.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
#
|
3
1
|
module Halogen
|
4
2
|
# Behavior for representers with a primary collection resource.
|
5
3
|
#
|
@@ -39,6 +37,10 @@ module Halogen
|
|
39
37
|
def embed?(key)
|
40
38
|
key == self.class.collection_name
|
41
39
|
end
|
40
|
+
|
41
|
+
def collection?
|
42
|
+
true
|
43
|
+
end
|
42
44
|
end
|
43
45
|
end
|
44
46
|
end
|
data/lib/halogen/definition.rb
CHANGED
data/lib/halogen/definitions.rb
CHANGED
data/lib/halogen/embeds.rb
CHANGED
data/lib/halogen/errors.rb
CHANGED
data/lib/halogen/links.rb
CHANGED
data/lib/halogen/properties.rb
CHANGED
data/lib/halogen/railtie.rb
CHANGED
data/lib/halogen/resource.rb
CHANGED
data/lib/halogen/version.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
#
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
1
|
describe Halogen::Collection do
|
6
2
|
let :klass do
|
7
3
|
Class.new do
|
@@ -56,5 +52,13 @@ describe Halogen::Collection do
|
|
56
52
|
expect(klass.new.embed?('foo')).to eq(false)
|
57
53
|
end
|
58
54
|
end
|
55
|
+
|
56
|
+
describe '#collection?' do
|
57
|
+
it 'is true' do
|
58
|
+
repr = klass.new
|
59
|
+
|
60
|
+
expect(repr.collection?).to eq(true)
|
61
|
+
end
|
62
|
+
end
|
59
63
|
end
|
60
64
|
end
|
data/spec/halogen/embeds_spec.rb
CHANGED
data/spec/halogen/links_spec.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
#
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
1
|
describe Halogen::Properties do
|
6
2
|
let :klass do
|
7
3
|
Class.new { include Halogen }
|
@@ -9,7 +5,7 @@ describe Halogen::Properties do
|
|
9
5
|
|
10
6
|
describe Halogen::Properties::ClassMethods do
|
11
7
|
describe '#property' do
|
12
|
-
it 'defines property
|
8
|
+
it 'defines property' do
|
13
9
|
expect {
|
14
10
|
klass.property(:foo)
|
15
11
|
}.to change(klass.definitions, :size).by(1)
|
@@ -1,7 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
#
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
1
|
describe Halogen::Resource do
|
6
2
|
let :klass do
|
7
3
|
Class.new do
|
@@ -74,4 +70,12 @@ describe Halogen::Resource do
|
|
74
70
|
end
|
75
71
|
end
|
76
72
|
end
|
73
|
+
|
74
|
+
describe '#collection?' do
|
75
|
+
it 'is false' do
|
76
|
+
repr = klass.new(nil)
|
77
|
+
|
78
|
+
expect(repr.collection?).to eq(false)
|
79
|
+
end
|
80
|
+
end
|
77
81
|
end
|
data/spec/halogen_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: halogen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heather Rivers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -103,6 +103,7 @@ extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
105
|
- ".gitignore"
|
106
|
+
- ".rspec"
|
106
107
|
- ".travis.yml"
|
107
108
|
- Gemfile
|
108
109
|
- LICENSE.txt
|
@@ -176,4 +177,3 @@ test_files:
|
|
176
177
|
- spec/halogen/resource_spec.rb
|
177
178
|
- spec/halogen_spec.rb
|
178
179
|
- spec/spec_helper.rb
|
179
|
-
has_rdoc:
|