locomotivecms_wagon 2.0.1 → 2.1.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/generators/blank/config/metafields_schema.yml +56 -0
  4. data/generators/blank/config/site.yml.tt +14 -0
  5. data/generators/bootstrap/config/metafields_schema.yml +56 -0
  6. data/generators/bootstrap/config/site.yml.tt +14 -0
  7. data/generators/foundation5/config/metafields_schema.yml +56 -0
  8. data/generators/foundation5/config/site.yml.tt +14 -0
  9. data/generators/site_metafields/schema.yml.tt +56 -0
  10. data/lib/locomotive/wagon/cli.rb +11 -1
  11. data/lib/locomotive/wagon/commands/concerns/steam_concern.rb +4 -3
  12. data/lib/locomotive/wagon/commands/pull_command.rb +1 -1
  13. data/lib/locomotive/wagon/commands/pull_sub_commands/concerns/assets_concern.rb +8 -0
  14. data/lib/locomotive/wagon/commands/pull_sub_commands/pull_site_command.rb +24 -1
  15. data/lib/locomotive/wagon/commands/push_sub_commands/push_site_command.rb +3 -1
  16. data/lib/locomotive/wagon/commands/serve_command.rb +15 -0
  17. data/lib/locomotive/wagon/commands/sync_command.rb +1 -1
  18. data/lib/locomotive/wagon/commands/sync_sub_commands/sync_site_command.rb +31 -0
  19. data/lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb +8 -0
  20. data/lib/locomotive/wagon/decorators/content_entry_decorator.rb +1 -0
  21. data/lib/locomotive/wagon/decorators/site_decorator.rb +13 -1
  22. data/lib/locomotive/wagon/generators/site_metafields.rb +54 -0
  23. data/lib/locomotive/wagon/tools/yaml_ext.rb +21 -0
  24. data/lib/locomotive/wagon/version.rb +1 -1
  25. data/locomotivecms_wagon.gemspec +4 -4
  26. data/spec/fixtures/cassettes/authenticate.yml +41 -82
  27. data/spec/fixtures/cassettes/delete.yml +159 -159
  28. data/spec/fixtures/cassettes/push.yml +1015 -1015
  29. data/spec/integration/cli_spec.rb +1 -1
  30. data/spec/unit/decorators/content_entry_decorator_spec.rb +10 -0
  31. data/spec/unit/tools/yaml_ext_spec.rb +46 -0
  32. metadata +21 -12
@@ -10,7 +10,7 @@ describe Locomotive::Wagon::CLI do
10
10
  describe '#version' do
11
11
 
12
12
  let(:command) { Locomotive::Wagon::CLI::Main.start(['version']) }
13
- it { is_expected.to match /^2.0.1/ }
13
+ it { is_expected.to match /^2.1.0/ }
14
14
 
15
15
  end
16
16
 
@@ -52,6 +52,11 @@ describe Locomotive::Wagon::ContentEntryDecorator do
52
52
 
53
53
  it { is_expected.to eq({ _slug: 'sample', posted_at: '2015-09-26' }) }
54
54
 
55
+ context 'nil field' do
56
+ let(:attributes) { { posted_at: nil } }
57
+ it { is_expected.to eq({}) }
58
+ end
59
+
55
60
  end
56
61
 
57
62
  describe 'date time field' do
@@ -64,6 +69,11 @@ describe Locomotive::Wagon::ContentEntryDecorator do
64
69
 
65
70
  it { is_expected.to eq({ _slug: 'sample', posted_at: '2015-11-11T17:00:00+00:00' }) }
66
71
 
72
+ context 'nil field' do
73
+ let(:attributes) { { posted_at: nil } }
74
+ it { is_expected.to eq({}) }
75
+ end
76
+
67
77
  end
68
78
 
69
79
  end
@@ -0,0 +1,46 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ require_relative '../../../lib/locomotive/wagon/tools/yaml_ext.rb'
6
+
7
+ describe Locomotive::Wagon::YamlExt do
8
+
9
+ describe '.transform' do
10
+
11
+ let(:hash) { nil }
12
+ let(:block) { -> (value) { value + '!' } }
13
+
14
+ subject { described_class.transform(hash, &block); hash }
15
+
16
+ it { expect(subject).to eq nil }
17
+
18
+ describe 'simple hash' do
19
+
20
+ let(:hash) { { 'foo' => 'a', 'bar' => 'b' } }
21
+
22
+ it { expect(subject['foo']).to eq 'a!' }
23
+ it { expect(subject['bar']).to eq 'b!' }
24
+
25
+ end
26
+
27
+ describe 'hash of hashes' do
28
+
29
+ let(:hash) { { 'foo' => { 'bar' => 'a' } } }
30
+
31
+ it { expect(subject['foo']['bar']).to eq 'a!' }
32
+
33
+ end
34
+
35
+ describe 'hash with an array' do
36
+
37
+ let(:hash) { { 'foo' => [{ 'bar' => 'a' }, 2] } }
38
+
39
+ it { expect(subject['foo'][0]['bar']).to eq 'a!' }
40
+
41
+ end
42
+
43
+
44
+ end
45
+
46
+ 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.1
4
+ version: 2.1.0.rc3
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: 2016-02-16 00:00:00.000000000 Z
12
+ date: 2016-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -87,42 +87,42 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.0.5
90
+ version: 0.1.0
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.0.5
97
+ version: 0.1.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: locomotivecms_coal
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: 1.0.0
104
+ version: 1.1.0
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
111
+ version: 1.1.0
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.1
118
+ version: 1.1.0.rc1
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.1
125
+ version: 1.1.0.rc1
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: listen
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -171,14 +171,14 @@ dependencies:
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: 1.4.3
174
+ version: '1.6'
175
175
  type: :runtime
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: 1.4.3
181
+ version: '1.6'
182
182
  description: The LocomotiveCMS wagon is a site generator for the LocomotiveCMS engine
