Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (35 sloc) 1.422 kb
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
portfolio_root = Pathname.new(File.expand_path(File.dirname(__FILE__) << "/.."))
rails_root = if defined?(Rails.root)
Rails.root
elsif defined?(RAILS_ROOT)
Pathname.new(RAILS_ROOT)
else
Pathname.new(ARGV.first)
end
if rails_root.exist?
[%w(db migrate), %w(public stylesheets), %w(public javascripts)].each do |dir|
rails_root.join(dir.join(File::SEPARATOR)).mkpath
end
copies = [
{:from => %w(db migrate), :to => %w(db migrate), :filename => "20100613212743_create_faqs.rb"}
# {:from => %w(public stylesheets), :to => %w(public stylesheets), :filename => "portfolio.css"},
# {:from => %w(public javascripts), :to => %w(public javascripts), :filename => "portfolio.js"}
]
copies.each do |copy|
copy_from = portfolio_root.join(copy[:from].join(File::SEPARATOR), copy[:filename])
copy_to = rails_root.join(copy[:to].join(File::SEPARATOR), copy[:filename])
unless copy_to.exist?
FileUtils::copy_file copy_from.to_s, copy_to.to_s
else
puts "'#{File.join copy[:to], copy[:filename]}' already existed in your application so your existing file was not overwritten."
end
end
puts "---------"
puts "Copied all refinerycms-faqs files."
puts "Now, run rake db:migrate"
else
puts "Please specify the path of the project that you want to use the faqs with, i.e. refinerycms-faqs-install /path/to/project"
end
Jump to Line
Something went wrong with that request. Please try again.