locomotivecms_wagon 2.0.0.rc5 → 2.0.0.rc6

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: 3ec6622d8b17580c78b7d74ce43267db20a84f32
4
- data.tar.gz: c155e38db2000ce5c619260f44ab08fed2d6fb2a
3
+ metadata.gz: f762fee2b5e2a55c9000323e814145d6c09cf732
4
+ data.tar.gz: 7ff6dbc6a2d00eb28b4e2259db598c442eabb7e0
5
5
  SHA512:
6
- metadata.gz: f32d26356b9d0a6ed28015d47b64d4370c212d6eca3179a38685ad550ff9be89ddd6ea531eecb533165e09fc4684b81d66d71e9e3cca54397011df39855b10b9
7
- data.tar.gz: 2faf0ca74f7f472d3c2316824a26e893c1b4fc2673992ad9f3ee7b5b7a7e5010c003c74676e58c6831ca023ad1c158ae7cbeac8c2f17591ab0d65b2c01abdead
6
+ metadata.gz: dea5e635c441886ecf9231bbd7549f1991d0867e16df9761fc8aeda5dddb48f93cd733029e46b8eb2c28fa67d55a5b8f13104dc838a9443b1cc974ef252c75a1
7
+ data.tar.gz: e26b8a68906b25cfd1f8d1c78669fcd49fc9382f8b02aa67aa8843068dca0f5cceaa5cc44ae8263c081e5c7265522771da476e269fb9fd9310447ff66a1aa8da
@@ -12,4 +12,5 @@
12
12
  # host: www.example.com
13
13
  # email: john@doe.net
14
14
  # password: apassword
15
- # # api_key: <your api key here>
15
+ # # api_key: <your api key here>
16
+ # # ssl: true
@@ -12,4 +12,5 @@
12
12
  # host: www.example.com
13
13
  # email: john@doe.net
14
14
  # password: apassword
15
- # # api_key: <your api key here>
15
+ # # api_key: <your api key here>
16
+ # # ssl: true
@@ -100,7 +100,7 @@ module Locomotive::Wagon
100
100
  'handle' => site.handle,
101
101
  'email' => credentials[:email],
102
102
  'api_key' => credentials[:api_key]
103
- })
103
+ }.tap { |options| options['ssl'] = true if api_host.ends_with?(':443') })
104
104
  end
105
105
  end
106
106
 
@@ -95,7 +95,7 @@ module Locomotive
95
95
  [nil]
96
96
  else
97
97
  entries.map { |entry| entry._slug.try(:[], __locale__) }.compact
98
- end.tap { |o| puts o.inspect }
98
+ end
99
99
  end
100
100
 
101
101
  def decorate_has_many_field(value)
@@ -1,5 +1,5 @@
1
1
  module Locomotive
2
2
  module Wagon
3
- VERSION = '2.0.0.rc5'
3
+ VERSION = '2.0.0.rc6'
4
4
  end
5
5
  end
@@ -27,8 +27,8 @@ Gem::Specification.new do |gem|
27
27
  gem.add_dependency 'netrc', '~> 0.10.3'
28
28
 
29
29
  gem.add_dependency 'locomotivecms_common', '~> 0.0.5'
30
- gem.add_dependency 'locomotivecms_coal', '~> 1.0.0.rc3'
31
- gem.add_dependency 'locomotivecms_steam', '~> 1.0.0.rc7'
30
+ gem.add_dependency 'locomotivecms_coal', '~> 1.0.0.rc4'
31
+ gem.add_dependency 'locomotivecms_steam', '~> 1.0.0.rc9'
32
32
 
33
33
  gem.add_dependency 'listen', '~> 3.0.4'
34
34
  gem.add_dependency 'rack-livereload', '~> 0.3.16'
