diff --git a/README.md b/README.md index ffebfbb..7aa572f 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,45 @@ Usage ===== -`rails new app_name -J -m http://github.com/aentos/rails3-templates/main.rb` +`rails new app_name -J -m http://github.com/recrea/rails3-templates/main.rb` Gems ==== General use ----------- -* [will_paginate](http://github.com/mislav/will_paginate) -* [attrtastic](http://github.com/MBO/attrtastic) -* [formtastic](http://github.com/justinfrench/formtastic) * [haml-rails](http://github.com/indirect/haml-rails) +* [inherited_resources](http://github.com/josevalim/inherited_resources) +* [friendly_id](http://github.com/norman/friendly_id) * [compass](http://github.com/chriseppstein/compass) -* [inherited_resources] +* [fancy_buttons](http://github.com/imathis/fancy-buttons) +* [simple_form](http://github.com/plataformatec/simple_form) +* [show_for](http://github.com/plataformatec/show_for) +* [will_paginate](http://github.com/mislav/will_paginate) +* [tabs_on_rails](http://github.com/weppos/tabs_on_rails) +* [breadcrumbs_on_rails](http://github.com/weppos/breadcrumbs_on_rails) +* [paperclip](http://github.com/thoughtbot/paperclip) +* [metasearch](http://github.com/ernie/meta_search) Development ----------- Testing ------- -* [shoulda] -* [factory_girl] -* [cucumber] -* [capybara] -* [faker](http://faker.rubyforge.org/) +* [shoulda](http://github.com/thoughtbot/shoulda) +* [factory_girl](http://github.com/thoughtbot/factory_girl) +* [cucumber](http://github.com/aslakhellesoy/cucumber) +* [capybara](http://github.com/jnicklas/capybara) +* [faker](http://github.com/stympy/faker) + +Production +---------- +* [whenever](http://github.com/javan/whenever) +* [backup](http://github.com/meskyanichi/backup) Optional -------- * [hoptoad_notifier](http://github.com/thoughtbot/hoptoad_notifier) +* [exceptional_notifier](http://getexceptional.com) Plugins ======= @@ -35,5 +47,6 @@ Plugins Other tools =========== -* [960 grid system](http://960.gs/) -* [Hoptoad](http://hoptoadapp.com/) \ No newline at end of file +* [Exceptional](http://getexceptional.com/) +* [Hoptoad](http://hoptoadapp.com/) + diff --git a/application_blueprint.html.haml b/application.html.haml similarity index 56% rename from application_blueprint.html.haml rename to application.html.haml index 59c32c8..8de9956 100644 --- a/application_blueprint.html.haml +++ b/application.html.haml @@ -1,11 +1,14 @@ !!! 5 -%html +%html{:lang => I18n.locale} %head + %title= "[Default title] #{yield(:title)}" + /meta %meta{ :charset => "utf-8" }/ - -# - Always force latest IE rendering engine (even in intranet) & Chrome Frame - Remove this if you use the .htaccess - %meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }/ + %meta{ :name => "robots", :content => "noindex, nofollow" }/ + %meta{ :name => "MSSmartTagsPreventParsing", :content => "true" }/ + %meta{ 'http-equiv' => "pragma", :content => "no-cache" }/ + %meta{ 'http-equiv' => "imagetoolbar", :content => "no" }/ + %meta{ 'http-equiv' => "X-UA-Compatible", :content => "IE=edge,chrome=1" }/ %meta{ :content => "", :name => "description" }/ %meta{ :content => "", :name => "author" }/ %meta{ :content => "", :name => "keywords" }/ @@ -13,19 +16,24 @@ -# Mobile viewport optimized: j.mp/bplateviewport %meta{ :content => "width=device-width; initial-scale=1.0", :name => "viewport" }/ - -# Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references - -# %link{ :href => "/favicon.ico", :rel => "shortcut icon" }/ - -# %link{ :href => "/apple-touch-icon.png", :rel => "apple-touch-icon" }/ + /dublincore + %link{:rel => "meta", :type => "application/rdf+xml", :href => "application.rdf"} + + /hidden nav + %link{:rel => "shortcut icon", :type => "vnd.microsoft.icon", :href => "/images/favicon.ico"} + %link{:rel => "shortcut icon", :href => "/images/favicon.png"} + %link{:rel => "apple-touch-icon", :href => "/images/ipicon.png"} + %link{:rel => "start", :href => "[Web URL]", :title => "[Default title]"} + %link{:rel => "made", :href => "mailto:info@recrea.es"} + %link{:rel => "alternate", :type => "application/rss+xml", :href => "[RSS URL]", :title => "RSS"} - %title= "[Default title] #{yield(: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') - -# For the less-enabled mobile browsers like Opera Mini = raw stylesheet_link_merged('handheld', :media => 'handheld') = csrf_meta_tag - %body{ :class => "#{controller.controller_name}" } + %body #container #header HEADER #sidebar SIDEBAR diff --git a/application_960.html.haml b/application_960.html.haml deleted file mode 100644 index 1bc326c..0000000 --- a/application_960.html.haml +++ /dev/null @@ -1,40 +0,0 @@ -!!! 5 -%html - %head - %meta{ :charset => "utf-8" }/ - -# - Always force latest IE rendering engine (even in intranet) & Chrome Frame - Remove this if you use the .htaccess - %meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }/ - %meta{ :content => "", :name => "description" }/ - %meta{ :content => "", :name => "author" }/ - %meta{ :content => "", :name => "keywords" }/ - %meta{ :content => "", :name => "copyright" }/ - -# Mobile viewport optimized: j.mp/bplateviewport - %meta{ :content => "width=device-width; initial-scale=1.0", :name => "viewport" }/ - - -# Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references - -# %link{ :href => "/favicon.ico", :rel => "shortcut icon" }/ - -# %link{ :href => "/apple-touch-icon.png", :rel => "apple-touch-icon" }/ - - %title= "[Default title] #{yield(:title)}" - = raw stylesheet_link_merged('screen') - -# For the less-enabled mobile browsers like Opera Mini - = raw stylesheet_link_merged('handheld', :media => 'handheld') - = csrf_meta_tag - %body{ :class => "#{controller.controller_name}" } - #container - #header HEADER - #sidebar SIDEBAR - #content - #flash - - flash.each do |key, value| - %div{ :title => key.to_s.humanize, :class => key } - %p= value - = yield - #footer - %p.copyright - Copyright © #{Date.today.year} - %script{ :type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" } - %script{ :type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js" } - = raw javascript_include_merged(:base) \ No newline at end of file diff --git a/capistrano.rb b/capistrano.rb index 6e15f1b..411502e 100644 --- a/capistrano.rb +++ b/capistrano.rb @@ -4,7 +4,7 @@ app_name = ask "\r\n\r\nEnter the application name:" server = ask "\r\n\r\nEnter the servername or IP:" -git_repo = ask "\r\n\r\nEnter the git repo URL, e.g. git@github.com:aentos/app.git :" +git_repo = ask "\r\n\r\nEnter the git repo URL, e.g. git@github.com:recrea/app.git :" file 'config/deploy.rb', <<-FILE # Bundler Integration diff --git a/devise.rb b/devise.rb index 9dd8cf4..e6fb485 100644 --- a/devise.rb +++ b/devise.rb @@ -2,8 +2,6 @@ run "bundle install" generate "devise:install" -generate "devise User" -generate "devise Admin" git :add => '.' git :commit => 'm "Devise"' \ No newline at end of file diff --git a/main.rb b/main.rb index 562c858..38cd774 100644 --- a/main.rb +++ b/main.rb @@ -1,80 +1,82 @@ -puts "\r\n\r\n*****************************************************************************************************" -puts "Let me ask you a few questions before i start bootstrapping your app" -puts "*****************************************************************************************************" - -hoptoad_key = ask("\r\n\r\nWant to use your Hoptoad Account?\n\r\n\rEnter your API Key, or press Enter to skip") -locale_str = ask("Enter a list of locales you want to use separated by commas (e.g. 'es, de, fr'). For a reference list visit http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/. Press enter to skip: ") -auth_option = ask("\r\n\r\nWhat authentication framework do you want to use?\r\n\r\n(1) Devise\r\n(2) Authlogic\r\n(3) Omniauth\r\nPress Enter to skip") -deploy_option = ask("\r\n\r\nWhat deploy method do you want to use?\r\n\r\n(1) Capistrano\r\n(2) Inploy\r\nPress Enter to skip") -css_framework_option = ask("\r\n\r\nWhat CSS framework do you want to use?\r\n\r\n(1) 960\r\n(2) Blueprint\r\nPress Enter for 960 (default)") -if ["1", "2", "3"].include?(auth_option) - auth = "devise" if auth_option=="1" - auth = "authlogic" if auth_option=="2" - auth = "omniauth" if auth_option=="3" +puts '\r\n\r\n*****************************************************************************************************' +puts 'Let me ask you a few questions before I start bootstrapping your app' +puts '*****************************************************************************************************' + +auth_option = ask('\r\n\r\nWhat authentication framework do you want to use?\r\n\r\n(1) Devise\r\n(2) Authlogic\r\n(3) Omniauth\r\nPress Enter to skip') +deploy_option = ask('\r\n\r\nWhat deploy method do you want to use?\r\n\r\n(1) Capistrano\r\n(2) Inploy\r\nPress Enter to skip') +locale_str = ask('Enter a list of locales you want to use separated by commas (e.g. 'es, de, fr'). For a reference list visit http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/. Press enter to skip: ') +exceptions_option = ask('\r\n\r\nWhat exceptions tracker do you want to use?\r\n\r\n(1) Exceptional\r\n(2) Hoptoad\r\nPress Enter to skip') + +if ['1', '2', '3'].include?(auth_option) + auth = 'devise' if auth_option=='1' + auth = 'authlogic' if auth_option=='2' + auth = 'omniauth' if auth_option=='3' else auth = nil end -if ["1", "2"].include?(deploy_option) - deploy = "capistrano" if deploy_option=="1" - deploy = "inploy" if deploy_option=="2" +if ['1', '2'].include?(deploy_option) + deploy = 'capistrano' if deploy_option=='1' + deploy = 'inploy' if deploy_option=='2' else deploy = nil end -if ["1", "2"].include?(css_framework_option) - css_framework = "960" if css_framework_option=="1" - css_framework = "blueprint" if css_framework_option=="2" +if ['1', '2'].include?(exceptions_option) + exceptions_tracker = 'exceptional' if css_framework_option=='1' + exceptions_tracker = 'hoptoad' if css_framework_option=='2' else - css_framework = "960" + exceptions_tracker = nil end - -puts "\r\n\r\n*****************************************************************************************************" -puts "All set. Bootstrapping your app!!" -puts "*****************************************************************************************************\r\n\r\n" +puts '\r\n\r\n*****************************************************************************************************' +puts 'All set. Bootstrapping your app!!' +puts '*****************************************************************************************************\r\n\r\n' # GO! -run "rm -Rf .gitignore README public/index.html public/images/rails.png public/javascripts/* app/views/layouts/*" +run 'rm -Rf .gitignore README public/index.html public/images/rails.png public/javascripts/* app/views/layouts/*' -gem 'will_paginate', '>=3.0.pre2' -gem "haml-rails", ">= 0.2" -gem "compass", ">= 0.10.5" -gem "fancy-buttons" -gem "compass-960-plugin" if css_framework=="960" +# gems +gem 'haml-rails', '>= 0.2' gem 'inherited_resources', '~> 1.1.2' -gem "simple_form" -gem "show_for" -gem "tabs_on_rails" -gem "meta_search" - -# other stuff gem 'friendly_id', '~>3.1' +gem 'compass', '>= 0.10.5' +gem 'fancy-buttons' +gem 'simple_form' +gem 'show_for' +gem 'will_paginate', '>=3.0.pre2' +gem 'tabs_on_rails' +gem 'breadcrumbs_on_rails' +gem 'paperclip' +gem 'meta_search' # development -gem "rails-erd", :group => :development +gem 'rails3-generators', :group => :development +gem 'rails-erd', :group => :development gem 'wirble', :group => :development gem 'awesome_print', :group => :development -gem "hirb", :group => :development +gem 'hirb', :group => :development # testing -gem "factory_girl_rails", :group => [:test, :cucumber] -gem "shoulda", :group => [:test, :shoulda] -gem "faker", :group => [:test, :cucumber] -gem "mynyml-redgreen", :group => :test, :require => "redgreen" - -gem 'cucumber', ">=0.6.3", :group => :cucumber -gem 'cucumber-rails', ">=0.3.2", :group => :cucumber -gem 'capybara', ">=0.3.6", :group => :cucumber -gem 'database_cleaner', ">=0.5.0", :group => :cucumber -gem 'spork', ">=0.8.4", :group => :cucumber -gem "pickle", ">=0.4.2", :group => :cucumber -gem "launchy", :group => :cucumber +gem 'factory_girl_rails', :group => [:test, :cucumber] +gem 'shoulda', :group => [:test, :shoulda] +gem 'faker', :group => [:test, :cucumber] +gem 'mynyml-redgreen', :group => :test, :require => 'redgreen' + +gem 'cucumber', '>=0.6.3', :group => :cucumber +gem 'cucumber-rails', '>=0.3.2', :group => :cucumber +gem 'capybara', '>=0.3.6', :group => :cucumber +gem 'database_cleaner', '>=0.5.0', :group => :cucumber +gem 'spork', '>=0.8.4', :group => :cucumber +gem 'pickle', '>=0.4.2', :group => :cucumber +gem 'launchy', :group => :cucumber # staging & production stuff -gem 'pg', :group => :production -unless hoptoad_key.empty? - gem "hoptoad_notifier", '~> 2.3.6' +gem 'whenever', :group => :production +gem 'backup', :group => :production + +if exceptions_tracker == 'hoptoad' + gem 'hoptoad_notifier', '~> 2.3.6' initializer 'hoptoad.rb', <<-FILE HoptoadNotifier.configure do |config| config.api_key = '#{hoptoad_key}' @@ -82,12 +84,17 @@ FILE end -gem 'rails3-generators', :group => :development +if exceptions_tracker == 'exceptional' + gem 'exceptional' + exceptional install exceptional_key +end -run "bundle install" +run 'bundle install' +# plugins plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git' +# generators application <<-GENERATORS config.generators do |g| g.orm :active_record @@ -101,47 +108,36 @@ GENERATORS # configure cucumber -generate "cucumber:install --capybara --testunit --spork" -generate "pickle --path --email" -get "http://github.com/aentos/rails3-templates/raw/master/within_steps.rb" ,"features/step_definitions/within_steps.rb" - -generate "friendly_id" -generate "simple_form:install -e haml" -generate "show_for:install" -file "lib/templates/haml/scaffold/show.html.haml", <<-FILE -= show_for @<%= singular_name %> do |s| +generate 'cucumber:install --capybara --testunit --spork' +generate 'pickle --path --email' +get 'http://github.com/recrea/rails3-templates/raw/master/within_steps.rb' ,'features/step_definitions/within_steps.rb' + +# configure other gems +generate 'friendly_id' +generate 'simple_form:install -e haml' +generate 'show_for:install' +file 'lib/templates/haml/scaffold/show.html.haml', <<-FILE += show_for @<%= singular_name %> do |a| <% attributes.each do |attribute| -%> - = s.<%= attribute.reference? ? :association : :attribute %> :<%= attribute.name %> + = a.<%= attribute.reference? ? :association : :attribute %> :<%= attribute.name %> <% end -%> == \#{link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) } | \#{ link_to 'Back', <%= plural_name %>_path } FILE +run 'wheneverize .' -# compass -run "gem install compass" -if css_framework=="960" - run "compass init -r ninesixty --using 960 --app rails --css-dir public/stylesheets" - get "http://github.com/aentos/rails3-templates/raw/master/application_960.html.haml", "app/views/layouts/application.html.haml" - file "config/asset_packages.yml", <<-FILE ---- -javascripts: -- base: - - rails -stylesheets: -- screen: - - grid - - text -- handheld: - - handheld -FILE -else - run "compass init --using blueprint --app rails --css-dir public/stylesheets" - get "http://github.com/aentos/rails3-templates/raw/master/application_blueprint.html.haml", "app/views/layouts/application.html.haml" - file "config/asset_packages.yml", <<-FILE +# configure compass +run 'gem install compass' +run 'compass init --using blueprint --app rails --css-dir public/stylesheets' +create_file 'app/stylesheets/partials/_colors.scss' +get 'http://github.com/recrea/rails3-templates/raw/master/handheld.scss' ,'app/stylesheets/handheld.scss' + +get 'http://github.com/recrea/rails3-templates/raw/master/application.html.haml', 'app/views/layouts/application.html.haml' +file 'config/asset_packages.yml', <<-FILE --- javascripts: - base: - - rails + - jquery.rails stylesheets: - ie: - ie @@ -153,33 +149,33 @@ - handheld FILE end -create_file "app/stylesheets/partials/_colors.scss" -get "http://github.com/aentos/rails3-templates/raw/master/handheld.scss" ,"app/stylesheets/handheld.scss" +# get locales unless locale_str.empty? - locales = locale_str.split(",") + locales = locale_str.split(',') locales.each do |loc| - get("http://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/#{loc.strip}.yml", file) + get('http://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/#{loc.strip}.yml', file) end end -# jquery -get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js" +# get jquery +get 'http://github.com/rails/jquery-ujs/raw/master/src/rails.js', 'public/javascripts/jquery.rails.js' -get "http://github.com/aentos/rails3-templates/raw/master/gitignore" ,".gitignore" -get "http://github.com/aentos/rails3-templates/raw/master/build.rake", "lib/tasks/build.rake" +# other stuff +get 'http://github.com/recrea/rails3-templates/raw/master/gitignore' ,'.gitignore' +get 'http://github.com/recrea/rails3-templates/raw/master/build.rake', 'lib/tasks/build.rake' append_file 'Rakefile', <<-METRIC_FU MetricFu::Configuration.run do |config| - config.rcov[:rcov_opts] << "-Ispec" + config.rcov[:rcov_opts] << '-Ispec' end rescue nil METRIC_FU git :init git :add => '.' -git :commit => '-am "Initial commit"' +git :commit => '-am 'Initial commit'' -apply "http://github.com/aentos/rails3-templates/raw/master/#{auth}.rb" unless auth.blank? -apply "http://github.com/aentos/rails3-templates/raw/master/#{deploy}.rb" unless deploy.blank? +apply 'http://github.com/recrea/rails3-templates/raw/master/#{auth}.rb' unless auth.blank? +apply 'http://github.com/recrea/rails3-templates/raw/master/#{deploy}.rb' unless deploy.blank? -puts "SUCCESS!" \ No newline at end of file +puts 'SUCCESS!' \ No newline at end of file