Fork Of

Revisions

gist: 57848 Download_button fork
public
Public Clone URL: git://gist.github.com/57848.git
Embed All Files: show embed
base_template.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# SUPER DARING APP TEMPLATE 1.0
# Originally By Peter Cooper
# Modified by Jason Seifer
# Modified by Philipe Farias
 
# Download a gist and create a new file in the Rails project. Specify the
# relative path from the RAILS_ROOT.
#
# Example:
# gist 6099, '.gitignore'
#
def gist(gist_id, filename, log_action=true)
  log 'gist', "#{gist_id} => #{filename}" if log_action
  file(filename, open('http://gist.github.com/%s.txt' % gist_id).read, false)
end
 
# 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/*"
run "rm -rf test"
 
# Todo Readme
run "echo TODO > README"
 
# Download JQuery
inside('public/javascripts') do
  run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.3.2.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}
 
# my .gitignore from http://gist.github.com/84470
gist 84470, '.gitignore'
 
# Install submoduled plugins
plugin 'cucumber', :git => 'git://github.com/aslakhellesoy/cucumber.git', :submodule => false
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git', :submodule => false
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git', :submodule => false
plugin 'object_daddy', :git => 'git://github.com/flogic/object_daddy.git', :submodule => false
 
# Install all gems
gem 'carlosbrando-remarkable', :lib => 'remarkable', :source => 'http://gems.github.com'
rake('gems:install', :sudo => true)
rake('gems:unpack')
 
# Set up sessions, RSpec, user model, OpenID, etc, and run migrations
run "haml --rails ."
generate("rspec")
generate("cucumber")
inside('spec') do
  run "rm -rf fixtures"
end
rake('db:migrate')
 
# Initialize submodules
git :submodule => "init"
 
# Commit all work so far to the repository
git :add => '.'
git :commit => "-a -m 'Initial commit'"
 
# Success!
puts "SUCCESS!"