@@ -0,0 +1,70 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ require 'chronic'
6
+ require 'locomotive/steam'
7
+ require 'locomotive/wagon/decorators/concerns/to_hash_concern'
8
+ require 'locomotive/wagon/decorators/concerns/persist_assets_concern'
9
+ require 'locomotive/wagon/decorators/content_entry_decorator'
10
+
11
+ describe Locomotive::Wagon::ContentEntryDecorator do
12
+
13
+ let(:content_type) { instance_double('ContentType', fields: fields) }
14
+ let(:entry) { instance_double('ContentEntry', attributes.merge(content_type: content_type, localized_attributes: [])) }
15
+ let(:decorator) { described_class.new(entry, 'en', '.') }
16
+
17
+ before { allow(decorator).to receive(:_slug).and_return('sample') }
18
+
19
+ describe '#to_hash' do
20
+
21
+ describe 'no field' do
22
+
23
+ let(:fields) { instance_double('Fields', by_name: nil, no_associations: []) }
24
+ let(:attributes) { {} }
25
+
26
+ subject { decorator.to_hash }
27
+
28
+ it { is_expected.to eq({}) }
29
+
30
+ end
31
+
32
+ describe 'string field' do
33
+
34
+ let(:field) { instance_double('Field', name: 'title', type: 'string') }
35
+ let(:fields) { instance_double('Fields', by_name: field, no_associations: [field]) }
36
+ let(:attributes) { { title: 'Hello world' } }
37
+
38
+ subject { decorator.to_hash }
39
+
40
+ it { is_expected.to eq({ _slug: 'sample', title: 'Hello world' }) }
41
+
42
+ end
43
+
44
+ describe 'date field' do
45
+
46
+ let(:field) { instance_double('Field', name: 'posted_at', type: 'date') }
47
+ let(:fields) { instance_double('Fields', by_name: field, no_associations: [field]) }
48
+ let(:attributes) { { posted_at: Chronic.parse('2015-09-26').to_date } }
49
+
50
+ subject { decorator.to_hash }
51
+
52
+ it { is_expected.to eq({ _slug: 'sample', posted_at: '2015-09-26' }) }
53
+
54
+ end
55
+
56
+ describe 'date time field' do
57
+
58
+ let(:field) { instance_double('Field', name: 'posted_at', type: 'date_time') }
59
+ let(:fields) { instance_double('Fields', by_name: field, no_associations: [field]) }
60
+ let(:attributes) { { posted_at: Chronic.parse('2015-11-11 18:00:00 +0100').to_datetime } }
61
+
62
+ subject { decorator.to_hash }
63
+
64
+ it { is_expected.to eq({ _slug: 'sample', posted_at: '2015-11-11T18:00:00+01:00' }) }
65
+
66
+ end
67
+
68
+ end
69
+
70
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms_wagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc5
4
+ version: 2.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-04 00:00:00.000000000 Z
12
+ date: 2015-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -101,28 +101,28 @@ dependencies:
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: 1.0.0.rc3
104
+ version: 1.0.0.rc4
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: 1.0.0.rc3
111
+ version: 1.0.0.rc4
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: locomotivecms_steam
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 1.0.0.rc7
118
+ version: 1.0.0.rc9
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 1.0.0.rc7
125
+ version: 1.0.0.rc9
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: listen
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -620,6 +620,7 @@ files:
620
620
  - spec/support/vcr.rb
621
621
  - spec/unit/commands/pull_sub_commands/concerns/assets_concern_spec.rb
622
622
  - spec/unit/commands/push_sub_commands/push_theme_assets_command_spec.rb
623
+ - spec/unit/decorators/content_entry_decorator_spec.rb
623
624
  - spec/unit/decorators/site_decorator_spec.rb
624
625
  - spec/unit/decorators/theme_asset_decorator_spec.rb
625
626
  homepage: http://www.locomotivecms.com
@@ -642,7 +643,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
642
643
  version: 1.3.1
643
644
  requirements: []
644
645
  rubyforge_project:
645
- rubygems_version: 2.5.0
646
+ rubygems_version: 2.4.5.1
646
647
  signing_key:
647
648
  specification_version: 4
648
649
  summary: The LocomotiveCMS wagon is a site generator for the LocomotiveCMS engine
@@ -750,5 +751,6 @@ test_files:
750
751
  - spec/support/vcr.rb
751
752
  - spec/unit/commands/pull_sub_commands/concerns/assets_concern_spec.rb
752
753
  - spec/unit/commands/push_sub_commands/push_theme_assets_command_spec.rb
754
+ - spec/unit/decorators/content_entry_decorator_spec.rb
753
755
  - spec/unit/decorators/site_decorator_spec.rb
754
756
  - spec/unit/decorators/theme_asset_decorator_spec.rb