From b35249e776a3cabd51a739baf172618fb5d731a3 Mon Sep 17 00:00:00 2001 From: AkitaOnRails Date: Sat, 8 Jan 2011 19:49:06 -0200 Subject: [PATCH 1/7] Making the README file more useful. Adding ruby-debug to the mix --- Gemfile | 10 ++++++++-- README.textile | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index caabe4a..c60f99b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gem 'rails', '3.0.3' gem 'sqlite3-ruby', :require => 'sqlite3' -gem "rails_admin", :git => 'git://github.com/sferik/rails_admin.git' +gem "rails_admin", :git => 'https://github.com/sferik/rails_admin.git' gem "haml-rails", ">= 0.2" gem "inherited_resources", ">=1.1.2" gem "will_paginate", ">=3.0.pre2" @@ -20,7 +20,7 @@ gem "inploy", ">=1.6.8" group :development do gem "autotest" gem "autotest-notification" - gem "rails3-generators", :git => "git://github.com/indirect/rails3-generators.git" + gem "rails3-generators", :git => "https://github.com/indirect/rails3-generators.git" gem "metric_fu", ">=1.5.1" end @@ -29,6 +29,12 @@ group :development, :test do gem "factory_girl_rails" gem "rspec-rails", ">=2.0.1" gem "evergreen", :require => "evergreen/rails" + platforms :mri_18 do + gem "ruby-debug" + end + platforms :mri_19 do + gem "ruby-debug19", :require => 'ruby-debug' + end end group :test do diff --git a/README.textile b/README.textile index 1a6abc4..d75dd5f 100644 --- a/README.textile +++ b/README.textile @@ -1 +1,17 @@ -
rails new app_name -T -m https://github.com/dcrec1/rails3_template/raw/master/main.rb
+Read the "Gemfile":blob/master/Gemfile to understand everything this template installs and pre-configures for you. + +One of gems, "Johnson":http://rubygems.org/gems/johnson, still has some issues compiling under Ruby 1.9.2 so you will need to use Ruby 1.8.7 instead. + +This template is heavily dependent on wget so, if you're using a Mac, you will need to install it first. The recommended way is to install "Homebrew":https://github.com/mxcl/homebrew first and then: + +
brew install wget
+ +Since Github started forcing SSL in all its URLs, we need to download the template file separately: + +
wget --no-check-certificate https://github.com/dcrec1/rails3_template/raw/master/main.rb -O /tmp/rails3_template.rb
+ +Then whenever you want to create a new project, just do: + +
rails new app_name -T -m /tmp/rails3_template.rb
+ +Change app_name for your project name. You can configure what you need and run rake db:migrate to get started. From bc6955e3fce13d86c08512d12b3f402393f1ceb5 Mon Sep 17 00:00:00 2001 From: Rainux Luo Date: Fri, 18 Feb 2011 02:45:33 +0800 Subject: [PATCH 2/7] Fixed compass installation --- main.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.rb b/main.rb index 87ecc07..a3d9e3a 100644 --- a/main.rb +++ b/main.rb @@ -25,8 +25,7 @@ generate "devise Admin" generate "rails_admin:install_admin" generate "barista:install" -run "gem install compass" -run "compass init --using blueprint --app rails --css-dir public/stylesheets" +run "compass init --using blueprint --app rails --css-dir public/stylesheets --sass-dir app/stylesheets" append_file "config/compass.rb", "require 'lemonade'" run "rm public/stylesheets/*" From 6b420cde7526ec76e658ff40dd05514ffa025339 Mon Sep 17 00:00:00 2001 From: Rainux Luo Date: Wed, 23 Feb 2011 02:43:38 +0800 Subject: [PATCH 3/7] Use yajl-ruby --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index c60f99b..60352c9 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ gem "lemonade", "0.3.4" gem "barista", ">= 0.5.0" gem "hoptoad_notifier", ">=2.3.6" gem "inploy", ">=1.6.8" +gem 'yajl-ruby', :require => 'yajl/json_gem' group :development do gem "autotest" From 5375846b29361c752e2381b40273d712c7df78ff Mon Sep 17 00:00:00 2001 From: AkitaOnRails Date: Wed, 23 Feb 2011 19:58:58 -0300 Subject: [PATCH 4/7] Making lots of modifications - read the README file --- Gemfile | 60 --------- README.textile | 47 ++++++- application.html.haml | 18 --- build.rake | 5 - build.sh | 2 - files/Gemfile | 56 +++++++++ files/application.html | 1 + files/application.html.erb | 29 +++++ files/application_spec.js | 39 ++++++ .../asset_packages.yml | 0 bootstrap.rake => files/bootstrap.rake | 0 files/build.rake | 5 + files/build.sh | 2 + devise_steps.rb => files/devise_steps.rb | 0 evergreen.rb => files/evergreen.rb | 0 factory_girl.rb => files/factory_girl.rb | 0 gitignore => files/gitignore | 0 grid.png => files/grid.png | Bin htaccess => files/htaccess | 0 files/html5.js | 6 + newrelic.yml => files/newrelic.yml | 0 overlay.png => files/overlay.png | Bin print.scss => files/print.scss | 0 files/rails_admin.rb | 23 ++++ screen.scss => files/screen.scss | 0 files/simple_form.scss | 43 +++++++ files/spec_helper.js | 36 ++++++ files/spec_helper.rb | 48 +++++++ users.rb => files/users.rb | 0 files/watchr.rake | 5 + files/watchr.rb | 19 +++ hoptoad.rb | 3 - main.rb | 119 +++++++++++++----- rails_admin.rb | 1 - remarkable.rb | 1 - 35 files changed, 442 insertions(+), 126 deletions(-) delete mode 100644 Gemfile delete mode 100644 application.html.haml delete mode 100644 build.rake delete mode 100644 build.sh create mode 100644 files/Gemfile create mode 100644 files/application.html create mode 100644 files/application.html.erb create mode 100644 files/application_spec.js rename asset_packages.yml => files/asset_packages.yml (100%) rename bootstrap.rake => files/bootstrap.rake (100%) create mode 100644 files/build.rake create mode 100644 files/build.sh rename devise_steps.rb => files/devise_steps.rb (100%) rename evergreen.rb => files/evergreen.rb (100%) rename factory_girl.rb => files/factory_girl.rb (100%) rename gitignore => files/gitignore (100%) rename grid.png => files/grid.png (100%) rename htaccess => files/htaccess (100%) create mode 100644 files/html5.js rename newrelic.yml => files/newrelic.yml (100%) rename overlay.png => files/overlay.png (100%) rename print.scss => files/print.scss (100%) create mode 100644 files/rails_admin.rb rename screen.scss => files/screen.scss (100%) create mode 100644 files/simple_form.scss create mode 100644 files/spec_helper.js create mode 100644 files/spec_helper.rb rename users.rb => files/users.rb (100%) create mode 100644 files/watchr.rake create mode 100644 files/watchr.rb delete mode 100644 hoptoad.rb delete mode 100644 rails_admin.rb delete mode 100644 remarkable.rb diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 60352c9..0000000 --- a/Gemfile +++ /dev/null @@ -1,60 +0,0 @@ -source 'http://rubygems.org' - -gem 'rails', '3.0.3' - -gem 'sqlite3-ruby', :require => 'sqlite3' - -gem "rails_admin", :git => 'https://github.com/sferik/rails_admin.git' -gem "haml-rails", ">= 0.2" -gem "inherited_resources", ">=1.1.2" -gem "will_paginate", ">=3.0.pre2" -gem "devise", ">=1.1.2" -gem "formtastic", ">=1.1.0" -gem "friendly_id", "~>3.0" -gem "compass", ">= 0.10.5" -gem "lemonade", "0.3.4" -gem "barista", ">= 0.5.0" -gem "hoptoad_notifier", ">=2.3.6" -gem "inploy", ">=1.6.8" -gem 'yajl-ruby', :require => 'yajl/json_gem' - -group :development do - gem "autotest" - gem "autotest-notification" - gem "rails3-generators", :git => "https://github.com/indirect/rails3-generators.git" - gem "metric_fu", ">=1.5.1" -end - -group :development, :test do - gem "evergreen" - gem "factory_girl_rails" - gem "rspec-rails", ">=2.0.1" - gem "evergreen", :require => "evergreen/rails" - platforms :mri_18 do - gem "ruby-debug" - end - platforms :mri_19 do - gem "ruby-debug19", :require => 'ruby-debug' - end -end - -group :test do - gem "rspec", ">=2.0.1" - gem "remarkable", ">=4.0.0.alpha4" - gem "remarkable_activemodel", ">=4.0.0.alpha4" - gem "remarkable_activerecord", ">=4.0.0.alpha4" - gem "capybara-envjs" -end - -group :cucumber do - gem "cucumber", ">=0.6.3" - gem "cucumber-rails", ">=0.3.2" - gem "capybara", ">=0.3.6" - gem "database_cleaner", ">=0.5.0" - gem "spork", ">=0.8.4" - gem "pickle", ">=0.4.2" -end - -group :production do - gem "newrelic_rpm", ">=2.12.3" -end diff --git a/README.textile b/README.textile index d75dd5f..0fb654a 100644 --- a/README.textile +++ b/README.textile @@ -1,4 +1,4 @@ -Read the "Gemfile":blob/master/Gemfile to understand everything this template installs and pre-configures for you. +Read the "Gemfile":blob/master/files/Gemfile to understand everything this template installs and pre-configures for you. One of gems, "Johnson":http://rubygems.org/gems/johnson, still has some issues compiling under Ruby 1.9.2 so you will need to use Ruby 1.8.7 instead. @@ -8,10 +8,51 @@ This template is heavily dependent on wget so, if you're using a Mac, you will n Since Github started forcing SSL in all its URLs, we need to download the template file separately: -
wget --no-check-certificate https://github.com/dcrec1/rails3_template/raw/master/main.rb -O /tmp/rails3_template.rb
+
wget --no-check-certificate https://github.com/akitaonrails/rails3_template/raw/master/main.rb -O /tmp/rails3_template.rb
Then whenever you want to create a new project, just do: -
rails new app_name -T -m /tmp/rails3_template.rb
+
rails new app_name -JT -m /tmp/rails3_template.rb
Change app_name for your project name. You can configure what you need and run rake db:migrate to get started. + +h2. CRITERIA + +This is intended to be an opinionated template. The options chosen have these reasons: + +* Standard ERB instead of HAML - even though HAML is great the pros and cons are too balanced to justify replacing ERB. +* Simple Form instead of Formtastic - to me, "feels" simpler +* SASS instead of pure CSS - this undeniably adds value on top of CSS making it easier to organize +* JQuery instead of Prototype - no need to say more +* Kaminari instead of Will Paginate - cleaner solution for pagination +* Pure Javascript instead of CoffeeScript - as HAML, the syntax gets more elegant, but there is no inherent advantages +* RSpec, Factory Girl Cucumber, Spork, Capybara, Celerity, Faker, Metric Fu - this is the universally accepted main test package, so be it +* Evergreen - testing Javascript is great and this seems to be the best so far +* Devise - the best authentication system so far +* Inherited Resources - lighter controllers +* Compass, Asset Packager, Lemonade - easier way to deal with images and other assets +* Cells - this is experimental but does bring advantages in making controller less cluttered and isolating components + +So, opinionated to a point, trying to stick to the basics where advantages are not so obvious. + +h2. TESTING + +Read Peter Cooper's "excellent tutorial":http://www.rubyinside.com/how-to-rails-3-and-rspec-2-4336.html on how to setup a fast testing environment: + +This template tries to do so. Before starting just run: + +
spork
+ +And in another terminal run: + +
rake watchr
+ +Also do not forget to modify config/environments/test.rb to reload classes: + +
config.cache_classes = false
+ +h2. CREDITS + +This Template is based on "Diego Carrion's template":https://github.com/dcrec1/rails3_template. The changes include removing HAML, Hoptoad, Coffeescript (Barista), Remarkable, adding yajl for json, thin, replacing will_paginate for kaminari, replacing autotest for watchr, enabling spork, replacing formtastic for simple_form, bundling gems within the app, + +Author: Fabio Akita (@AkitaOnRails) diff --git a/application.html.haml b/application.html.haml deleted file mode 100644 index 2f558b9..0000000 --- a/application.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -!!! 5 -%html - %head - %title - = raw stylesheet_link_merged('screen', :media => 'screen, projection') - = raw stylesheet_link_merged('print', :media => 'print') - /[if lt IE 8] - = raw stylesheet_link_merged('ie', :media => 'screen, projection') - = csrf_meta_tag - %body - #container - %header HEADER - %sidebar SIDEBAR - %section#content= yield - %footer FOOTER - %script{ :type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" } - %script{ :type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" } - = raw javascript_include_merged(:base) diff --git a/build.rake b/build.rake deleted file mode 100644 index ded6a4f..0000000 --- a/build.rake +++ /dev/null @@ -1,5 +0,0 @@ -task :clean do - system "rm rerun.txt" -end - -task :build => [:clean, 'db:migrate', :spec, 'barista:brew', 'spec:javascripts', :cucumber, 'metrics:all'] diff --git a/build.sh b/build.sh deleted file mode 100644 index d5ba5ea..0000000 --- a/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -bundle install ~/.bundle --without=production -rake build diff --git a/files/Gemfile b/files/Gemfile new file mode 100644 index 0000000..7c3b622 --- /dev/null +++ b/files/Gemfile @@ -0,0 +1,56 @@ +source 'http://rubygems.org' + +gem 'rails', '3.0.4' + +gem 'sqlite3-ruby', :require => 'sqlite3' + +gem "rails_admin", :git => 'https://github.com/sferik/rails_admin.git' +gem "inherited_resources" +gem "kaminari" +gem "devise" +gem "simple_form" +gem "friendly_id" +gem "compass" +gem "lemonade" +gem "cells" +gem 'yajl-ruby', :require => 'yajl/json_gem' + +group :development do + gem "watchr" + gem "rails3-generators", :git => "https://github.com/indirect/rails3-generators.git" + gem "metric_fu" +end + +group :development, :test do + gem "spork" + gem "thin" + gem "evergreen" + gem "factory_girl_rails" + gem "rspec-rails" + gem "faker" + gem "evergreen", :require => "evergreen/rails" + platforms :mri_18 do + gem "ruby-debug" + end + platforms :mri_19 do + gem "ruby-debug19", :require => 'ruby-debug' + end +end + +group :test do + gem "rspec" + gem "capybara-envjs" +end + +group :cucumber do + gem "cucumber" + gem "cucumber-rails" + gem "capybara" + gem "database_cleaner" + gem "spork" + gem "pickle" +end + +group :production do + gem "newrelic_rpm" +end diff --git a/files/application.html b/files/application.html new file mode 100644 index 0000000..4f39484 --- /dev/null +++ b/files/application.html @@ -0,0 +1 @@ + diff --git a/files/application.html.erb b/files/application.html.erb new file mode 100644 index 0000000..e868846 --- /dev/null +++ b/files/application.html.erb @@ -0,0 +1,29 @@ + + + + TITLE + <%= raw stylesheet_link_merged('screen', :media => 'screen, projection') %> + <%= raw stylesheet_link_merged('simple_form', :media => 'screen, projection') %> + <%= raw stylesheet_link_merged('print', :media => 'print') %> + + <%= csrf_meta_tag %> + + +
+
HEADER
+ SIDEBAR +
+ <% content_for :notice do %>

