caboose-cms 0.8.89 → 0.9.1
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/app/models/caboose/block.rb +15 -4
- data/app/models/caboose/page_cacher.rb +12 -9
- data/lib/caboose.rb +3 -0
- data/lib/caboose/version.rb +2 -2
- data/lib/tasks/caboose.rake +32 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68fa060ae238f851781562c6bbdc67c99b757e2c
|
4
|
+
data.tar.gz: 62c2fbbbfbab125e25ad71e33fa810e8f85f2de6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 816f4317a6e8717c1bcfd40b3be784a0b6248f0fe52f173fadc883cbe85646eeb59a4b4eb7d7f2908e76192c5972724a67362427a4cc823d4d8d4233fd7c8ee4
|
7
|
+
data.tar.gz: 71c13b3af1b80ac04da17eadc10e75f271a8cd7d2ddee6e7fee07afb2fe3377c7d37ca6e80789554c590aebd9dec8fbd7f77c139c991544ef800abab2e0a4900
|
data/app/models/caboose/block.rb
CHANGED
@@ -226,9 +226,19 @@ class Caboose::Block < ActiveRecord::Base
|
|
226
226
|
#end
|
227
227
|
|
228
228
|
arr = [
|
229
|
-
"../../sites/#{site.name}/blocks/#{full_name}",
|
230
|
-
"../../sites/#{site.name}/blocks/#{block.block_type.name}",
|
231
|
-
"../../sites/#{site.name}/blocks/#{block.block_type.field_type}",
|
229
|
+
#"../../sites/#{site.name}/blocks/#{full_name}",
|
230
|
+
#"../../sites/#{site.name}/blocks/#{block.block_type.name}",
|
231
|
+
#"../../sites/#{site.name}/blocks/#{block.block_type.field_type}",
|
232
|
+
#"../../app/views/caboose/blocks/#{full_name}",
|
233
|
+
#"../../app/views/caboose/blocks/#{block.block_type.name}",
|
234
|
+
#"../../app/views/caboose/blocks/#{block.block_type.field_type}",
|
235
|
+
#"caboose/blocks/#{full_name}",
|
236
|
+
#"caboose/blocks/#{block.block_type.name}",
|
237
|
+
#"caboose/blocks/#{block.block_type.field_type}"
|
238
|
+
|
239
|
+
"../../app/views/caboose/blocks/#{site.name}/#{full_name}",
|
240
|
+
"../../app/views/caboose/blocks/#{site.name}/#{block.block_type.name}",
|
241
|
+
"../../app/views/caboose/blocks/#{site.name}/#{block.block_type.field_type}",
|
232
242
|
"../../app/views/caboose/blocks/#{full_name}",
|
233
243
|
"../../app/views/caboose/blocks/#{block.block_type.name}",
|
234
244
|
"../../app/views/caboose/blocks/#{block.block_type.field_type}",
|
@@ -314,7 +324,8 @@ class Caboose::Block < ActiveRecord::Base
|
|
314
324
|
site = options[:site]
|
315
325
|
|
316
326
|
begin
|
317
|
-
str = view.render(:partial => "../../sites/#{site.name}/blocks/#{name}", :locals => options2)
|
327
|
+
#str = view.render(:partial => "../../sites/#{site.name}/blocks/#{name}", :locals => options2)
|
328
|
+
str = view.render(:partial => "../../app/views/caboose/blocks/#{site.name}/#{name}", :locals => options2)
|
318
329
|
rescue ActionView::MissingTemplate => ex
|
319
330
|
begin
|
320
331
|
str = view.render(:partial => "caboose/blocks/#{name}", :locals => options2)
|
@@ -90,15 +90,18 @@ module Caboose
|
|
90
90
|
else
|
91
91
|
full_name = bt.full_name
|
92
92
|
full_name = "lksdjflskfjslkfjlskdfjlkjsdf" if full_name.nil? || full_name.length == 0
|
93
|
-
if File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb")
|
94
|
-
elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb")
|
95
|
-
elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb")
|
96
|
-
|
97
|
-
elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb"
|
98
|
-
elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb"
|
99
|
-
elsif File.file?(
|
100
|
-
elsif File.file?(
|
101
|
-
elsif File.file?(
|
93
|
+
#if File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb")
|
94
|
+
#elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb")
|
95
|
+
#elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb")
|
96
|
+
if File.file?(Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{full_name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{full_name}.html.erb")
|
97
|
+
elsif File.file?(Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.name}.html.erb")
|
98
|
+
elsif File.file?(Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.field_type}.html.erb")
|
99
|
+
elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{full_name}.html.erb")
|
100
|
+
elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb")
|
101
|
+
elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb")
|
102
|
+
elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{full_name}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{full_name}.html.erb"
|
103
|
+
elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{bt.name}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{bt.name}.html.erb"
|
104
|
+
elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{bt.field_type}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{bt.field_type}.html.erb"
|
102
105
|
end
|
103
106
|
f = (f && f.to_s.strip.length > 0 ? File.read(f) : '')
|
104
107
|
end
|
data/lib/caboose.rb
CHANGED
@@ -136,6 +136,9 @@ module Caboose
|
|
136
136
|
mattr_accessor :use_comment_routes
|
137
137
|
@@use_comment_routes = true
|
138
138
|
|
139
|
+
mattr_accessor :site_assets_path
|
140
|
+
@@site_assets_path = "sites"
|
141
|
+
|
139
142
|
end
|
140
143
|
|
141
144
|
# These are used so that both local filestorage and S3 can work without having to change paperclip paths in models
|
data/lib/caboose/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Caboose
|
2
|
-
VERSION = '0.
|
3
|
-
end
|
2
|
+
VERSION = '0.9.1'
|
3
|
+
end
|
data/lib/tasks/caboose.rake
CHANGED
@@ -2,6 +2,34 @@ require "caboose/version"
|
|
2
2
|
require 'aws-sdk'
|
3
3
|
|
4
4
|
namespace :caboose do
|
5
|
+
|
6
|
+
task :move_site_blocks => :environment do
|
7
|
+
|
8
|
+
#Dir["sites/*/blocks"].each do |file|
|
9
|
+
# arr = file.split('/')
|
10
|
+
# site_name = arr[1]
|
11
|
+
# next if site_name.nil? || site_name.strip.length == 0
|
12
|
+
# `mv sites/#{site_name}/blocks app/views/caboose/blocks/#{site_name}` if !File.exist?("app/views/caboose/blocks/#{site_name}")
|
13
|
+
#end
|
14
|
+
|
15
|
+
Dir["app/views/caboose/blocks/*/*"].each do |file|
|
16
|
+
arr = file.split('/')
|
17
|
+
site_name = arr[4]
|
18
|
+
partial_name = arr[5]
|
19
|
+
next if site_name.nil? || site_name.strip.length == 0 || partial_name.nil? || partial_name.strip.length == 0
|
20
|
+
|
21
|
+
#puts "site_name = #{site_name}, partial_name = #{partial_name}"
|
22
|
+
|
23
|
+
str = File.read(file)
|
24
|
+
str2 = str.gsub("../../sites/#{site_name}/blocks", "caboose/blocks/#{site_name}")
|
25
|
+
if str != str2
|
26
|
+
puts file
|
27
|
+
File.open(file, 'w') { |the_file| the_file.write(str2) }
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
5
33
|
|
6
34
|
task :subscription_migration => :environment do
|
7
35
|
Caboose::Subscription.migrate_from_user_subscriptions
|
@@ -519,10 +547,10 @@ namespace :assets do
|
|
519
547
|
# Copy any site assets into the host app assets directory first
|
520
548
|
puts "Copying site assets into host assets..."
|
521
549
|
Caboose::Site.all.each do |site|
|
522
|
-
site_js = Rails.root.join(
|
523
|
-
site_css = Rails.root.join(
|
524
|
-
site_images = Rails.root.join(
|
525
|
-
site_fonts = Rails.root.join(
|
550
|
+
site_js = Rails.root.join(Caboose::site_assets_path, site.name, 'js')
|
551
|
+
site_css = Rails.root.join(Caboose::site_assets_path, site.name, 'css')
|
552
|
+
site_images = Rails.root.join(Caboose::site_assets_path, site.name, 'images')
|
553
|
+
site_fonts = Rails.root.join(Caboose::site_assets_path, site.name, 'fonts')
|
526
554
|
|
527
555
|
host_js = Rails.root.join('app', 'assets', 'javascripts' , site.name)
|
528
556
|
host_css = Rails.root.join('app', 'assets', 'stylesheets' , site.name)
|
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.
|
4
|
+
version: 0.9.1
|
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-10-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|