From fbcf18533e01d5d6b6a3940543edf69b78d658b8 Mon Sep 17 00:00:00 2001 From: Dan Engle Date: Mon, 9 Mar 2009 19:35:43 -0400 Subject: [PATCH] initial commit --- .gitignore | 1 + README | 0 base_template.rb | 133 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 .gitignore create mode 100644 README create mode 100644 base_template.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd5106f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_STORE diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/base_template.rb b/base_template.rb new file mode 100644 index 0000000..78771ab --- /dev/null +++ b/base_template.rb @@ -0,0 +1,133 @@ +run "touch public/stylesheets/styles.css" +run "cp config/database.yml condig/database.yml.example" +run "touch tmp/.gitignore log/.gitignore vendor/.gitignore" + +if yes?("Use mysql for development?") + # how do you access the app name from the rails command? + app_name = ask("Enter the name of the database to create") + file "config/database.yml", <<-END +development: + adapter: mysql + database: #{app_name}_development + username: root + password: + host: localhost + +test: + adapter: sqlite3 + database: db/test.sqlite3 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/test.sqlite3 + timeout: 5000 +END + run "mysqladmin -u root create #{app_name}_development" +end + +run "echo TODO > README" +run "rm public/index.html" + +plugin "will_paginate", :git => "git://github.com/engled68/will_paginate.git" +plugin "rspec", :git => "git://github.com/dchelimsky/rspec.git" +plugin "rspec-rails", :git => "git://github.com/dchelimsky/rspec-rails.git" +plugin "aasm", :git => "git://github.com/rubyist/aasm.git" +plugin "restful-authentication", :git => "git://github.com/technoweenie/restful-authentication.git" +plugin "exception_notification", :git => "git://github.com/rails/exception_notification.git" + +if yes?("Do you want to use query_reviewer?") + plugin "query_reviewer", :git => "git://github.com/dsboulder/query_reviewer.git" +end + +generate :rspec +generate :authenticated, "user sessions --include-activation --aasm --rspec" + +generate :controller, "welcome index" +route "map.root :controller => 'welcome'" + +# reset css from http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ +file "public/stylesheets/reset.css", <<-END +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} +/* remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; +} +ol, ul { + list-style: none; +} +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +END + +run "curl http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js > public/javascripts/jquery-1.3.2.min.js" + +file "app/views/layouts/application.html.erb", <<-END + + + + + + <%= controller.controller_name %>: <%= controller.action_name %> + <%= javascript_include_tag "jquery-1.3.2.min.js", "application" %> + <%= stylesheet_link_tag "reset", "styles" %> + + + +

<%= flash[:notice] %>

+ +<%= yield %> + + + +END + +git :init + +file ".gitignore", <<-END +.DS_STORE +log/*.log +tmp/**/* +config/database.yml +db/*.sqlite3 +END + +git :add => ".", :commit => "-m 'initial commit'" \ No newline at end of file