middleman-dato 0.5.10 → 0.5.11

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: 66f8b84f068ef2285a1084e62f59b07e688fe81e
4
- data.tar.gz: b4c83ba00f33a2fe48692241ea818a3b39d778a2
3
+ metadata.gz: 519b5e7c70abb154e4337b7e96ea0ff4d1adc8e5
4
+ data.tar.gz: 871ed43fb056f16e148f18fc749069e293696fa0
5
5
  SHA512:
6
- metadata.gz: 10061b7196f9bf326afb551fbc88a798f7e3ffae12538253447c95f3d303c3026ac381059c8ae57d273c0b4bb7baef9bf3bf8da03de21888918182bf84d3339c
7
- data.tar.gz: ff9fcf1950fa73b25b11031f3992b9727f2e1c82ba0a46343c4184dc6d890f2c532d103db7a2140619047385fd1e67cc9c174881903f752ae9c110be14234473
6
+ metadata.gz: 9c2befa059eb8612172d413ba703040ab8e2cf269b7852ab9ee049fde47d555de46d081cb694db41f32362bf36ca8af1f0757a0992605072abe86dc72a8f158f
7
+ data.tar.gz: 08946b373c814a4590b258ac70f906da03eb547f4c282399402aae626b55c6efa7cc498147282dfd219c8adb8666cc6e9a672fb72fb8c4c0df8eaf981f6b8f5c
data/lib/dato/record.rb CHANGED
@@ -18,6 +18,10 @@ module Dato
18
18
  @records_repo = records_repo
19
19
  end
20
20
 
21
+ def ==(record)
22
+ record.is_a?(Record) && record.id == id
23
+ end
24
+
21
25
  def slug
22
26
  if singleton?
23
27
  content_type.api_key.humanize.parameterize
@@ -0,0 +1,4 @@
1
+ module Dato
2
+ VERSION = '0.5.11'
3
+ end
4
+
@@ -1,9 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'dato/version'
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = 'middleman-dato'
6
- s.version = '0.5.10'
7
+ s.version = Dato::VERSION
7
8
  s.platform = Gem::Platform::RUBY
8
9
  s.authors = ['Stefano Verna']
9
10
  s.email = ['s.verna@cantierecreativo.net']
@@ -162,5 +162,27 @@ module Dato
162
162
  end
163
163
  end
164
164
  end
165
+
166
+ context 'equality' do
167
+ subject(:same_record) { described_class.new(entity, repo) }
168
+
169
+ subject(:another_record) { described_class.new(another_entity, repo) }
170
+ let(:another_entity) do
171
+ double(
172
+ 'Dato::JsonApiEntity(Record)',
173
+ id: '15'
174
+ )
175
+ end
176
+
177
+
178
+ it 'two records are equal if their id is the same' do
179
+ expect(record).to eq same_record
180
+ end
181
+
182
+ it 'else they\'re not' do
183
+ expect(record).not_to eq another_record
184
+ expect(record).not_to eq "foobar"
185
+ end
186
+ end
165
187
  end
166
188
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-20 00:00:00.000000000 Z
11
+ date: 2016-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -145,6 +145,7 @@ files:
145
145
  - lib/dato/record.rb
146
146
  - lib/dato/records_repo.rb
147
147
  - lib/dato/space.rb
148
+ - lib/dato/version.rb
148
149
  - lib/middleman-dato.rb
149
150
  - middleman-dato.gemspec
150
151
  - spec/dato/entities_repo_spec.rb