This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
require 'time' | |
# Submission for RPCFN: Business Hours (#10) | |
# Theo Mills - June 2010 | |
# | |
# BusinessHours creates a calendar of daily operating schedules for | |
# days-of-the-week and specific dates. | |
# | |
# Opening and closing times are stored as an array of strings, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------------------- | |
# Remove unnecessary Rails files | |
#---------------------------------------------------------------------------- | |
run 'rm README' | |
run 'rm Gemfile' | |
run 'rm config/database.yml' | |
run 'rm public/index.html' | |
run 'rm public/favicon.ico' | |
run 'rm public/images/rails.png' | |
run 'touch README' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file 'Gemfile', %{ | |
source 'http://rubygems.org' | |
gem 'rails', '#{Rails::VERSION::STRING}' | |
group :development do | |
gem 'ruby-debug' | |
end | |
}.strip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------------------- | |
# Remove unnecessary Rails files | |
#---------------------------------------------------------------------------- | |
run 'rm README' | |
run 'rm public/index.html' | |
run 'rm public/favicon.ico' | |
run 'rm public/images/rails.png' | |
run 'touch README' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rotate log files (50 files max at 1MB each) | |
log_path = '#{Rails.root}/log/#{Rails.env}.log' | |
# Alter the application file with new configs | |
gsub_file 'config/application.rb', /# Custom directories with classes and modules you want to be autoloadable./ , %{ | |
config.logger = Logger.new(\"#{log_path}\", 50, 1048576) | |
config.autoload_paths += %W(\#{config.root}/lib) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "ruby-debug", :group => :development | |
gem "machinist", :group => :test | |
gem "rspec", :group => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run 'rm public/javascripts/controls.js' | |
run 'rm public/javascripts/dragdrop.js' | |
run 'rm public/javascripts/effects.js' | |
run 'rm public/javascripts/prototype.js' | |
run "cd tmp; git clone git://gist.github.com/556570.git application.html.haml" | |
run "cp -R tmp/application.html.haml app/views/layouts" | |
run "cd tmp; git clone http://github.com/paulirish/html5-boilerplate.git" | |
run "cp -R tmp/html5-boilerplate/*.* public/" | |
run "cp -R tmp/html5-boilerplate/js/* public/javascripts/" | |
run "cp -R tmp/html5-boilerplate/css/* public/stylesheets/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'haml', '3.0.14' | |
gem "rails3-generators", :group => :development | |
gsub_file 'config/application.rb', /# Configure the default encoding used in templates for Ruby 1.9./ do | |
<<-RUBY | |
config.generators do |g| | |
g.template_engine :haml | |
end | |
# Configure the default encoding used in templates for Ruby 1.9. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "setting up Gemfile for Devise..." | |
append_file 'Gemfile', "\n# Bundle gem needed for Devise\n" | |
gem 'devise', '1.1.1' | |
puts "installing Devise gem (takes a few minutes!)..." | |
run 'bundle install' | |
run "rails g devise:install" | |
puts "modifying environment configuration files for Devise..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "setting up Gemfile for Mongoid..." | |
gsub_file 'Gemfile', /gem \'sqlite3-ruby/, '# gem \'sqlite3-ruby' | |
append_file 'Gemfile', "\n# Bundle gems needed for Mongoid\n" | |
gem 'mongoid', '2.0.0.beta.16' | |
gem 'bson_ext', '1.0.4' | |
puts "installing Mongoid gems (takes a few minutes!)..." | |
run 'bundle install' | |
puts "creating 'config/mongoid.yml' Mongoid configuration file..." |
OlderNewer