middleman-dato 0.5.4 → 0.5.5

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: 36386f8ea83e576c50d4225e71cbcae6928bc23c
4
- data.tar.gz: a69c045a5b3a28c7c7ade632957f6ce61bbf28f4
3
+ metadata.gz: 7ff8e25ba2b42d4c9257c781ac93dfd2958a87a2
4
+ data.tar.gz: 01e264b94982172f60542ac2572efe9721796a4f
5
5
  SHA512:
6
- metadata.gz: 64fdb0bc70f1e9dea5f2627d8b723e4d14d8347e422a758684cad0086ad84dd0d33c757eec5384ad9a920a932d5cd57de1c1aaa4d8276dde15b65c456d875fd4
7
- data.tar.gz: 4eb712686a7df98e2493a3e4e5dc66d5a7947c8cb9518e74ad7c0310ad2ea17913361e67c91906885f25d6936f022729e8dfb5302f21acdd6f53cab47acaa572
6
+ metadata.gz: e233bbab2ea96ba8bc9b6bb5365d7353415ae35997586128665a7d9eba04e45b5f518dbc6c31a048f0bc678e053b3f2f1ead7ed9002c364822479741cf212db8
7
+ data.tar.gz: 537ff8cc6c89d485e907d92250748c6dde59eab1fca2a6983af334ab586b744b26580991eb701cc6f7ba2bff065b771422ad55f01f0c3718566218ae0fde016b
@@ -23,7 +23,7 @@ module Dato
23
23
  @file ||= Imgix::Client.new(
24
24
  host: 'dato-images.imgix.net',
25
25
  secure: true
26
- ).path(path).ch("DPR", "Width").auto("compress", "format")
26
+ ).path(path).ch('DPR', 'Width').auto('compress', 'format')
27
27
  end
28
28
  end
29
29
  end
@@ -1,4 +1,4 @@
1
- require "dato/field_type/file"
1
+ require 'dato/field_type/file'
2
2
 
3
3
  module Dato
4
4
  module FieldType
data/lib/dato/record.rb CHANGED
@@ -38,15 +38,17 @@ module Dato
38
38
  end
39
39
 
40
40
  def content_type
41
- entity.content_type
41
+ @content_type ||= entity.content_type
42
42
  end
43
43
 
44
44
  def fields
45
- content_type.fields.sort_by(&:position)
45
+ @fields ||= content_type.fields.sort_by(&:position)
46
46
  end
47
47
 
48
48
  def attributes
49
- fields.each_with_object(ActiveSupport::HashWithIndifferentAccess.new) do |field, acc|
49
+ @attributes ||= fields.each_with_object(
50
+ ActiveSupport::HashWithIndifferentAccess.new
51
+ ) do |field, acc|
50
52
  acc[field.api_key.to_sym] = send(field.api_key)
51
53
  end
52
54
  end
@@ -1,6 +1,6 @@
1
- require "middleman-core"
1
+ require 'middleman-core'
2
2
 
3
3
  Middleman::Extensions.register(:dato) do
4
- require "dato/middleman_extension"
4
+ require 'dato/middleman_extension'
5
5
  Dato::MiddlemanExtension
6
6
  end
@@ -3,7 +3,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'middleman-dato'
6
- s.version = '0.5.4'
6
+ s.version = '0.5.5'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Stefano Verna']
9
9
  s.email = ['s.verna@cantierecreativo.net']
@@ -71,7 +71,10 @@ module Dato
71
71
 
72
72
  describe '#attributes' do
73
73
  it 'returns an hash of the field values' do
74
- expected_attributes = { title: "My titlè with àccents", body: 'Hi there' }
74
+ expected_attributes = {
75
+ 'title' => "My titlè with àccents",
76
+ 'body' => 'Hi there'
77
+ }
75
78
  expect(record.attributes).to eq expected_attributes
76
79
  end
77
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna