Skip to content

Commit

Permalink
Ensure that an ExecJS runtime is available for realsies.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt authored and ugisozols committed Mar 26, 2012
1 parent 5345d11 commit eab9377
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions templates/refinery/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
require 'execjs'
::ExecJS::Runtimes.autodetect
rescue
gsub_file 'Gemfile', "# gem 'therubyracer'", "gem 'therubyracer'"
require 'pathname'
if Pathname.new(destination_root.to_s).join('Gemfile').read =~ /therubyracer/
gsub_file 'Gemfile', "# gem 'therubyracer'", "gem 'therubyracer'"
else
append_file 'Gemfile', <<-GEMFILE
group :assets do
# Added by Refinery. We want to ensure that you have an ExecJS runtime available!
gem 'therubyracer'
end
GEMFILE
end
end

append_file 'Gemfile' do
"
append_file 'Gemfile', <<-GEMFILE
# Refinery CMS
gem 'refinerycms', '~> #{VERSION_BAND}'
Expand All @@ -22,15 +32,14 @@
# gem 'refinerycms-inquiries', '~> #{VERSION_BAND}'
# gem 'refinerycms-search', '~> #{VERSION_BAND}'
# gem 'refinerycms-page-images', '~> #{VERSION_BAND}'
"
end
GEMFILE

run 'bundle install'
rake 'db:create'
generate "refinery:cms --fresh-installation #{ARGV.join(' ')}"

say <<-eos
say <<-SAY
============================================================================
Your new Refinery CMS application is now installed and mounts at '/'
============================================================================
eos
SAY

0 comments on commit eab9377

Please sign in to comment.