caboose-cms 0.8.40 → 0.8.41
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 945c437e933d397c1638c61f648474f9144bfaa5
|
4
|
+
data.tar.gz: 32696496ae665b5937f15cb846227c5db9ad4df9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d9873f6add7c68e6bc4c398c9cf7849e824f9dc285dcd1cd8a1fbcd4a54b5d2cd67b3c6aaee813f7cc23e90a29a1288604fdc5bfcc1771609727db90e6f30f0
|
7
|
+
data.tar.gz: 9f8b80d544fb73d64a31fd18e89d7f3683e64493ff535cf27a5c3ed8667b0ad24a6c3248d0c7660bff5a1a6136abe88a2c2fc39695786545f55add7d85403dd3
|
@@ -28,6 +28,7 @@ module Caboose
|
|
28
28
|
f2 = File.open(file, "r")
|
29
29
|
|
30
30
|
domains = []
|
31
|
+
domains_constrainer = false
|
31
32
|
module_name = nil
|
32
33
|
class_name = nil
|
33
34
|
class_priority = 20
|
@@ -44,9 +45,14 @@ module Caboose
|
|
44
45
|
class_name = line.gsub(/^(.*?)class (.*?)Controller(.*?)$/, '\2').gsub(/([A-Z])/, '_\1').downcase
|
45
46
|
class_name[0] = '' if class_name[0] == '_'
|
46
47
|
class_name = "#{module_name}::#{class_name}" if module_name
|
47
|
-
elsif line =~ /# @route_domain (.*?)$/
|
48
|
-
|
49
|
-
|
48
|
+
elsif line =~ /# @route_domain (.*?)$/
|
49
|
+
# Ignore if we have a domain constrainer
|
50
|
+
if domains.is_a?(Array)
|
51
|
+
domain = line.gsub(/# @route_domain (.*?)$/, '\1')
|
52
|
+
domains << domain if !domains.include?(domain)
|
53
|
+
end
|
54
|
+
elsif line =~ /# @route_domain_constrainer (.*?)$/
|
55
|
+
domains = line.gsub(/# @route_domain_constrainer (.*?)$/, '\1')
|
50
56
|
elsif line =~ /# @route_constraints (.*?)$/
|
51
57
|
constraints = line.gsub(/# @route_constraints (.*?)$/, '\1')
|
52
58
|
uris.last[1] = constraints if uris.length > 0
|
@@ -67,7 +73,7 @@ module Caboose
|
|
67
73
|
elsif line =~ /# @route DELETE (.*?)/ then uris << ["delete \"#{line.gsub(/# @route DELETE (.*?)/ , '\1').strip}\"", nil]
|
68
74
|
end
|
69
75
|
end
|
70
|
-
ds = domains.count > 0 ? domains.sort.join(' ') : 'zzz_all_domains'
|
76
|
+
ds = domains.is_a?(Array) ? (domains.count > 0 ? domains.sort.join(' ') : 'zzz_all_domains') : "CONSTRAIN #{domains}"
|
71
77
|
classes[ds] = [] if classes[ds].nil?
|
72
78
|
classes[ds] << [class_name, actions, class_priority]
|
73
79
|
end
|
@@ -76,9 +82,14 @@ module Caboose
|
|
76
82
|
routes = []
|
77
83
|
classes.sort_by{ |domain, domain_classes| domain }.to_h.each do |domain, domain_classes|
|
78
84
|
|
79
|
-
if domain != 'zzz_all_domains'
|
80
|
-
|
81
|
-
|
85
|
+
if domain != 'zzz_all_domains'
|
86
|
+
if domain.starts_with?('CONSTRAIN ')
|
87
|
+
constrainer = domain.gsub('CONSTRAIN ', '')
|
88
|
+
routes << "constraints #{constrainer}.new do"
|
89
|
+
else
|
90
|
+
domains = domain.split(' ').collect{ |d| "'#{d}'" }.join(', ')
|
91
|
+
routes << "constraints Caboose::DomainConstraint.new([#{domains}]) do"
|
92
|
+
end
|
82
93
|
end
|
83
94
|
domain_classes.sort_by{ |arr| arr[2] }.each do |carr|
|
84
95
|
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose.rake
CHANGED
@@ -188,32 +188,34 @@ namespace :caboose do
|
|
188
188
|
puts "Create a new Nine Lite site\n"
|
189
189
|
puts "--------------------------------------------------------------------------------\n"
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
input2 = ''
|
197
|
-
STDOUT.puts "What is the ID of the home page?"
|
198
|
-
input2 = STDIN.gets.chomp
|
191
|
+
site_name = ''
|
192
|
+
while site_name.nil? || site_name.strip.length == 0 do
|
193
|
+
STDOUT.puts "What is the name of the site?"
|
194
|
+
site_name = STDIN.gets.chomp
|
195
|
+
end
|
199
196
|
puts "\n"
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
197
|
+
|
198
|
+
use_store = ''
|
199
|
+
while use_store.nil? || (use_store.downcase != 'y' && use_store.downcase != 'n') do
|
200
|
+
STDOUT.puts "E-commerce? (y/n)"
|
201
|
+
use_store = STDIN.gets.chomp
|
202
|
+
end
|
204
203
|
puts "\n"
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
puts "\n"
|
211
|
-
puts "--------------------------------------------------------------------------------\n"
|
212
|
-
puts "Choo! Choo! Your site is set up!\n"
|
213
|
-
puts "--------------------------------------------------------------------------------\n"
|
214
|
-
else
|
215
|
-
puts "Invalid site name or home page ID"
|
204
|
+
|
205
|
+
use_mls = ''
|
206
|
+
while use_mls.nil? || (use_mls.downcase != 'y' && use_mls.downcase != 'n') do
|
207
|
+
STDOUT.puts "MLS? (y/n)"
|
208
|
+
use_mls = STDIN.gets.chomp
|
216
209
|
end
|
210
|
+
puts "\n"
|
211
|
+
|
212
|
+
helper = SiteHelper.new
|
213
|
+
helper.create_site(site_name, use_store.downcase == 'y', use_mls.downcase == 'y')
|
214
|
+
|
215
|
+
puts "\n"
|
216
|
+
puts "--------------------------------------------------------------------------------\n"
|
217
|
+
puts "Choo! Choo! Your site is set up!\n"
|
218
|
+
puts "--------------------------------------------------------------------------------\n"
|
217
219
|
end
|
218
220
|
|
219
221
|
desc "Create blocks for new site"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|