refinerycms 0.9.5.3 → 0.9.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/base_controller.rb +8 -0
- data/bin/refinery +33 -9
- data/bin/refinery-update-core +8 -4
- data/db/seeds.rb +2 -2
- metadata +2 -1
@@ -0,0 +1,8 @@
|
|
1
|
+
# Filters added to this controller apply to all controllers in the refinery backend.
|
2
|
+
# Likewise, all the methods added will be available for all controllers in the refinery backend.
|
3
|
+
|
4
|
+
# You can extend refinery backend with your own functions here and they will likely not get overriden in an update.
|
5
|
+
|
6
|
+
class Admin::BaseController < Refinery::AdminBaseController
|
7
|
+
|
8
|
+
end
|
data/bin/refinery
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'fileutils'
|
3
3
|
REFINERY_ROOT = File.expand_path(File.dirname(__FILE__) << "/..")
|
4
|
-
unless (
|
4
|
+
unless (app_path = ARGV.shift).nil? or app_path.length == 0
|
5
|
+
RAILS_ROOT = app_path =~ /(\.(\/)?)/ ? Dir.getwd : app_path
|
5
6
|
if File.exists? RAILS_ROOT
|
6
7
|
if ARGV.include?("--force")
|
7
8
|
# remove the contents of the current directory
|
@@ -23,6 +24,22 @@ unless (RAILS_ROOT = ARGV.shift).nil? or RAILS_ROOT.length == 0
|
|
23
24
|
|
24
25
|
# add in the database config file.
|
25
26
|
FileUtils::move File.join(RAILS_ROOT, %w(config database.yml.example)), File.join(RAILS_ROOT, %w(config database.yml))
|
27
|
+
|
28
|
+
# figure out the database name from the install path and swap out your_local_database with this name.
|
29
|
+
unless RAILS_ROOT == "/" or RUBY_PLATFORM =~ /mswin/
|
30
|
+
database_name = RAILS_ROOT.split(File::SEPARATOR).last
|
31
|
+
# read in the file and split up the lines
|
32
|
+
lines = File.open(File.join(RAILS_ROOT, %w(config database.yml)), "r").read.split("\n")
|
33
|
+
lines.each do |line|
|
34
|
+
line.gsub!("your_local_database", database_name)
|
35
|
+
line.gsub!("your_test_database", "#{database_name}_test")
|
36
|
+
line.gsub!("your_production_database", "#{database_name}_production")
|
37
|
+
end
|
38
|
+
# write the new content into the file.
|
39
|
+
File.open(File.join(RAILS_ROOT, %w(config database.yml)), "w").puts(lines.join("\n"))
|
40
|
+
else
|
41
|
+
database_name = "your_local_database"
|
42
|
+
end
|
26
43
|
|
27
44
|
# update the environment file with a new secret key.
|
28
45
|
require 'digest/sha1'
|
@@ -34,19 +51,26 @@ unless (RAILS_ROOT = ARGV.shift).nil? or RAILS_ROOT.length == 0
|
|
34
51
|
lines.each do |line|
|
35
52
|
match = line.scan(/(:secret)([^']*)([\'])([^\']*)/).flatten.last
|
36
53
|
line.gsub!(match, new_digest) unless match.nil?
|
37
|
-
end
|
54
|
+
end
|
55
|
+
# write the new content into the file.
|
38
56
|
File.open(File.join(RAILS_ROOT, %w(config environment.rb)), "w").puts(lines.join("\n"))
|
39
57
|
|
40
|
-
puts "---------"
|
41
|
-
puts "Refinery installed in #{RAILS_ROOT}
|
58
|
+
puts "\n---------"
|
59
|
+
puts "Refinery successfully installed in '#{RAILS_ROOT}'!\n\n"
|
42
60
|
|
43
61
|
# update core script files with symlinks.
|
44
|
-
system "refinery-update-core #{RAILS_ROOT}"
|
62
|
+
system "refinery-update-core #{RAILS_ROOT} --from-refinery-installer"
|
45
63
|
|
46
|
-
puts "
|
47
|
-
|
48
|
-
|
49
|
-
|
64
|
+
puts "=== ACTION REQUIRED ==="
|
65
|
+
puts "\nNow run these commands:"
|
66
|
+
puts "\ncd #{RAILS_ROOT}"
|
67
|
+
puts "rake gems:install"
|
68
|
+
puts "rake db:setup"
|
69
|
+
puts "\nruby script/server"
|
70
|
+
puts "\nThis will install all the required gems, set up your database (named '#{database_name}') and launches the built-in webserver."
|
71
|
+
puts "You can now see your site running in your browser at http://localhost:3000"
|
72
|
+
puts "\nThanks for installing Refinery, enjoy creating your new application!"
|
73
|
+
puts "---------\n\n"
|
50
74
|
end
|
51
75
|
else
|
52
76
|
puts "Please specify the path where you want to install Refinery. i.e. refinery /path/to/project"
|
data/bin/refinery-update-core
CHANGED
@@ -20,9 +20,13 @@ unless RAILS_ROOT.nil? or RAILS_ROOT.length == 0
|
|
20
20
|
# copy any rake tasks from plugins to the main lib directory so they can be run.
|
21
21
|
FileUtils::cp Dir[File.join(REFINERY_ROOT, %w(** tasks *.rake))], File.join(RAILS_ROOT, %w(lib tasks))
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
unless ARGV.include?("--from-refinery-installer")
|
24
|
+
puts "---------"
|
25
|
+
puts "Copied new Refinery core assets."
|
26
|
+
puts "Please run rake db:migrate to ensure your database is at the correct version."
|
27
|
+
end
|
26
28
|
else
|
27
|
-
|
29
|
+
unless ARGV.include?("--from-refinery-installer")
|
30
|
+
puts "Please specify the path of the refinery project that you want to update, i.e. refinery-update-core /path/to/project"
|
31
|
+
end
|
28
32
|
end
|
data/db/seeds.rb
CHANGED
@@ -82,7 +82,7 @@ Page.create(:title => "Thank You",
|
|
82
82
|
:parent_id => 4).parts.create(
|
83
83
|
{
|
84
84
|
:title => "body",
|
85
|
-
:body => "<p>We've received your inquiry and will get back to you with a response shortly.</p><a href='/'>Return to the home page</a>"
|
85
|
+
:body => "<p>We've received your inquiry and will get back to you with a response shortly.</p><p><a href='/'>Return to the home page</a></p>"
|
86
86
|
})
|
87
87
|
|
88
88
|
Page.create(:title => "Page not found",
|
@@ -105,5 +105,5 @@ Page.create(:title => "Privacy Policy",
|
|
105
105
|
}).page.parts.create(
|
106
106
|
{
|
107
107
|
:title => "side_body",
|
108
|
-
:body => "
|
108
|
+
:body => ""
|
109
109
|
})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.5.
|
4
|
+
version: 0.9.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Resolve Digital
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/refinery_initializer.rb
|
32
32
|
- app/controllers/application.rb
|
33
33
|
- app/controllers/application_controller.rb
|
34
|
+
- app/controllers/admin/base_controller.rb
|
34
35
|
- config/amazon_s3.yml
|
35
36
|
- config/boot.rb
|
36
37
|
- config/database.yml.example
|