<%= notice %>

<% end %> + <% content_for :alert do %>

<%= alert %>

<% end %> + <%= yield %> +
+
FOOTER
+
+ + + <%= raw javascript_include_merged(:base) %> + + diff --git a/files/application_spec.js b/files/application_spec.js new file mode 100644 index 0000000..38c3dd3 --- /dev/null +++ b/files/application_spec.js @@ -0,0 +1,39 @@ +// Example of how to add javascript specs +// +// require("/jquery.js"); +// require("/jquery-ui.js"); +// require("/application.js"); +// $.ready(); +// +// describe("with main template", function() { +// template('application.html'); +// +// describe("on load", function() { +// beforeEach(function() { +// }); +// +// it("should set select as text inputs", function() { +// expect($("#sign_in")).toBeATextInput(); +// }); +// +// it("should not set all select as text inputs", function() { +// expect($("#select")).not.toBeATextInput(); +// }); +// +// it("should hide the anchor", function() { +// $("#container a.next").show(); +// $("#container a.next").click(); +// expect($("#playboard a.next")).toBeHidden(); +// }); +// +// it("should show .matches nav a.prev", function() { +// $("#container a.prev").hide(); +// $("#container a.next").click(); +// expect($("#playboard a.prev")).toBeVisible(); +// }); +// +// it("should prevent the event default", function() { +// expect(eventForSelectorHandler("#container a.prev", "click")).toBeDefaultPrevented(); +// }); +// }) +// }) diff --git a/asset_packages.yml b/files/asset_packages.yml similarity index 100% rename from asset_packages.yml rename to files/asset_packages.yml diff --git a/bootstrap.rake b/files/bootstrap.rake similarity index 100% rename from bootstrap.rake rename to files/bootstrap.rake diff --git a/files/build.rake b/files/build.rake new file mode 100644 index 0000000..fe5447f --- /dev/null +++ b/files/build.rake @@ -0,0 +1,5 @@ +task :clean do + system "rm rerun.txt" +end + +task :build => [:clean, 'db:migrate', :spec, 'spec:javascripts', :cucumber, 'metrics:all'] diff --git a/files/build.sh b/files/build.sh new file mode 100644 index 0000000..27a8e6e --- /dev/null +++ b/files/build.sh @@ -0,0 +1,2 @@ +bundle install --without=production +rake build diff --git a/devise_steps.rb b/files/devise_steps.rb similarity index 100% rename from devise_steps.rb rename to files/devise_steps.rb diff --git a/evergreen.rb b/files/evergreen.rb similarity index 100% rename from evergreen.rb rename to files/evergreen.rb diff --git a/factory_girl.rb b/files/factory_girl.rb similarity index 100% rename from factory_girl.rb rename to files/factory_girl.rb diff --git a/gitignore b/files/gitignore similarity index 100% rename from gitignore rename to files/gitignore diff --git a/grid.png b/files/grid.png similarity index 100% rename from grid.png rename to files/grid.png diff --git a/htaccess b/files/htaccess similarity index 100% rename from htaccess rename to files/htaccess diff --git a/files/html5.js b/files/html5.js new file mode 100644 index 0000000..3587bf7 --- /dev/null +++ b/files/html5.js @@ -0,0 +1,6 @@ +// html5shiv MIT @rem remysharp.com/html5-enabling-script +// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector +/*@cc_on(function(m,c){var z="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video";function n(d){for(var a=-1;++ai";if(g.childNodes.length!==1){var i=z.split("|"),o=i.length,s=RegExp("(^|\\s)("+z+")", +"gi"),t=RegExp("<(/*)("+z+")","gi"),u=RegExp("(^|[^\\n]*?\\s)("+z+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),r=c.createDocumentFragment(),k=c.documentElement;g=k.firstChild;var h=c.createElement("body"),l=c.createElement("style"),f;n(c);n(r);g.insertBefore(l, +g.firstChild);l.media="print";m.attachEvent("onbeforeprint",function(){var d=-1,a=p(c.styleSheets,"all"),e=[],b;for(f=f||c.body;(b=u.exec(a))!=null;)e.push((b[1]+b[2]+b[3]).replace(s,"$1.iepp_$2")+b[4]);for(l.styleSheet.cssText=e.join("\n");++d true, :views => false g.integration_tool :rspec, :fixture => true, :views => true g.fixture_replacement :factory_girl, :dir => "spec/support/factories" @@ -19,43 +21,53 @@ generate "cucumber:install --capybara --rspec --spork" generate "pickle --path --email" generate "friendly_id" -generate "formtastic:install" +generate "simple_form:install" generate "devise:install" generate "devise User" generate "devise Admin" generate "rails_admin:install_admin" -generate "barista:install" run "compass init --using blueprint --app rails --css-dir public/stylesheets --sass-dir app/stylesheets" + append_file "config/compass.rb", "require 'lemonade'" +remove_file ".rspec" +create_file ".rspec", "--colour --drb" + run "rm public/stylesheets/*" +run "mkdir -p app/cells spec/javascripts spec/javascripts/templates" run "wget --no-check-certificate 'https://github.com/rails/jquery-ujs/raw/master/src/rails.js' -O public/javascripts/rails.js" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/gitignore' -O .gitignore" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/screen.scss' -O app/stylesheets/screen.scss" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/print.scss' -O app/stylesheets/print.scss" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/application.html.haml' -O app/views/layouts/application.html.haml" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/factory_girl.rb' -O features/support/factory_girl.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/devise_steps.rb' -O features/step_definitions/devise_steps.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/remarkable.rb' -O spec/support/remarkable.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/users.rb' -O spec/support/factories/users.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/build.rake' -O lib/tasks/build.rake" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/bootstrap.rake' -O lib/tasks/bootstrap.rake" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/build.sh' -O build.sh" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/overlay.png' -O public/images/overlay.png" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/newrelic.yml' -O config/newrelic.yml" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/hoptoad.rb' -O config/initializers/hoptoad.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/rails_admin.rb' -O config/initializers/rails_admin.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/htaccess' -O public/.htaccess" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/asset_packages.yml' -O config/asset_packages.yml" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/evergreen.rb' -O config/evergreen.rb" -run "wget --no-check-certificate 'https://github.com/dcrec1/rails3_template/raw/master/grid.png' -O public/images/grid.png" - -create_file 'config/deploy.rb', <<-DEPLOY -application = '#{app_name}' -repository = '' -hosts = %w() -DEPLOY +run "wget --no-check-certificate '#{BASE_URI}/gitignore' -O .gitignore" +run "wget --no-check-certificate '#{BASE_URI}/screen.scss' -O app/stylesheets/screen.scss" +run "wget --no-check-certificate '#{BASE_URI}/print.scss' -O app/stylesheets/print.scss" +run "wget --no-check-certificate '#{BASE_URI}/simple_form.scss' -O app/stylesheets/simple_form.scss" +run "wget --no-check-certificate '#{BASE_URI}/application.html.erb' -O app/views/layouts/application.html.erb" +run "wget --no-check-certificate '#{BASE_URI}/factory_girl.rb' -O features/support/factory_girl.rb" +run "wget --no-check-certificate '#{BASE_URI}/devise_steps.rb' -O features/step_definitions/devise_steps.rb" +run "wget --no-check-certificate '#{BASE_URI}/users.rb' -O spec/support/factories/users.rb" +run "wget --no-check-certificate '#{BASE_URI}/build.rake' -O lib/tasks/build.rake" +run "wget --no-check-certificate '#{BASE_URI}/build.sh' -O build.sh" +run "wget --no-check-certificate '#{BASE_URI}/bootstrap.rake' -O lib/tasks/bootstrap.rake" +run "wget --no-check-certificate '#{BASE_URI}/overlay.png' -O public/images/overlay.png" +run "wget --no-check-certificate '#{BASE_URI}/newrelic.yml' -O config/newrelic.yml" +run "wget --no-check-certificate '#{BASE_URI}/rails_admin.rb' -O config/initializers/rails_admin.rb" +run "wget --no-check-certificate '#{BASE_URI}/htaccess' -O public/.htaccess" +run "wget --no-check-certificate '#{BASE_URI}/asset_packages.yml' -O config/asset_packages.yml" +run "wget --no-check-certificate '#{BASE_URI}/evergreen.rb' -O config/evergreen.rb" +run "wget --no-check-certificate '#{BASE_URI}/grid.png' -O public/images/grid.png" +run "wget --no-check-certificate '#{BASE_URI}/html5.js' -O public/javascripts/html5.js" +run "wget --no-check-certificate '#{BASE_URI}/spec_helper.rb' -O spec/spec_helper.rb" +run "wget --no-check-certificate '#{BASE_URI}/application.html' -O spec/javascripts/templates/application.html" +run "wget --no-check-certificate '#{BASE_URI}/application_spec.js' -O spec/javascripts/application_spec.js" +run "wget --no-check-certificate '#{BASE_URI}/spec_helper.js' -O spec/javascripts/spec_helper.js" +run "wget --no-check-certificate '#{BASE_URI}/watchr.rb' -O .watchr" +run "wget --no-check-certificate '#{BASE_URI}/watchr.rake' -O lib/tasks/watchr.rake" +run "wget --no-check-certificate '#{I18N_BASE_URI}/en-US.yml' -O config/locales/en.yml" +run "wget --no-check-certificate '#{I18N_BASE_URI}/pt-BR.yml' -O config/locales/pt-BR.yml" +run "wget http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js public/javascripts/jquery.js" +run "wget http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js public/javascripts/jquery-ui.js" + +run "chmod u+x build.sh" append_file 'Rakefile', <<-METRIC_FU @@ -69,12 +81,53 @@ Synthesis::AssetPackage.merge_environments = %w(staging production) ASSET_PACKAGER -run "mkdir -p app/coffeescripts spec/javascripts spec/javascripts/templates" -run "chmod u+x build.sh" +remove_file 'README' +create_file 'README', <<-README +== Rails 3 Application + +Install Ruby 1.8.7 or Ruby Enterprise Edition (http://www.rubyenterpriseedition.com). + +To run tests open a Terminal and run: + + spork + +Now open a new Terminal and run: + + rake watchr + +If you want to run the entire Test Suite run: + + rspec spec + +With Thin, instead of 'rails server', you can start the server like this: + + thin start + +README git :init git :add => '.' git :add => 'public/javascripts/rails.js --force' git :commit => '-am "Initial commit"' -puts "SUCCESS!" +puts <<-MSG + +SUCCESS! + +Read the README file and do not forget to change a few things. + +== Spork: + + Ensure you enable class reload within the test environment by changing the + config/environments/test.rb to have: + + config.cache_classes = false + +== Devise: + + Ensure you have defined root_url to *something* in your config/routes.rb. + For example: + + root :to => "home#index" + +MSG diff --git a/rails_admin.rb b/rails_admin.rb deleted file mode 100644 index 110a62f..0000000 --- a/rails_admin.rb +++ /dev/null @@ -1 +0,0 @@ -RailsAdmin.authenticate_with { authenticate_admin! } diff --git a/remarkable.rb b/remarkable.rb deleted file mode 100644 index 83aae44..0000000 --- a/remarkable.rb +++ /dev/null @@ -1 +0,0 @@ -require 'remarkable/active_record' From 16b792e9602a6e6ec0dc256e52c7e59ce1ed5c24 Mon Sep 17 00:00:00 2001 From: AkitaOnRails Date: Thu, 24 Feb 2011 00:23:52 -0300 Subject: [PATCH 5/7] forgot to add -O in the jquery download routine --- main.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.rb b/main.rb index 183f4f7..4b56c10 100644 --- a/main.rb +++ b/main.rb @@ -64,8 +64,8 @@ run "wget --no-check-certificate '#{BASE_URI}/watchr.rake' -O lib/tasks/watchr.rake" run "wget --no-check-certificate '#{I18N_BASE_URI}/en-US.yml' -O config/locales/en.yml" run "wget --no-check-certificate '#{I18N_BASE_URI}/pt-BR.yml' -O config/locales/pt-BR.yml" -run "wget http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js public/javascripts/jquery.js" -run "wget http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js public/javascripts/jquery-ui.js" +run "wget http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js -O public/javascripts/jquery.js" +run "wget http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js -O public/javascripts/jquery-ui.js" run "chmod u+x build.sh" From 46a8df6a068f3b0dca7807bf5857db299fb87fda Mon Sep 17 00:00:00 2001 From: AkitaOnRails Date: Thu, 24 Feb 2011 10:30:09 -0300 Subject: [PATCH 6/7] Adding rspec-cells to Gemfile --- files/Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/files/Gemfile b/files/Gemfile index 7c3b622..924af8b 100644 --- a/files/Gemfile +++ b/files/Gemfile @@ -27,6 +27,7 @@ group :development, :test do gem "evergreen" gem "factory_girl_rails" gem "rspec-rails" + gem "rspec-cells" gem "faker" gem "evergreen", :require => "evergreen/rails" platforms :mri_18 do From 9aaa41a503df1095d327b776890916972c8e18ad Mon Sep 17 00:00:00 2001 From: Bruno Barros Date: Thu, 3 Mar 2011 01:42:54 -0300 Subject: [PATCH 7/7] Upgrading to rails 3.0.5, fixes some bugs --- files/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/Gemfile b/files/Gemfile index 924af8b..afd4134 100644 --- a/files/Gemfile +++ b/files/Gemfile @@ -1,6 +1,6 @@ source 'http://rubygems.org' -gem 'rails', '3.0.4' +gem 'rails', '3.0.5' gem 'sqlite3-ruby', :require => 'sqlite3'