183
183
  email:
184
184
  - did@locomotivecms.com
@@ -206,6 +206,7 @@ files:
206
206
  - generators/blank/app/views/pages/index.liquid.haml
207
207
  - generators/blank/app/views/snippets/.empty_directory
208
208
  - generators/blank/config/deploy.yml
209
+ - generators/blank/config/metafields_schema.yml
209
210
  - generators/blank/config/site.yml.tt
210
211
  - generators/blank/config/translations.yml
211
212
  - generators/blank/data/.empty_directory
@@ -230,6 +231,7 @@ files:
230
231
  - generators/bootstrap/app/views/snippets/nav.liquid
231
232
  - generators/bootstrap/app/views/snippets/nav.liquid.haml
232
233
  - generators/bootstrap/config/deploy.yml
234
+ - generators/bootstrap/config/metafields_schema.yml
233
235
  - generators/bootstrap/config/site.yml.tt
234
236
  - generators/bootstrap/config/translations.yml
235
237
  - generators/bootstrap/data/.empty_directory
@@ -351,6 +353,7 @@ files:
351
353
  - generators/foundation5/app/views/pages/index.liquid
352
354
  - generators/foundation5/app/views/pages/index.liquid.haml
353
355
  - generators/foundation5/config/deploy.yml
356
+ - generators/foundation5/config/metafields_schema.yml
354
357
  - generators/foundation5/config/site.yml.tt
355
358
  - generators/foundation5/config/translations.yml
356
359
  - generators/foundation5/data/.empty_directory
@@ -440,6 +443,7 @@ files:
440
443
  - generators/foundation5/public/stylesheets/normalize.css.scss
441
444
  - generators/page/template.liquid.haml.tt
442
445
  - generators/page/template.liquid.tt
446
+ - generators/site_metafields/schema.yml.tt
443
447
  - generators/snippet/template.liquid.haml.tt
444
448
  - generators/snippet/template.liquid.tt
445
449
  - lib/locomotive/wagon.rb
@@ -485,6 +489,7 @@ files:
485
489
  - lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
486
490
  - lib/locomotive/wagon/commands/sync_sub_commands/sync_content_entries_command.rb
487
491
  - lib/locomotive/wagon/commands/sync_sub_commands/sync_pages_command.rb
492
+ - lib/locomotive/wagon/commands/sync_sub_commands/sync_site_command.rb
488
493
  - lib/locomotive/wagon/commands/sync_sub_commands/sync_translations_command.rb
489
494
  - lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb
490
495
  - lib/locomotive/wagon/decorators/concerns/to_hash_concern.rb
@@ -511,6 +516,7 @@ files:
511
516
  - lib/locomotive/wagon/generators/site/foundation5.rb
512
517
  - lib/locomotive/wagon/generators/site/line_case.rb
513
518
  - lib/locomotive/wagon/generators/site/unzip.rb
519
+ - lib/locomotive/wagon/generators/site_metafields.rb
514
520
  - lib/locomotive/wagon/generators/snippet.rb
515
521
  - lib/locomotive/wagon/middlewares/error_page.rb
516
522
  - lib/locomotive/wagon/tools/glob.rb
@@ -518,6 +524,7 @@ files:
518
524
  - lib/locomotive/wagon/tools/styled_yaml.rb
519
525
  - lib/locomotive/wagon/tools/tcp_port.rb
520
526
  - lib/locomotive/wagon/tools/thor.rb
527
+ - lib/locomotive/wagon/tools/yaml_ext.rb
521
528
  - lib/locomotive/wagon/version.rb
522
529
  - locomotivecms_wagon.gemspec
523
530
  - spec/fixtures/blog/app/content_types/comments.yml
@@ -628,6 +635,7 @@ files:
628
635
  - spec/unit/decorators/site_decorator_spec.rb
629
636
  - spec/unit/decorators/theme_asset_decorator_spec.rb
630
637
  - spec/unit/tools/glob_spec.rb
638
+ - spec/unit/tools/yaml_ext_spec.rb
631
639
  homepage: http://www.locomotivecms.com
632
640
  licenses:
633
641
  - MIT
@@ -643,9 +651,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
643
651
  version: '0'
644
652
  required_rubygems_version: !ruby/object:Gem::Requirement
645
653
  requirements:
646
- - - ">="
654
+ - - ">"
647
655
  - !ruby/object:Gem::Version
648
- version: '0'
656
+ version: 1.3.1
649
657
  requirements: []
650
658
  rubyforge_project:
651
659
  rubygems_version: 2.4.5.1
@@ -763,3 +771,4 @@ test_files:
763
771
  - spec/unit/decorators/site_decorator_spec.rb
764
772
  - spec/unit/decorators/theme_asset_decorator_spec.rb
765
773
  - spec/unit/tools/glob_spec.rb
774
+ - spec/unit/tools/yaml_ext_spec.rb