caboose-cms 0.3.110 → 0.3.127
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/caboose +75 -63
- data/lib/caboose/caboose_helper.rb +8 -5
- data/lib/caboose/version.rb +1 -1
- data/lib/sample_files/Gemfile +6 -6
- data/lib/sample_files/app/views/layouts/layout_default.html.erb +4 -5
- data/lib/sample_files/config/database.yml +23 -0
- data/lib/sample_files/config/environments/development.rb +44 -0
- data/lib/sample_files/config/environments/production.rb +71 -0
- data/lib/sample_files/config/environments/test.rb +37 -0
- data/lib/sample_files/config/initializers/asset_sync.rb +4 -4
- data/lib/sample_files/config/initializers/caboose.rb +7 -7
- data/lib/sample_files/config/initializers/paperclip.rb +13 -11
- data/lib/tasks/caboose.rake +0 -1
- metadata +5 -4
- data/lib/caboose/migration_version.rb +0 -47
- data/lib/caboose/migrations.rb +0 -7
- data/lib/sample_files/config/initializers/action_mailer.rb +0 -9
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGUwNWQ5N2EzMmY4MGQxYmU0ZjgwMWY2YTZjZDMwNTJjZTE4YTNkZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzU2MTVjODAzNzk1ZmJhNjZjMzEyZDAwZmFiY2RhOGFiNDMyMjkyNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjQwYmJmMGNkMDQzMWRhMWQ4NzdkZmQwMTRlNWMwMDY4ZWY5MmY2MWIzMWJj
|
10
|
+
ZTQ1ZWNhMzAyMTA1MjliNjkyYWYzMTdiNzU2NGMyNjA2MjZmMGQ4ZjVhYzRm
|
11
|
+
NGM3NWE0M2FiM2Q5ZTAyZjBlZjcxN2IyZGRkZjYwNjNiNmE5MGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGRkYmVlMTAzZWMyYzVhMGNmMjAwOTkwM2EyYzEyNGQ3YjAxZWQ0ZjZlNDFm
|
14
|
+
OGIzMjFhYWQyZmIxMjU1MzA4MjIwMjlmMTgyZjQ4MjM2ZmQyNGFhMWE5MTA4
|
15
|
+
OWY5MjMyODVjNDI1YzA0MmQxYWM1M2ExMmMzZjkyNjEwYTQzN2M=
|
data/bin/caboose
CHANGED
@@ -1,74 +1,86 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'rails/all'
|
4
|
-
require 'caboose'
|
5
|
-
require 'caboose/engine'
|
3
|
+
#require 'rails/all'
|
4
|
+
#require 'caboose'
|
5
|
+
#require 'caboose/engine'
|
6
6
|
require 'caboose/version'
|
7
7
|
require 'caboose/caboose_helper'
|
8
8
|
#require 'trollop'
|
9
9
|
|
10
10
|
cmd = ARGV.shift
|
11
|
-
case cmd
|
12
|
-
|
13
|
-
when 'version'
|
14
|
-
|
15
|
-
puts "Caboose CMS Version #{Caboose::VERSION}\n\n"
|
16
|
-
|
17
|
-
when 'new'
|
18
|
-
|
19
|
-
puts "\n"
|
20
|
-
puts "--------------------------------------------------------------------------------\n"
|
21
|
-
puts "Create a new Caboose CMS App\n"
|
22
|
-
puts "--------------------------------------------------------------------------------\n"
|
23
|
-
|
24
|
-
questions = {
|
25
|
-
'app_name' => "What's the name of your new app?",
|
26
|
-
'smtp_server' => "What's the SMTP server?",
|
27
|
-
'smtp_domain' => "What's the SMTP domain?",
|
28
|
-
'smtp_user' => "What's the SMTP user?",
|
29
|
-
'smtp_password' => "What's the SMTP password?"
|
30
|
-
}
|
31
|
-
questions.each do |k,q|
|
32
|
-
while vars[k].nil? || vars[k].strip.length == 0
|
33
|
-
puts "\n#{q}"
|
34
|
-
vars[k.upcase] = gets.chomp
|
35
|
-
end
|
36
|
-
end
|
37
11
|
|
38
|
-
|
39
|
-
helper = CabooseHelper.new(vars)
|
40
|
-
helper.create_app
|
41
|
-
|
42
|
-
when 'pg_restore'
|
43
|
-
|
44
|
-
puts "\nTo what database do you want to restore?"
|
45
|
-
db = gets.chomp
|
46
|
-
puts "\nWhere's the dump file?"
|
47
|
-
dump_file = gets.chomp
|
48
|
-
puts "\nRunning pg_restore...\n"
|
49
|
-
`pg_restore --verbose --clean --no-acl --no-owner -h localhost -d #{db} #{dump_file}`
|
50
|
-
|
51
|
-
when 'sync_db'
|
52
|
-
|
53
|
-
puts "\nCapturing production database...\n"
|
54
|
-
`heroku pgbackups:capture`
|
55
|
-
puts "\nWhere do you want to save the production database dump file?\n"
|
56
|
-
dump_file = gets.chomp
|
57
|
-
puts "\nDownloading production database dump file...\n"
|
58
|
-
`curl -o #{dump_file} \`heroku pgbackups:url\``
|
59
|
-
puts "\nTo what database do you want to restore?"
|
60
|
-
db = gets.chomp
|
61
|
-
puts "\nRunning pg_restore...\n"
|
62
|
-
`pg_restore --verbose --clean --no-acl --no-owner -h localhost -d #{db} #{dump_file}`
|
63
|
-
|
64
|
-
else
|
12
|
+
case cmd
|
65
13
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
14
|
+
when 'version'
|
15
|
+
|
16
|
+
puts "Caboose CMS Version #{Caboose::VERSION}\n\n"
|
17
|
+
|
18
|
+
when 'new'
|
19
|
+
|
20
|
+
puts "\n"
|
21
|
+
puts "--------------------------------------------------------------------------------\n"
|
22
|
+
puts "Create a new Caboose CMS App\n"
|
23
|
+
puts "--------------------------------------------------------------------------------\n"
|
24
|
+
|
25
|
+
questions = {
|
26
|
+
'app_name' => "What's the name of your new app?",
|
27
|
+
'smtp_server' => "What's the SMTP server?",
|
28
|
+
'smtp_domain' => "What's the SMTP domain?",
|
29
|
+
'smtp_user' => "What's the SMTP user?",
|
30
|
+
'smtp_password' => "What's the SMTP password?",
|
31
|
+
's3_bucket_name' => "What's the amazon S3 bucket name?",
|
32
|
+
's3_access_key_id' => "What's the amazon S3 access key id?",
|
33
|
+
's3_secret_access_key' => "What's the amazon S3 access secret key?",
|
34
|
+
'cdn_url' => "What's the CDN base URL?"
|
35
|
+
}
|
36
|
+
vars = {}
|
37
|
+
questions.each do |k,q|
|
38
|
+
while vars[k.upcase].nil? || vars[k.upcase].strip.length == 0
|
39
|
+
puts "\n#{q}"
|
40
|
+
vars[k.upcase] = gets.chomp
|
41
|
+
end
|
42
|
+
end
|
43
|
+
puts "\n"
|
44
|
+
|
45
|
+
# Do the caboose init
|
46
|
+
helper = CabooseHelper.new(vars)
|
47
|
+
helper.create_app
|
48
|
+
|
49
|
+
puts "\n"
|
50
|
+
puts "--------------------------------------------------------------------------------\n"
|
51
|
+
puts "Choo! Choo! You're all set!\n"
|
52
|
+
puts "--------------------------------------------------------------------------------\n"
|
73
53
|
|
54
|
+
when 'pg_restore'
|
55
|
+
|
56
|
+
puts "\nTo what database do you want to restore?"
|
57
|
+
db = gets.chomp
|
58
|
+
puts "\nWhere's the dump file?"
|
59
|
+
dump_file = gets.chomp
|
60
|
+
puts "\nRunning pg_restore...\n"
|
61
|
+
`pg_restore --verbose --clean --no-acl --no-owner -h localhost -d #{db} #{dump_file}`
|
62
|
+
|
63
|
+
when 'sync_db'
|
64
|
+
|
65
|
+
puts "\nCapturing production database...\n"
|
66
|
+
`heroku pgbackups:capture`
|
67
|
+
puts "\nWhere do you want to save the production database dump file?\n"
|
68
|
+
dump_file = gets.chomp
|
69
|
+
puts "\nDownloading production database dump file...\n"
|
70
|
+
`curl -o #{dump_file} \`heroku pgbackups:url\``
|
71
|
+
puts "\nTo what database do you want to restore?"
|
72
|
+
db = gets.chomp
|
73
|
+
puts "\nRunning pg_restore...\n"
|
74
|
+
`pg_restore --verbose --clean --no-acl --no-owner -h localhost -d #{db} #{dump_file}`
|
75
|
+
|
76
|
+
else
|
77
|
+
|
78
|
+
puts "--------------------------------------------------------------------------------"
|
79
|
+
puts "Caboose CMS"
|
80
|
+
puts "A content management system built on top of Ruby on Rails."
|
81
|
+
puts "--------------------------------------------------------------------------------"
|
82
|
+
puts "Usage:"
|
83
|
+
puts "caboose new <path>"
|
84
|
+
puts "--------------------------------------------------------------------------------"
|
85
|
+
|
74
86
|
end
|
@@ -1,21 +1,24 @@
|
|
1
|
+
require 'find'
|
2
|
+
require 'digest'
|
1
3
|
|
2
4
|
class CabooseHelper
|
3
5
|
|
4
6
|
def initialize(vars)
|
5
7
|
@vars = vars
|
6
8
|
@vars['APP_NAME'] = @vars['APP_NAME'].downcase.capitalize
|
9
|
+
@vars['APP_NAME_LOWERCASE'] = @vars['APP_NAME'].downcase
|
7
10
|
@vars['CABOOSE_SALT'] = Digest::SHA1.hexdigest(DateTime.now.to_s) if @vars['CABOOSE_SALT'].nil?
|
8
|
-
@vars['
|
11
|
+
@vars['CABOOSE_VERSION'] = Caboose::VERSION if @vars['CABOOSE_VERSION'].nil?
|
9
12
|
end
|
10
13
|
|
11
14
|
def create_app
|
12
15
|
# Create the rails app
|
13
16
|
puts "Creating the rails app..."
|
14
|
-
`rails new #{
|
17
|
+
`rails _3.2.15_ new #{@vars['APP_NAME'].downcase} -d=postgresql`
|
15
18
|
|
16
19
|
# Do the caboose init
|
17
20
|
init_skeleton_files
|
18
|
-
remove_public_index
|
21
|
+
remove_public_index
|
19
22
|
end
|
20
23
|
|
21
24
|
# Copies all the files in the sample directory to the host application
|
@@ -28,7 +31,7 @@ class CabooseHelper
|
|
28
31
|
Find.find(skeleton_root).each do |file|
|
29
32
|
next if File.directory?(file)
|
30
33
|
file2 = file.gsub(skeleton_root, '')
|
31
|
-
file2 = File.join(
|
34
|
+
file2 = File.join(File.expand_path(@vars['APP_NAME'].downcase), file2)
|
32
35
|
FileUtils.cp(file, file2)
|
33
36
|
|
34
37
|
# Replace any variables
|
@@ -44,7 +47,7 @@ class CabooseHelper
|
|
44
47
|
def remove_public_index
|
45
48
|
puts "Removing the public/index.html file... "
|
46
49
|
|
47
|
-
filename = File.join(@
|
50
|
+
filename = File.join(File.expand_path(@vars['APP_NAME'].downcase),'public','index.html')
|
48
51
|
return if !File.exists?(filename)
|
49
52
|
File.delete(filename)
|
50
53
|
end
|
data/lib/caboose/version.rb
CHANGED
data/lib/sample_files/Gemfile
CHANGED
@@ -8,12 +8,12 @@ gem 'rails', '3.2.15'
|
|
8
8
|
|
9
9
|
gem 'pg'
|
10
10
|
|
11
|
-
group :assets do
|
12
|
-
gem 'sass-rails', '~> 3.2.3'
|
13
|
-
gem 'coffee-rails', '~> 3.2.1'
|
14
|
-
gem 'compass-rails'
|
15
|
-
gem 'uglifier', '>= 1.0.3'
|
16
|
-
end
|
11
|
+
#group :assets do
|
12
|
+
# gem 'sass-rails', '~> 3.2.3'
|
13
|
+
# gem 'coffee-rails', '~> 3.2.1'
|
14
|
+
# gem 'compass-rails'
|
15
|
+
# gem 'uglifier', '>= 1.0.3'
|
16
|
+
#end
|
17
17
|
|
18
18
|
gem 'jquery-rails'
|
19
19
|
gem 'ejs'
|
@@ -13,11 +13,10 @@
|
|
13
13
|
<div id='content_wrapper'>
|
14
14
|
<div id='content'>
|
15
15
|
|
16
|
-
<% if
|
17
|
-
<%= yield %>
|
18
|
-
<% elsif
|
19
|
-
|
20
|
-
<%= raw @page.content %>
|
16
|
+
<% if yield && yield.strip.length > 0 %>
|
17
|
+
<%= yield %>
|
18
|
+
<% elsif !@page.nil? %>
|
19
|
+
<%= yield :page_content %>
|
21
20
|
<% end %>
|
22
21
|
|
23
22
|
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
development:
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
database: |APP_NAME_LOWERCASE|_development
|
5
|
+
pool: 5
|
6
|
+
username: root
|
7
|
+
password:
|
8
|
+
|
9
|
+
test:
|
10
|
+
adapter: postgresql
|
11
|
+
encoding: unicode
|
12
|
+
database: |APP_NAME_LOWERCASE|_test
|
13
|
+
pool: 5
|
14
|
+
username: root
|
15
|
+
password:
|
16
|
+
|
17
|
+
production:
|
18
|
+
adapter: postgresql
|
19
|
+
encoding: unicode
|
20
|
+
database: |APP_NAME_LOWERCASE|_production
|
21
|
+
pool: 5
|
22
|
+
username: chester
|
23
|
+
password:
|
@@ -0,0 +1,44 @@
|
|
1
|
+
|APP_NAME|::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
32
|
+
# Do not compress assets
|
33
|
+
config.assets.compress = false
|
34
|
+
|
35
|
+
# Expands the lines which load the assets
|
36
|
+
config.assets.debug = true
|
37
|
+
|
38
|
+
# Show action mailer errors for development
|
39
|
+
ActionMailer::Base.raise_delivery_errors = true
|
40
|
+
|
41
|
+
# Use Cloudfront for asset hosting
|
42
|
+
#config.action_controller.asset_host = "|CDN_URL|"
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
|APP_NAME|::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = true
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = true
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
#config.assets.precompile += %w()
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
# config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
|
+
|
68
|
+
# Use Cloudfront for asset hosting
|
69
|
+
config.action_controller.asset_host = "|CDN_URL|"
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|APP_NAME|::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
# Show full error reports and disable caching
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
|
24
|
+
# Disable request forgery protection in test environment
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
26
|
+
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
29
|
+
# ActionMailer::Base.deliveries array.
|
30
|
+
config.action_mailer.delivery_method = :test
|
31
|
+
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
34
|
+
|
35
|
+
# Print deprecation notices to the stderr
|
36
|
+
config.active_support.deprecation = :stderr
|
37
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
AssetSync.configure do |config|
|
2
2
|
config.fog_provider = 'AWS'
|
3
|
-
config.fog_directory = '
|
4
|
-
config.aws_access_key_id = '
|
5
|
-
config.aws_secret_access_key = '
|
6
|
-
config.run_on_precompile = true
|
3
|
+
config.fog_directory = '|S3_BUCKET_NAME|'
|
4
|
+
config.aws_access_key_id = '|S3_ACCESS_KEY_ID|'
|
5
|
+
config.aws_secret_access_key = '|S3_SECRET_ACCESS_KEY|'
|
6
|
+
config.run_on_precompile = true
|
7
7
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
# Salt to ensure passwords are encrypted securely
|
3
|
-
Caboose::salt = '
|
3
|
+
Caboose::salt = '|CABOOSE_SALT|'
|
4
4
|
|
5
5
|
# Where page asset files will be uploaded
|
6
6
|
Caboose::assets_path = Rails.root.join('app', 'assets', 'caboose')
|
7
7
|
|
8
8
|
# Register any caboose plugins
|
9
|
-
Caboose::plugins << '
|
9
|
+
#Caboose::plugins << 'MyPlugin'
|
10
10
|
|
11
11
|
Caboose::use_url_params = false
|
12
12
|
|
13
|
-
Caboose::website_name = "
|
14
|
-
Caboose::website_domain = "http://
|
15
|
-
Caboose::cdn_domain = "
|
16
|
-
Caboose::email_from = "contact@
|
17
|
-
Caboose::authenticator_class = 'Authenticator'
|
13
|
+
Caboose::website_name = "|APP_NAME|"
|
14
|
+
Caboose::website_domain = "http://mywebsite.com"
|
15
|
+
Caboose::cdn_domain = "|CDN_URL|"
|
16
|
+
Caboose::email_from = "contact@mywebsite.com"
|
17
|
+
#Caboose::authenticator_class = 'Authenticator'
|
18
18
|
Caboose::use_ab_testing = false
|
19
19
|
Caboose::session_length = 24 # hours
|
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
config
|
3
|
-
|
4
|
-
|
5
|
-
:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
|APP_NAME|::Application.configure do
|
2
|
+
# Paperclip config for S3 assets
|
3
|
+
config.paperclip_defaults = {
|
4
|
+
:storage => :s3,
|
5
|
+
:s3_credentials => {
|
6
|
+
:bucket => '|S3_BUCKET_NAME|',
|
7
|
+
:access_key_id => '|S3_ACCESS_KEY_ID|',
|
8
|
+
:secret_access_key => '|S3_SECRET_ACCESS_KEY|'
|
9
|
+
},
|
10
|
+
:url => ':s3_alias_url',
|
11
|
+
:s3_host_alias => '|CDN_URL|'
|
12
|
+
}
|
13
|
+
end
|
data/lib/tasks/caboose.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.127
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
@@ -388,15 +388,16 @@ files:
|
|
388
388
|
- db/migrate/000_add_linked_resources_to_page.rb
|
389
389
|
- lib/caboose/caboose_helper.rb
|
390
390
|
- lib/caboose/engine.rb
|
391
|
-
- lib/caboose/migration_version.rb
|
392
|
-
- lib/caboose/migrations.rb
|
393
391
|
- lib/caboose/version.rb
|
394
392
|
- lib/caboose.rb
|
395
393
|
- lib/sample_files/app/assets/stylesheets/login.css
|
396
394
|
- lib/sample_files/app/controllers/application_controller.rb
|
397
395
|
- lib/sample_files/app/views/layouts/layout_default.html.erb
|
398
396
|
- lib/sample_files/config/application.rb
|
399
|
-
- lib/sample_files/config/
|
397
|
+
- lib/sample_files/config/database.yml
|
398
|
+
- lib/sample_files/config/environments/development.rb
|
399
|
+
- lib/sample_files/config/environments/production.rb
|
400
|
+
- lib/sample_files/config/environments/test.rb
|
400
401
|
- lib/sample_files/config/initializers/asset_sync.rb
|
401
402
|
- lib/sample_files/config/initializers/caboose.rb
|
402
403
|
- lib/sample_files/config/initializers/paperclip.rb
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module Caboose
|
2
|
-
|
3
|
-
class Version
|
4
|
-
include Comparable
|
5
|
-
attr_accessor :str, :migrations
|
6
|
-
|
7
|
-
def initialize(str, migration_range)
|
8
|
-
@str = str
|
9
|
-
@migrations = []
|
10
|
-
|
11
|
-
if !migration_range.nil?
|
12
|
-
|
13
|
-
directory = File.join(File.expand_path('../../..', __FILE__), 'db/migrate')
|
14
|
-
files = Dir.entries(directory).select{ |f| !File.directory?(f) && /[0-9]{3}_[^\n\r\.]+\.rb$/ =~ f && migration_range.include?(f[0..2].to_i) }
|
15
|
-
files.sort.each do |f|
|
16
|
-
require File.join(directory, f)
|
17
|
-
/[0-9]{3}_(?<clazz_name>[^\n\r\.]+)\.rb$/ =~ f
|
18
|
-
@migrations += [clazz_name.classify.constantize.new]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def to_s
|
25
|
-
return @str
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.compare_version_strings(a, b)
|
29
|
-
a = a.split('.').map{|s| s.to_i}
|
30
|
-
b = b.split('.').map{|s| s.to_i}
|
31
|
-
return a <=> b
|
32
|
-
end
|
33
|
-
|
34
|
-
def <=>(other)
|
35
|
-
return Version.compare_version_strings(@str, other.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
def up(c)
|
39
|
-
@migrations.each{|m| m.up(c)}
|
40
|
-
end
|
41
|
-
|
42
|
-
def down(c)
|
43
|
-
@migrations.reverse_each{|m| m.down(c)}
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
data/lib/caboose/migrations.rb
DELETED