halogen 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03f1c7cbbf77576c156629d55eb72a584853202d
4
- data.tar.gz: b58d6a047ada10cbf8420c58c5d10834a054023f
3
+ metadata.gz: c62f14505c88ffe62f4e1e1af9c33042085487a0
4
+ data.tar.gz: dd50a9b49f2dde6dcc5a98f4574781705f4bc0f6
5
5
  SHA512:
6
- metadata.gz: c18323cfdca7e3611c12a98d90b98447554fc7910f6db87a476051e79f48bad919757b5f885c2448584178f788783cf370068216ce82ca13169d373a8f6cfccd
7
- data.tar.gz: 7e72385b86d49fccb69ffded60a2ee5fde898423d25f4339aef5b690354e8b0ddd81e315ec3f809df0e8ee6d9c6d2014cf64bc9bfca3adfd795fb76d85b5ff62
6
+ metadata.gz: dd96db9e68d366e50b9f2a5c389a12c488e96026204637718ab15af0b4fa3fbbe6f82423a8205e2b5a99067af550d3bbcde8677c8a735ac6baecf28b41cb8d39
7
+ data.tar.gz: 773469f71d6634b3a02dbbca72d444d2d1057e1a1986040677ef8f889c43f6d50f10c26a8557ea2715a095a00ca237aea2f74bd1568c15a0d09b67fcbcec40fd
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  $LOAD_PATH.unshift(File.expand_path('../lib', File.dirname(__FILE__)))
4
2
 
5
3
  require 'halogen'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  lib = File.expand_path('../lib', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'halogen/version'
@@ -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
@@ -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
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  # Simple configuration class
5
3
  #
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  # Stores instructions for how to render a value for a given representer
5
3
  # instance
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  # Each representer class has a Halogen::Definitions instance which stores
5
3
  # Halogen::Definition instances by type.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  module Embeds # :nodoc:
5
3
  def self.included(base) # :nodoc:
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  module Embeds
5
3
  class Definition < Halogen::Definition # :nodoc:
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  class InvalidCollection < StandardError; end # :nodoc
5
3
  class InvalidDefinition < StandardError; end # :nodoc
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  module Links # :nodoc:
5
3
  def self.included(base) # :nodoc:
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  module Links
5
3
  class Definition < Halogen::Definition # :nodoc
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  module Properties # :nodoc:
5
3
  def self.included(base) # :nodoc:
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  module Properties
5
3
  class Definition < Halogen::Definition # :nodoc
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  # Provide Rails-specific extensions if loaded in a Rails application
5
3
  #
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
2
  # Behavior for representers with a single primary resource
5
3
  #
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  module Halogen
4
- VERSION = '0.0.3' # :nodoc:
2
+ VERSION = '0.0.4' # :nodoc:
5
3
  end
@@ -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
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Configuration do
6
2
  describe '#extensions' do
7
3
  it 'is empty array by default' do
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Definition do
6
2
  describe '#initialize' do
7
3
  it 'symbolizes option keys' do
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Definitions do
6
2
  let :definitions do
7
3
  Halogen::Definitions.new
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Embeds::Definition do
6
2
  describe '#validate' do
7
3
  it 'returns true with procedure' do
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Embeds do
6
2
  let :klass do
7
3
  Class.new do
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Links::Definition do
6
2
  describe '#validate' do
7
3
  it 'returns true with procedure' do
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen::Links do
6
2
  let :klass do
7
3
  Class.new { include Halogen }
@@ -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 'do
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
@@ -1,7 +1,3 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
1
  describe Halogen do
6
2
  let :klass do
7
3
  Class.new { include Halogen }
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
- #
3
1
  require 'simplecov'
4
2
  SimpleCov.start do
5
3
  add_filter '/spec'
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.3
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: 2015-04-08 00:00:00.000000000 Z
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: