locomotivecms_wagon 1.3.3 → 1.4.0

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: ddf389fd19683084ab7f2c71ceb20bba27a863a8
4
- data.tar.gz: 7fb14dffa20d08c0df5bcf5a887f84803de98e5d
3
+ metadata.gz: 610ad2611728515e34b9dc0aa880d165cbd4f439
4
+ data.tar.gz: b0ea22caa1d340f66625d33f62557014c75e8d15
5
5
  SHA512:
6
- metadata.gz: a65598dd4dd41faddc22c6b358d06e0b821f8d212eea46f03977eded9cc3aad65a92de840b2302151719ffdeb8b8e329ed1212baf2e724f1d37703214b1927e1
7
- data.tar.gz: 37eb257956b84207ac3bb598a4e24e739b99082540d9626234ac02e6b1f8a5050a66f780dd25e16bc88f3ed6ce1932e348a8b67d62e9dc739eb7f133979b6cd3
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'
@@ -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, 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 :verbose, aliases: '-v', type: 'boolean', default: false, desc: 'display the full error stack trace if an error occurs'
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
- connection_info = YAML::load(File.open(path_to_deploy_file).read)[env.to_s].with_indifferent_access
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')
@@ -1,5 +1,5 @@
1
1
  module Locomotive
2
2
  module Wagon
3
- VERSION = '1.3.3'
3
+ VERSION = '1.4.0'
4
4
  end
5
5
  end
@@ -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.3.3'
37
+ gem.add_dependency 'locomotivecms_mounter', '~> 1.4.0'
38
38
 
39
39
  gem.add_dependency 'faker', '~> 0.9.5'
40
40
 
@@ -95,6 +95,6 @@ title: Home page
95
95
 
96
96
  {% include footer %}
97
97
 
98
- {% include a_complicated_one %}
98
+ {% include a_complicated-one %}
99
99
 
100
100
  {% google_analytics 'UA-20661758-1' %}
@@ -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.3.3
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-11-25 00:00:00.000000000 Z
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.3.3
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.3.3
223
+ version: 1.4.0
224
224
  - !ruby/object:Gem::Dependency
225
225
  name: faker
226
226
  requirement: !ruby/object:Gem::Requirement