# SUPER DARING APP TEMPLATE 1.0 # Originally By Peter Cooper # Modified by Jason Seifer # Link to local copy of edge rails inside('vendor') { run 'ln -s ~/Source/rails rails' } # Delete unnecessary files run "rm README" run "rm public/index.html" run "rm public/favicon.ico" run "rm public/robots.txt" run "rm -f public/javascripts/*" # Download JQuery inside('public/javascripts') do run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.3.min.js > jquery.js" run "curl -d 'version=1.6rc5&compression=jsmin&files%5B%5D=ui.core.js&files%5B%5D=ui.draggable.js&files%5B%5D=ui.droppable.js&files%5B%5D=ui.resizable.js&files%5B%5D=ui.selectable.js&files%5B%5D=ui.sortable.js&files%5B%5D=ui.accordion.js&files%5B%5D=ui.dialog.js&files%5B%5D=ui.slider.js&files%5B%5D=ui.tabs.js&files%5B%5D=ui.datepicker.js&files%5B%5D=ui.progressbar.js&files%5B%5D=effects.core.js&files%5B%5D=effects.blind.js&files%5B%5D=effects.bounce.js&files%5B%5D=effects.clip.js&files%5B%5D=effects.drop.js&files%5B%5D=effects.explode.js&files%5B%5D=effects.fold.js&files%5B%5D=effects.highlight.js&files%5B%5D=effects.pulsate.js&files%5B%5D=effects.scale.js&files%5B%5D=effects.shake.js&files%5B%5D=effects.slide.js&files%5B%5D=effects.transfer.js' http://ui.jquery.com/actions/download_builder.php -L > jqueryui.zip" run "curl -L http://ui.jquery.com/applications/themeroller/download.php?href=/applications/themeroller/css/parseTheme.css.php?ctl=themeroller > theme.zip" run "unzip theme.zip -d jquery-ui-theme" run "rm theme.zip" run "unzip jqueryui.zip" run "rm jqueryui.zip" run "rm -rf ui" run "find . -name \"jquery-ui*.js\" | xargs -I xxx mv xxx jquery-ui.js" end # Set up git repository git :init git :add => '.' # Copy database.yml for distribution use run "cp config/database.yml config/database.yml.example" # Set up .gitignore files run "touch tmp/.gitignore log/.gitignore vendor/.gitignore" run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore} file '.gitignore', <<-END .DS_Store log/*.log tmp/**/* config/database.yml db/*.sqlite3 END inside('app') { run "mkdir presenters" } run "rm config/environment.rb" run "touch config/environment.rb" file 'config/environment.rb', <<-END RAILS_GEM_VERSION = '2.3.0' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| config.load_paths += %W( \#\{RAILS_ROOT\}/app/presenters ) # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named # config.plugins = [ :exception_notification, :ssl_requirement, :all ] # Activate observers that should always be running # config.active_record.observers = :cacher, :garbage_collector, :forum_observer config.action_controller.session = { :session_key => '_#{(1..6).map { |x| (65 + rand(26)).chr }.join}_session', :secret => '#{(1..40).map { |x| (65 + rand(26)).chr }.join}' } config.time_zone = 'UTC' end END # Install submoduled plugins plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git', :submodule => true plugin 'role_requirement', :git => 'git://github.com/timcharper/role_requirement.git', :submodule => true plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => false plugin 'forgot_password', :git => 'git://github.com/greenisus/forgot_password', :submodule => false # Install all gems gem 'rack' # remove when edge rails fixes.. gem 'active_presenter' # gem 'RedCloth', :lib => 'redcloth' gem 'hpricot', :source => 'http://code.whytheluckystiff.net' gem 'webrat' gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => 'http://gems.github.com' gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com' gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => 'http://gems.github.com' gem 'jeremymcanally-context', :lib => 'context', :source => 'http://gems.github.com' rake('gems:install', :sudo => true) rake('gems:unpack') # Set up sessions, RSpec, user model, OpenID, etc, and run migrations generate("authenticated", "user session") generate("roles", "Role User") generate('forgot_password', 'password user') rake('db:migrate') run "touch test/factories.rb" # Initialize submodules git :submodule => "init" # Commit all work so far to the repository git :add => '.' git :commit => "-a -m 'Initial commit'" # Success! puts "SUCCESS!"