-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
installer.rb
46 lines (37 loc) · 1.45 KB
/
installer.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'rbconfig'
VERSION_BAND = '2.1'
MINOR_VERSION_BAND = '2.1.2'
# We want to ensure that you have an ExecJS runtime available!
begin
require 'execjs'
rescue LoadError
abort "ExecJS is not installed. Please re-start the installer after running:\ngem install execjs"
end
if File.read("#{destination_root}/Gemfile") !~ /assets.+coffee-rails/m
gem "coffee-rails", :group => :assets
end
append_file 'Gemfile', <<-GEMFILE
# Refinery CMS
gem 'refinerycms', '~> #{VERSION_BAND}'
# Optionally, specify additional Refinery CMS Extensions here:
gem 'refinerycms-acts-as-indexed', ['~> 1.0', '>= 1.0.0']
gem 'refinerycms-wymeditor', ['~> 1.0', '>= 1.0.5']
# gem 'refinerycms-blog', ['~> #{VERSION_BAND}', '>= #{MINOR_VERSION_BAND}']
# gem 'refinerycms-inquiries', ['~> #{VERSION_BAND}', '>= #{MINOR_VERSION_BAND}']
# gem 'refinerycms-search', ['~> #{VERSION_BAND}', '>= #{MINOR_VERSION_BAND}']
# gem 'refinerycms-page-images', ['~> #{VERSION_BAND}', '>= #{MINOR_VERSION_BAND}']
GEMFILE
begin
require 'execjs'
::ExecJS::Runtimes.autodetect
rescue
gsub_file 'Gemfile', "# gem 'therubyracer'", "gem 'therubyracer'"
end
run 'bundle install'
rake 'db:create'
generate "refinery:cms --fresh-installation #{ARGV.join(' ')}"
say <<-SAY
============================================================================
Your new Refinery CMS application is now installed and mounts at '/'
============================================================================
SAY