locomotivecms_wagon 1.3.3 → 1.4.0
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 +4 -4
- data/Gemfile +1 -0
- data/lib/locomotive/wagon/cli.rb +9 -3
- data/lib/locomotive/wagon/generators/site/base.rb +7 -0
- data/lib/locomotive/wagon/generators/site/blank.rb +0 -7
- data/lib/locomotive/wagon/generators/site/bootstrap2.rb +0 -7
- data/lib/locomotive/wagon/generators/site/bootstrap3.rb +0 -7
- data/lib/locomotive/wagon/generators/site/foundation.rb +0 -7
- data/lib/locomotive/wagon/version.rb +1 -1
- data/locomotivecms_wagon.gemspec +1 -1
- data/spec/fixtures/default/app/views/pages/index.liquid.haml +1 -1
- data/spec/fixtures/default/app/views/pages/music.liquid.haml +1 -1
- data/spec/integration/server/basic_spec.rb +3 -3
- data/spec/integration/server/liquid_spec.rb +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 610ad2611728515e34b9dc0aa880d165cbd4f439
|
|
4
|
+
data.tar.gz: b0ea22caa1d340f66625d33f62557014c75e8d15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 473b0954c4a345d62cf62bce29cff96383d9f4efad845a800fcc8dac01855b9996c89412008f1887661b5761bf1a4469535343035e34aded158b0227332824bb
|
|
7
|
+
data.tar.gz: aed80677e2a937b2c9deced219aa1ef277f2cf5ce1f1b175a31d7f8a44a4b8c49af0a9c7d4867e44ad90fd11fe453877b565759608aef9a662a574d22efacc1d
|
data/Gemfile
CHANGED
|
@@ -7,6 +7,7 @@ gemspec
|
|
|
7
7
|
# gem 'locomotivecms-liquid', path: '../gems/liquid', require: false
|
|
8
8
|
# gem 'locomotivecms-solid', path: '../gems/solid', require: false
|
|
9
9
|
# gem 'locomotivecms_mounter', path: '../gems/mounter', require: false
|
|
10
|
+
# gem 'locomotivecms_mounter', github: 'locomotivecms/mounter', ref: '34d24feeb8', require: false
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
gem 'rb-fsevent', '~> 0.9.1'
|
data/lib/locomotive/wagon/cli.rb
CHANGED
|
@@ -117,10 +117,12 @@ module Locomotive
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
desc 'init NAME [PATH]', 'Create a brand new LocomotiveCMS site'
|
|
120
|
-
method_option :template,
|
|
121
|
-
method_option :
|
|
120
|
+
method_option :template, aliases: '-t', type: 'string', default: 'blank', desc: 'instead of building from a blank site, you can have a pre-fetched site with form a template (see the templates command)'
|
|
121
|
+
method_option :lib, aliases: '-l', type: 'string', desc: 'Path to an external ruby lib or generator'
|
|
122
|
+
method_option :verbose, aliases: '-v', type: 'boolean', default: false, desc: 'display the full error stack trace if an error occurs'
|
|
122
123
|
def init(name, path = '.')
|
|
123
124
|
require 'locomotive/wagon/generators/site'
|
|
125
|
+
require File.expand_path(options[:lib]) if options[:lib]
|
|
124
126
|
generator = Locomotive::Wagon::Generators::Site.get(options[:template])
|
|
125
127
|
if generator.nil?
|
|
126
128
|
say "Unknown site template '#{options[:template]}'", :red
|
|
@@ -154,8 +156,10 @@ module Locomotive
|
|
|
154
156
|
subcommand 'generate', Generate
|
|
155
157
|
|
|
156
158
|
desc 'list_templates', 'List all the templates to create either a site or a content type'
|
|
159
|
+
method_option :lib, aliases: '-l', type: 'string', desc: 'Path to an external ruby lib or generator'
|
|
157
160
|
def list_templates
|
|
158
161
|
require 'locomotive/wagon/generators/site'
|
|
162
|
+
require File.expand_path(options[:lib]) if options[:lib]
|
|
159
163
|
if Locomotive::Wagon::Generators::Site.empty?
|
|
160
164
|
say 'No templates', :red
|
|
161
165
|
else
|
|
@@ -260,10 +264,12 @@ module Locomotive
|
|
|
260
264
|
#
|
|
261
265
|
def retrieve_connection_info(env, path)
|
|
262
266
|
require 'active_support/core_ext/hash'
|
|
267
|
+
require 'erb'
|
|
263
268
|
connection_info = nil
|
|
264
269
|
begin
|
|
265
270
|
path_to_deploy_file = File.join(path, 'config', 'deploy.yml')
|
|
266
|
-
|
|
271
|
+
env_parsed_deploy_file = ERB.new(File.open(path_to_deploy_file).read).result
|
|
272
|
+
connection_info = YAML::load(env_parsed_deploy_file)[env.to_s].with_indifferent_access
|
|
267
273
|
|
|
268
274
|
if connection_info[:ssl] && !connection_info[:host].start_with?('https')
|
|
269
275
|
connection_info[:host] = 'https://' + connection_info[:host]
|
|
@@ -14,6 +14,13 @@ module Locomotive
|
|
|
14
14
|
argument :name
|
|
15
15
|
argument :target_path
|
|
16
16
|
|
|
17
|
+
def copy_sources
|
|
18
|
+
directory('.', self.destination, { recursive: true }, {
|
|
19
|
+
name: self.name,
|
|
20
|
+
version: Locomotive::Wagon::VERSION
|
|
21
|
+
})
|
|
22
|
+
end
|
|
23
|
+
|
|
17
24
|
def self.source_root
|
|
18
25
|
File.join(File.dirname(__FILE__), '..', '..', '..', '..', '..', 'generators', self.name.demodulize.underscore)
|
|
19
26
|
end
|
|
@@ -5,13 +5,6 @@ module Locomotive
|
|
|
5
5
|
|
|
6
6
|
class Blank < Base
|
|
7
7
|
|
|
8
|
-
def copy_sources
|
|
9
|
-
directory('.', self.destination, { recursive: true }, {
|
|
10
|
-
name: self.name,
|
|
11
|
-
version: Locomotive::Wagon::VERSION
|
|
12
|
-
})
|
|
13
|
-
end
|
|
14
|
-
|
|
15
8
|
def choose_haml_over_html
|
|
16
9
|
if yes?('Do you prefer HAML templates ?')
|
|
17
10
|
remove_file File.join(self.destination, 'app/views/pages/index.liquid')
|
|
@@ -5,13 +5,6 @@ module Locomotive
|
|
|
5
5
|
|
|
6
6
|
class Bootstrap2 < Base
|
|
7
7
|
|
|
8
|
-
def copy_sources
|
|
9
|
-
directory('.', self.destination, { recursive: true }, {
|
|
10
|
-
name: self.name,
|
|
11
|
-
version: Locomotive::Wagon::VERSION
|
|
12
|
-
})
|
|
13
|
-
end
|
|
14
|
-
|
|
15
8
|
def choose_haml_over_html
|
|
16
9
|
if yes?('Do you prefer HAML templates ?')
|
|
17
10
|
remove_file File.join(self.destination, 'app/views/pages/index.liquid')
|
|
@@ -5,13 +5,6 @@ module Locomotive
|
|
|
5
5
|
|
|
6
6
|
class Bootstrap3 < Base
|
|
7
7
|
|
|
8
|
-
def copy_sources
|
|
9
|
-
directory('.', self.destination, { recursive: true }, {
|
|
10
|
-
name: self.name,
|
|
11
|
-
version: Locomotive::Wagon::VERSION
|
|
12
|
-
})
|
|
13
|
-
end
|
|
14
|
-
|
|
15
8
|
def choose_haml_over_html
|
|
16
9
|
if yes?('Do you prefer HAML templates ?')
|
|
17
10
|
remove_file File.join(self.destination, 'app/views/pages/index.liquid')
|
|
@@ -5,13 +5,6 @@ module Locomotive
|
|
|
5
5
|
|
|
6
6
|
class Foundation < Base
|
|
7
7
|
|
|
8
|
-
def copy_sources
|
|
9
|
-
directory('.', self.destination, { recursive: true }, {
|
|
10
|
-
name: self.name,
|
|
11
|
-
version: Locomotive::Wagon::VERSION
|
|
12
|
-
})
|
|
13
|
-
end
|
|
14
|
-
|
|
15
8
|
def choose_haml_over_html
|
|
16
9
|
if yes?('Do you prefer HAML templates ?')
|
|
17
10
|
remove_file File.join(self.destination, 'app/views/pages/index.liquid')
|
data/locomotivecms_wagon.gemspec
CHANGED
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |gem|
|
|
|
34
34
|
|
|
35
35
|
gem.add_dependency 'httmultiparty', '0.3.10'
|
|
36
36
|
gem.add_dependency 'will_paginate', '~> 3.0.3'
|
|
37
|
-
gem.add_dependency 'locomotivecms_mounter', '~> 1.
|
|
37
|
+
gem.add_dependency 'locomotivecms_mounter', '~> 1.4.0'
|
|
38
38
|
|
|
39
39
|
gem.add_dependency 'faker', '~> 0.9.5'
|
|
40
40
|
|
|
@@ -29,7 +29,7 @@ position: 2
|
|
|
29
29
|
#is_listed{ listed: "{{ page.listed? }}" }
|
|
30
30
|
|
|
31
31
|
#test_for_scope
|
|
32
|
-
{% with_scope _slug: "song-3" %}
|
|
32
|
+
{% with_scope _slug: "song-number-3" %}
|
|
33
33
|
{% assign selected_songs = contents.songs.all %}
|
|
34
34
|
{% endwith_scope %}
|
|
35
35
|
{% for s in selected_songs %}
|
|
@@ -35,12 +35,12 @@ describe Locomotive::Wagon::Server do
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it 'shows a content type template ' do
|
|
38
|
-
get '/songs/song-1'
|
|
38
|
+
get '/songs/song-number-1'
|
|
39
39
|
last_response.body.should =~ /Song #1/
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
it 'renders a page under a templatized one' do
|
|
43
|
-
get '/songs/song-1/band'
|
|
43
|
+
get '/songs/song-number-1/band'
|
|
44
44
|
last_response.body.should =~ /Song #1/
|
|
45
45
|
last_response.body.should =~ /Leader: Eddie/
|
|
46
46
|
end
|
|
@@ -61,7 +61,7 @@ describe Locomotive::Wagon::Server do
|
|
|
61
61
|
|
|
62
62
|
it 'translates a page with link_to tags inside' do
|
|
63
63
|
get '/fr/notre-musique'
|
|
64
|
-
last_response.body.should =~ /<h3><a href="\/fr\/songs\/song-8">Song #8<\/a><\/h3>/
|
|
64
|
+
last_response.body.should =~ /<h3><a href="\/fr\/songs\/song-number-8">Song #8<\/a><\/h3>/
|
|
65
65
|
last_response.body.should =~ /Propulsé par/
|
|
66
66
|
end
|
|
67
67
|
|
|
@@ -13,7 +13,7 @@ describe Locomotive::Wagon::Server do
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
it "converts {{ page.templatized? }} => true on templatized page" do
|
|
16
|
-
get '/songs/song-1'
|
|
16
|
+
get '/songs/song-number-1'
|
|
17
17
|
last_response.body.should =~ /templatized=.true./
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -28,12 +28,12 @@ describe Locomotive::Wagon::Server do
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
it "provides an access to page's content_type collection" do
|
|
31
|
-
get '/songs/song-1'
|
|
31
|
+
get '/songs/song-number-1'
|
|
32
32
|
last_response.body.should =~ /content_type_size=.8./
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
it "provides count alias on collections" do
|
|
36
|
-
get '/songs/song-1'
|
|
36
|
+
get '/songs/song-number-1'
|
|
37
37
|
last_response.body.should =~ /content_type_count=.8./
|
|
38
38
|
end
|
|
39
39
|
|
|
@@ -56,12 +56,12 @@ describe Locomotive::Wagon::Server do
|
|
|
56
56
|
|
|
57
57
|
it "writes a link to a templatized page" do
|
|
58
58
|
get '/events'
|
|
59
|
-
last_response.body.should =~ /<a href="\/songs\/song-1">Song #1<\/a>/
|
|
59
|
+
last_response.body.should =~ /<a href="\/songs\/song-number-1">Song #1<\/a>/
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
it "writes a link to a templatized page with a different handle" do
|
|
63
63
|
get '/events'
|
|
64
|
-
last_response.body.should =~ /<a href="\/songs\/song-8">Song #8<\/a>/
|
|
64
|
+
last_response.body.should =~ /<a href="\/songs\/song-number-8">Song #8<\/a>/
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
end
|
|
@@ -71,7 +71,7 @@ describe Locomotive::Wagon::Server do
|
|
|
71
71
|
it "evaluates collection when called all inside of scope" do
|
|
72
72
|
get '/music'
|
|
73
73
|
last_response.body.should =~ /<p class=.scoped_song.>Song #3/
|
|
74
|
-
last_response.body.should =~ /<p class=.scoped_song_link.>\s+<a href=.\/songs\/song-3.>Song #3/m
|
|
74
|
+
last_response.body.should =~ /<p class=.scoped_song_link.>\s+<a href=.\/songs\/song-number-3.>Song #3/m
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
it "size of evaluated unscoped collection equal to unevaluated one" do
|
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: 1.
|
|
4
|
+
version: 1.4.0
|
|
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: 2013-
|
|
12
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|
|
@@ -213,14 +213,14 @@ dependencies:
|
|
|
213
213
|
requirements:
|
|
214
214
|
- - ~>
|
|
215
215
|
- !ruby/object:Gem::Version
|
|
216
|
-
version: 1.
|
|
216
|
+
version: 1.4.0
|
|
217
217
|
type: :runtime
|
|
218
218
|
prerelease: false
|
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
|
220
220
|
requirements:
|
|
221
221
|
- - ~>
|
|
222
222
|
- !ruby/object:Gem::Version
|
|
223
|
-
version: 1.
|
|
223
|
+
version: 1.4.0
|
|
224
224
|
- !ruby/object:Gem::Dependency
|
|
225
225
|
name: faker
|
|
226
226
|
requirement: !ruby/object:Gem::Requirement
|