-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.rb
More file actions
24 lines (17 loc) · 830 Bytes
/
install.rb
File metadata and controls
24 lines (17 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
begin
require "fileutils"
include FileUtils::Verbose
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..")) unless defined?(RAILS_ROOT)
source_dir = File.join(File.dirname(__FILE__), "src")
rails_root = (Rails::VERSION::MAJOR == 2 ? RAILS_ROOT : Rails.root)
destination_dir = File.join(rails_root, "lib", "rooster")
template_filename = "rooster_daemon.rb"
source_file = File.join(source_dir, template_filename)
destination_file = File.join(destination_dir, template_filename)
FileUtils.mkdir_p(destination_dir)
FileUtils.copy_file(source_file, destination_file, :force => true)
FileUtils.chmod 0755, destination_file
puts File.read(File.join(File.dirname(__FILE__), 'README.markdown'))
rescue
puts "Installation encountered an exception: #{$!}"
end