Skip to content

Instantly share code, notes, and snippets.

@paulmars
Forked from martinisoft/tpl-cukeapp.rb
Last active September 25, 2015 17:57
Show Gist options
  • Save paulmars/960988 to your computer and use it in GitHub Desktop.
Save paulmars/960988 to your computer and use it in GitHub Desktop.

Revisions

  1. paulmars revised this gist Sep 11, 2015. No changes.
  2. paulmars revised this gist Sep 11, 2015. 1 changed file with 4 additions and 46 deletions.
    50 changes: 4 additions & 46 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -58,15 +58,10 @@
    GENERATOR
    end

    # create_file "public/javascripts/rails.js"

    # # Replace the blank one with jQuery served via Google CDN
    # gsub_file 'config/application.rb', 'config.action_view.javascript_expansions[:defaults] = %w()', 'config.action_view.javascript_expansions[:defaults] = %w(http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js rails.js)'

    # # Run all the generators
    # Run all the generators
    generate "rspec:install"

    ## Rspec setup
    # Rspec setup
    spec_helper = <<-RSPECHELPER
    ENV["RAILS_ENV"] ||= 'test'
    require File.expand_path("../../config/environment", __FILE__)
    @@ -89,7 +84,6 @@
    generate "devise:install"
    generate "devise:views"
    generate "devise User"
    # generate "bootstrap:install"

    ## Devise routes
    routes = <<-ROUTES
    @@ -222,57 +216,21 @@ class User < ActiveRecord::Base
    # remove_file "app/views/layouts/application.html.erb"
    # create_file "app/views/layouts/application.html.erb", layout


    # # SASS and SCSS
    # # create_file "app/assets/stylesheets/bootstrap.css", <<-BOOTSTRAP
    # # // http://twitter.github.com/bootstrap/
    # # BOOTSTRAP

    # create_file "config/initializers/formtastic.rb", <<-FORMBOOT
    # Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
    # FORMBOOT


    # create_file "app/assets/stylesheets/_general.sass", <<-GENERAL
    # html
    # font: 13px/1.231 helvetica, clean, sans-serif

    # body
    # text-align: left
    # background-color: white

    # a, a:hover, a:visited
    # color: blue

    # .signin-bar
    # float: right
    # GENERAL

    # inject_into_file('app/assets/stylesheets/application.css', :after => "*= require_self") do
    # %q{
    # *= require bootstrap_and_overrides
    # *= require formtastic-bootstrap
    # }
    # end

    ## Git

    # Re-Make gitignore
    gitignore = <<-END
    .bundle
    .DS_Store
    db/*.sqlite3
    log/*.log
    tmp/**/*
    END

    # Re-Make gitignore
    remove_file ".gitignore"
    create_file ".gitignore", gitignore

    run "bundle install"

    run "rake db:migrate"

    # Git
    git :init
    git :add => "."
    git commit: "-a -m 'Initial commit'"
  3. paulmars revised this gist Sep 11, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # rails new [appname] -JT -m https://gist.github.com/paulmars/960988/raw/386eb14e20153ef4d55a6735d22748c6503b64f8/template.rb
    # rails new APPNAME -JT -m /Users/paul/Development/template/template.rb

    # sass
  4. paulmars revised this gist Sep 11, 2015. 1 changed file with 97 additions and 77 deletions.
    174 changes: 97 additions & 77 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -1,99 +1,117 @@
    ## Rails App Template
    ## Updated for Rails 4.1.2
    ## Updated on 6/22/14
    ## Run using $ rails new [appname] -JT -m https://gist.github.com/paulmars/960988/raw/8dbc6a5a152658c620f7650e8156e96a90160b2a/template.rb
    ## Gems
    # rails new APPNAME -JT -m /Users/paul/Development/template/template.rb

    gem 'coffee-rails', '~> 4.0.0'
    # sass
    gem 'sass-rails'
    gem 'bootstrap-sass', '3.2.0.2'

    gem 'jquery-rails'
    gem 'turbolinks'
    # image update
    gem 'carrierwave', '0.10.0'
    gem 'fog', '1.19.0'

    # admin stuff
    gem 'devise'
    gem 'rails_admin'
    gem 'kaminari'

    gem 'pg', group: [:production]
    gem 'rails_12factor', group: [:production]
    gem 'unicorn', group: [:production]
    gem_group :development, :test do
    gem 'awesome_print'
    gem 'quiet_assets'
    end

    gem_group :development do
    gem 'binding_of_caller'
    gem 'pry-remote', :require => 'pry-remote'
    gem 'better_errors'

    gem 'guard'
    gem 'guard-livereload'#, '~> 2.4', require: false
    gem 'guard-rspec', require: false

    gem 'rack-livereload'
    end

    gem_group :test do
    gem 'rspec-rails', '3.1.0'
    gem 'factory_girl', '4.5.0'
    end

    # heroku
    gem_group :production do
    gem 'pg'
    gem 'rails_12factor'
    gem 'unicorn'
    end

    # ## Generators

    # inject_into_file('config/application.rb', :after => "config.filter_parameters += [:password]") do
    # %q{
    # config.generators do |g|
    # g.stylesheets false
    # g.test_framework :rspec, :fixture => true, :views => false
    # g.fixture_replacement :factory_girl, :dir => "spec/support/factories"
    # end

    # # Global Sass Option
    # config.generators.stylesheet_engine = :sass
    # }
    # end
    insert_into_file "config/application.rb", :after => "Rails::Application\n" do
    <<-GENERATOR
    config.generators do |g|
    g.stylesheets false
    g.test_framework :rspec, :fixture => true, :views => false
    g.fixture_replacement :factory_girl, :dir => "spec/support/factories"
    end
    # Global Sass Option
    config.generators.stylesheet_engine = :sass
    GENERATOR
    end

    # create_file "public/javascripts/rails.js"

    # # Replace the blank one with jQuery served via Google CDN
    # gsub_file 'config/application.rb', 'config.action_view.javascript_expansions[:defaults] = %w()', 'config.action_view.javascript_expansions[:defaults] = %w(http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js rails.js)'

    # # Run all the generators
    # generate "rspec:install"

    # ## Rspec setup
    # spec_helper = <<-RSPECHELPER
    # require 'simplecov'
    # SimpleCov.start

    # ENV["RAILS_ENV"] ||= 'test'

    # require 'ruby-debug'
    # require File.expand_path("../../config/environment", __FILE__)
    # require 'rspec/rails'
    # require 'remarkable/active_record'
    # require 'rspec/autorun'

    # Dir[Rails.root.join("spec/support/*.rb")].each {|f| require f}
    # Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

    # RSpec.configure do |config|
    # config.render_views
    # config.fixture_path = "\#{::Rails.root}/spec/fixtures"
    # config.use_transactional_fixtures = true
    # config.infer_base_class_for_anonymous_controllers = false
    # config.include Devise::TestHelpers, :type => :controller
    # end
    # RSPECHELPER
    # remove_file "spec/spec_helper.rb"
    # create_file "spec/spec_helper.rb", spec_helper

    # generate "devise:install"
    # generate "devise:views"
    # generate "devise User"
    generate "rspec:install"

    ## Rspec setup
    spec_helper = <<-RSPECHELPER
    ENV["RAILS_ENV"] ||= 'test'
    require File.expand_path("../../config/environment", __FILE__)
    require 'rspec/rails'
    Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
    ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
    RSpec.configure do |config|
    config.include FactoryGirl::Syntax::Methods
    config.use_transactional_fixtures = true
    config.infer_base_class_for_anonymous_controllers = false
    config.order = "random"
    end
    RSPECHELPER
    remove_file "spec/spec_helper.rb"
    create_file "spec/spec_helper.rb", spec_helper

    generate "devise:install"
    generate "devise:views"
    generate "devise User"
    # generate "bootstrap:install"

    # ## Devise routes
    # routes = <<-ROUTES
    # devise_for :user
    # devise_scope :user do
    # get "signup", :to => "devise/registrations#new"
    # get "signin", :to => "devise/sessions#new"
    # get "signout", :to => "devise/sessions#destroy"
    # end
    # ROUTES
    # route routes

    # ## Sign in files
    # user = <<-USER
    # class User < ActiveRecord::Base
    # devise :database_authenticatable, :registerable,
    # :recoverable, :rememberable, :trackable, :validatable

    # attr_accessible :email, :password, :password_confirmation
    # end
    # USER
    # remove_file "app/models/user.rb"
    # create_file "app/models/user.rb", user
    ## Devise routes
    routes = <<-ROUTES
    devise_for :user
    devise_scope :user do
    get "signup", :to => "devise/registrations#new"
    get "signin", :to => "devise/sessions#new"
    get "signout", :to => "devise/sessions#destroy"
    end
    ROUTES
    route routes

    ## Sign in files
    user = <<-USER
    class User < ActiveRecord::Base
    devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :validatable
    attr_accessible :email, :password, :password_confirmation
    end
    USER
    remove_file "app/models/user.rb"
    create_file "app/models/user.rb", user

    # ## Sign in files
    # signin = <<-SIGNIN
    @@ -251,7 +269,9 @@
    create_file ".gitignore", gitignore

    run "bundle install"

    run "rake db:migrate"

    git :init
    git :add => "."
    git commit: "-a -m 'Initial commit'"
  5. paulmars revised this gist Jul 22, 2014. 1 changed file with 232 additions and 269 deletions.
    501 changes: 232 additions & 269 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -1,270 +1,240 @@
    ## Rails App Template
    ## Updated for Rails 3.2.8
    ## Updated on 9/24/12
    ## Updated for Rails 4.1.2
    ## Updated on 6/22/14
    ## Run using $ rails new [appname] -JT -m https://gist.github.com/paulmars/960988/raw/8dbc6a5a152658c620f7650e8156e96a90160b2a/template.rb
    ## Gems

    # General
    gem 'rake', '0.9.2.2'

    # Warden and Devise for security
    gem 'warden', '1.1'
    gem 'devise', '>= 2.0.0'

    # Extra Plugins

    # SASS for Templating
    # gem 'sass-rails', :group => [:assets]
    gem 'coffee-rails', '~> 3.2.1', :group => [:assets]
    gem 'uglifier', '>= 1.0.3', :group => [:assets]

    # Cucumber and Friends
    gem 'ruby-debug19', :group => [:development, :test]
    gem "rspec", :group => [:development, :test]
    gem "rspec-rails", '~> 2.8.0.rc1', :group => [:development, :test]
    gem 'remarkable_activerecord', '~> 4.0.0.alpha4', :group => [:development, :test]
    gem "capybara", :group => [:development, :test]
    gem "database_cleaner", :group => [:development, :test]
    gem "factory_girl_rails", :group => [:development, :test]
    gem 'simplecov', :require => false, :group => [:development, :test]

    # development
    gem 'auto_tagger', '0.2.3', :group => [:development]

    # all
    gem 'mysql2'
    gem 'yajl-ruby'
    gem 'escape_utils'
    gem 'jquery-rails'
    gem 'coffee-rails', '~> 4.0.0'

    # extras
    gem 'escape_utils'
    gem 'will_paginate', '~> 3.0'
    gem 'bootstrap-will_paginate'
    gem 'formtastic', '2.0.2'
    gem 'formtastic-bootstrap'

    gem "less"
    gem "twitter-bootstrap-rails"

    ## Generators

    inject_into_file('config/application.rb', :after => "config.filter_parameters += [:password]") do
    %q{
    config.generators do |g|
    g.stylesheets false
    g.test_framework :rspec, :fixture => true, :views => false
    g.fixture_replacement :factory_girl, :dir => "spec/support/factories"
    end
    # Global Sass Option
    config.generators.stylesheet_engine = :sass
    }
    end

    create_file "public/javascripts/rails.js"

    # Replace the blank one with jQuery served via Google CDN
    gsub_file 'config/application.rb', 'config.action_view.javascript_expansions[:defaults] = %w()', 'config.action_view.javascript_expansions[:defaults] = %w(http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js rails.js)'

    # Run all the generators
    generate "rspec:install"

    ## Rspec setup
    spec_helper = <<-RSPECHELPER
    require 'simplecov'
    SimpleCov.start
    ENV["RAILS_ENV"] ||= 'test'
    require 'ruby-debug'
    require File.expand_path("../../config/environment", __FILE__)
    require 'rspec/rails'
    require 'remarkable/active_record'
    require 'rspec/autorun'
    Dir[Rails.root.join("spec/support/*.rb")].each {|f| require f}
    Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
    RSpec.configure do |config|
    config.render_views
    config.fixture_path = "\#{::Rails.root}/spec/fixtures"
    config.use_transactional_fixtures = true
    config.infer_base_class_for_anonymous_controllers = false
    config.include Devise::TestHelpers, :type => :controller
    end
    RSPECHELPER
    remove_file "spec/spec_helper.rb"
    create_file "spec/spec_helper.rb", spec_helper

    generate "devise:install"
    generate "devise:views"
    generate "devise User"
    generate "bootstrap:install"

    ## Devise routes
    routes = <<-ROUTES
    devise_for :user
    devise_scope :user do
    get "signup", :to => "devise/registrations#new"
    get "signin", :to => "devise/sessions#new"
    get "signout", :to => "devise/sessions#destroy"
    end
    ROUTES
    route routes

    ## Sign in files
    user = <<-USER
    class User < ActiveRecord::Base
    devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :validatable
    attr_accessible :email, :password, :password_confirmation
    end
    USER
    remove_file "app/models/user.rb"
    create_file "app/models/user.rb", user

    ## Sign in files
    signin = <<-SIGNIN
    <h2>Sign in</h2>
    <%= semantic_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
    <%= f.inputs do %>
    <%= f.input :email, :as => :email %>
    <%= f.input :password, :as => :password %>
    <% end %>
    <%= f.buttons do %>
    <%= f.commit_button "Sign in" %>
    <% end %>
    <% end %>
    <%= render :partial => "devise/links" %>
    SIGNIN
    remove_file "app/views/devise/sessions/new.html.erb"
    create_file "app/views/devise/sessions/new.html.erb", signin

    signup = <<-SIGNUP
    <h2>Sign up</h2>
    <%= semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
    <%= devise_error_messages! %>
    <%= f.inputs do %>
    <%= f.input :email, :as => :email %>
    <%= f.input :password, :as => :password %>
    <% end %>
    <%= f.buttons do %>
    <%= f.commit_button "Sign up" %>
    <% end %>
    <% end %>
    <%= render :partial => "devise/links" %>
    SIGNUP
    remove_file "app/views/devise/registrations/new.html.erb"
    create_file "app/views/devise/registrations/new.html.erb", signup

    # Clear the default index
    remove_file "public/index.html"
    remove_file "public/images/rails.png"
    # Make a blank application javascript file
    remove_file "public/javascripts/application.js"

    ## Layout

    layout = <<-LAYOUT
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>#{app_name.humanize}</title>
    <%= stylesheet_link_tag "application" %>
    <%= csrf_meta_tag %>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
    </head>
    <body>
    <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
    <div class="container">
    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </a>
    <%= link_to h(#{app_name.humanize}), "/", :class => "brand" %>
    <div class="nav-collapse collapse">
    <ul class="nav pull-right">
    <% if !user_signed_in? %>
    <li><%= link_to "Sign in", signin_path, :id => "signin-btn" %></li>
    <li><%= link_to "Sign up", signup_path, :id => "signup-btn" %></li>
    <% else %>
    <li><%= link_to "Sign out", signout_path, :id => "signout-btn" %></li>
    <% end %>
    </ul>
    </div><!--/.nav-collapse -->
    </div>
    </div>
    </div>
    <div id="body" class="container">
    <% if flash.any? %>
    <div class="row">
    <div class="span8">
    <% if flash[:notice].present? %>
    <p class="notice"><%= notice %></p>
    <% end %>
    <% if flash[:alert].present? %>
    <p class="alert"><%= alert %></p>
    <% end %>
    </div>
    </div>
    <% end %>
    <%= yield %>
    </div>
    <%= javascript_include_tag :application %>
    <script type="text/javascript">
    <%= yield :javascripts %>
    </script>
    </body>
    </html>
    LAYOUT
    remove_file "app/views/layouts/application.html.erb"
    create_file "app/views/layouts/application.html.erb", layout


    # SASS and SCSS
    # create_file "app/assets/stylesheets/bootstrap.css", <<-BOOTSTRAP
    # // http://twitter.github.com/bootstrap/
    # BOOTSTRAP

    create_file "config/initializers/formtastic.rb", <<-FORMBOOT
    Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
    FORMBOOT


    create_file "app/assets/stylesheets/_general.sass", <<-GENERAL
    html
    font: 13px/1.231 helvetica, clean, sans-serif
    body
    text-align: left
    background-color: white
    a, a:hover, a:visited
    color: blue
    .signin-bar
    float: right
    GENERAL

    inject_into_file('app/assets/stylesheets/application.css', :after => "*= require_self") do
    %q{
    *= require bootstrap_and_overrides
    *= require formtastic-bootstrap
    }
    end
    gem 'jquery-rails'
    gem 'turbolinks'

    gem 'devise'
    gem 'rails_admin'

    gem 'pg', group: [:production]
    gem 'rails_12factor', group: [:production]
    gem 'unicorn', group: [:production]


    # ## Generators

    # inject_into_file('config/application.rb', :after => "config.filter_parameters += [:password]") do
    # %q{
    # config.generators do |g|
    # g.stylesheets false
    # g.test_framework :rspec, :fixture => true, :views => false
    # g.fixture_replacement :factory_girl, :dir => "spec/support/factories"
    # end

    # # Global Sass Option
    # config.generators.stylesheet_engine = :sass
    # }
    # end

    # create_file "public/javascripts/rails.js"

    # # Replace the blank one with jQuery served via Google CDN
    # gsub_file 'config/application.rb', 'config.action_view.javascript_expansions[:defaults] = %w()', 'config.action_view.javascript_expansions[:defaults] = %w(http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js rails.js)'

    # # Run all the generators
    # generate "rspec:install"

    # ## Rspec setup
    # spec_helper = <<-RSPECHELPER
    # require 'simplecov'
    # SimpleCov.start

    # ENV["RAILS_ENV"] ||= 'test'

    # require 'ruby-debug'
    # require File.expand_path("../../config/environment", __FILE__)
    # require 'rspec/rails'
    # require 'remarkable/active_record'
    # require 'rspec/autorun'

    # Dir[Rails.root.join("spec/support/*.rb")].each {|f| require f}
    # Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

    # RSpec.configure do |config|
    # config.render_views
    # config.fixture_path = "\#{::Rails.root}/spec/fixtures"
    # config.use_transactional_fixtures = true
    # config.infer_base_class_for_anonymous_controllers = false
    # config.include Devise::TestHelpers, :type => :controller
    # end
    # RSPECHELPER
    # remove_file "spec/spec_helper.rb"
    # create_file "spec/spec_helper.rb", spec_helper

    # generate "devise:install"
    # generate "devise:views"
    # generate "devise User"
    # generate "bootstrap:install"

    # ## Devise routes
    # routes = <<-ROUTES
    # devise_for :user
    # devise_scope :user do
    # get "signup", :to => "devise/registrations#new"
    # get "signin", :to => "devise/sessions#new"
    # get "signout", :to => "devise/sessions#destroy"
    # end
    # ROUTES
    # route routes

    # ## Sign in files
    # user = <<-USER
    # class User < ActiveRecord::Base
    # devise :database_authenticatable, :registerable,
    # :recoverable, :rememberable, :trackable, :validatable

    # attr_accessible :email, :password, :password_confirmation
    # end
    # USER
    # remove_file "app/models/user.rb"
    # create_file "app/models/user.rb", user

    # ## Sign in files
    # signin = <<-SIGNIN
    # <h2>Sign in</h2>

    # <%= semantic_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
    # <%= f.inputs do %>
    # <%= f.input :email, :as => :email %>
    # <%= f.input :password, :as => :password %>
    # <% end %>
    # <%= f.buttons do %>
    # <%= f.commit_button "Sign in" %>
    # <% end %>
    # <% end %>

    # <%= render :partial => "devise/links" %>
    # SIGNIN
    # remove_file "app/views/devise/sessions/new.html.erb"
    # create_file "app/views/devise/sessions/new.html.erb", signin

    # signup = <<-SIGNUP
    # <h2>Sign up</h2>

    # <%= semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
    # <%= devise_error_messages! %>
    # <%= f.inputs do %>
    # <%= f.input :email, :as => :email %>
    # <%= f.input :password, :as => :password %>
    # <% end %>
    # <%= f.buttons do %>
    # <%= f.commit_button "Sign up" %>
    # <% end %>
    # <% end %>

    # <%= render :partial => "devise/links" %>
    # SIGNUP
    # remove_file "app/views/devise/registrations/new.html.erb"
    # create_file "app/views/devise/registrations/new.html.erb", signup

    # # Clear the default index
    # remove_file "public/index.html"
    # remove_file "public/images/rails.png"
    # # Make a blank application javascript file
    # remove_file "public/javascripts/application.js"

    # ## Layout

    # layout = <<-LAYOUT
    # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    # <html>
    # <head>
    # <title>#{app_name.humanize}</title>
    # <%= stylesheet_link_tag "application" %>
    # <%= csrf_meta_tag %>
    # <meta name="viewport" content="width=device-width, initial-scale=1.0">
    # <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
    # </head>
    # <body>

    # <div class="navbar navbar-fixed-top">
    # <div class="navbar-inner">
    # <div class="container">
    # <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
    # <span class="icon-bar"></span>
    # <span class="icon-bar"></span>
    # <span class="icon-bar"></span>
    # </a>
    # <%= link_to h(#{app_name.humanize}), "/", :class => "brand" %>
    # <div class="nav-collapse collapse">
    # <ul class="nav pull-right">
    # <% if !user_signed_in? %>
    # <li><%= link_to "Sign in", signin_path, :id => "signin-btn" %></li>
    # <li><%= link_to "Sign up", signup_path, :id => "signup-btn" %></li>
    # <% else %>
    # <li><%= link_to "Sign out", signout_path, :id => "signout-btn" %></li>
    # <% end %>
    # </ul>
    # </div><!--/.nav-collapse -->
    # </div>
    # </div>
    # </div>

    # <div id="body" class="container">
    # <% if flash.any? %>
    # <div class="row">
    # <div class="span8">
    # <% if flash[:notice].present? %>
    # <p class="notice"><%= notice %></p>
    # <% end %>
    # <% if flash[:alert].present? %>
    # <p class="alert"><%= alert %></p>
    # <% end %>
    # </div>
    # </div>
    # <% end %>

    # <%= yield %>
    # </div>

    # <%= javascript_include_tag :application %>
    # <script type="text/javascript">
    # <%= yield :javascripts %>
    # </script>
    # </body>
    # </html>
    # LAYOUT
    # remove_file "app/views/layouts/application.html.erb"
    # create_file "app/views/layouts/application.html.erb", layout


    # # SASS and SCSS
    # # create_file "app/assets/stylesheets/bootstrap.css", <<-BOOTSTRAP
    # # // http://twitter.github.com/bootstrap/
    # # BOOTSTRAP

    # create_file "config/initializers/formtastic.rb", <<-FORMBOOT
    # Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
    # FORMBOOT


    # create_file "app/assets/stylesheets/_general.sass", <<-GENERAL
    # html
    # font: 13px/1.231 helvetica, clean, sans-serif

    # body
    # text-align: left
    # background-color: white

    # a, a:hover, a:visited
    # color: blue

    # .signin-bar
    # float: right
    # GENERAL

    # inject_into_file('app/assets/stylesheets/application.css', :after => "*= require_self") do
    # %q{
    # *= require bootstrap_and_overrides
    # *= require formtastic-bootstrap
    # }
    # end

    ## Git

    @@ -274,8 +244,6 @@ class User < ActiveRecord::Base
    db/*.sqlite3
    log/*.log
    tmp/**/*
    public/stylesheets/*
    coverage
    END

    # Re-Make gitignore
    @@ -287,8 +255,3 @@ class User < ActiveRecord::Base

    git :init
    git :add => "."


    # Todo
    # //= require jquery
    # //= require jquery_ujs
  6. paulmars revised this gist Apr 17, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion template.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ## Rails App Template
    ## Updated for Rails 3.2.8
    ## Updated on 9/24/12
    ## Run using $ rails new [appname] -JT -m https://raw.github.com/gist/960988/template.rb
    ## Run using $ rails new [appname] -JT -m https://gist.githubusercontent.com/paulmars/960988/raw/8dbc6a5a152658c620f7650e8156e96a90160b2a/template.rb
    ## Gems

    # General
  7. paulmars revised this gist Sep 29, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -275,6 +275,7 @@ class User < ActiveRecord::Base
    log/*.log
    tmp/**/*
    public/stylesheets/*
    coverage
    END

    # Re-Make gitignore
  8. paulmars revised this gist Sep 29, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -122,8 +122,8 @@ class User < ActiveRecord::Base
    attr_accessible :email, :password, :password_confirmation
    end
    USER
    remove_file "app/model/user.rb"
    create_file "app/model/user.rb", user
    remove_file "app/models/user.rb"
    create_file "app/models/user.rb", user

    ## Sign in files
    signin = <<-SIGNIN
  9. paulmars revised this gist Sep 28, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,6 @@

    # development
    gem 'auto_tagger', '0.2.3', :group => [:development]
    gem 'rails3-generators', '0.17.4', :group => [:development]

    # all
    gem 'mysql2'
    @@ -176,7 +175,7 @@ class User < ActiveRecord::Base
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Janus</title>
    <title>#{app_name.humanize}</title>
    <%= stylesheet_link_tag "application" %>
    <%= csrf_meta_tag %>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  10. paulmars revised this gist Sep 28, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion template.rb
    Original file line number Diff line number Diff line change
    @@ -262,7 +262,7 @@ class User < ActiveRecord::Base

    inject_into_file('app/assets/stylesheets/application.css', :after => "*= require_self") do
    %q{
    *= require bootstrap
    *= require bootstrap_and_overrides
    *= require formtastic-bootstrap
    }
    end
  11. paulmars revised this gist Sep 28, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,7 @@
    gem "capybara", :group => [:development, :test]
    gem "database_cleaner", :group => [:development, :test]
    gem "factory_girl_rails", :group => [:development, :test]
    gem 'simplecov', :require => false, :group => [:development, :test]

    # development
    gem 'auto_tagger', '0.2.3', :group => [:development]
  12. paulmars revised this gist Sep 28, 2012. 1 changed file with 28 additions and 0 deletions.
    28 changes: 28 additions & 0 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -69,6 +69,34 @@

    # Run all the generators
    generate "rspec:install"

    ## Rspec setup
    spec_helper = <<-RSPECHELPER
    require 'simplecov'
    SimpleCov.start
    ENV["RAILS_ENV"] ||= 'test'
    require 'ruby-debug'
    require File.expand_path("../../config/environment", __FILE__)
    require 'rspec/rails'
    require 'remarkable/active_record'
    require 'rspec/autorun'
    Dir[Rails.root.join("spec/support/*.rb")].each {|f| require f}
    Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
    RSpec.configure do |config|
    config.render_views
    config.fixture_path = "\#{::Rails.root}/spec/fixtures"
    config.use_transactional_fixtures = true
    config.infer_base_class_for_anonymous_controllers = false
    config.include Devise::TestHelpers, :type => :controller
    end
    RSPECHELPER
    remove_file "spec/spec_helper.rb"
    create_file "spec/spec_helper.rb", spec_helper

    generate "devise:install"
    generate "devise:views"
    generate "devise User"
  13. paulmars revised this gist Sep 28, 2012. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -85,9 +85,6 @@
    ROUTES
    route routes

    devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :validatable

    ## Sign in files
    user = <<-USER
    class User < ActiveRecord::Base
  14. paulmars revised this gist Sep 28, 2012. 1 changed file with 0 additions and 13 deletions.
    13 changes: 0 additions & 13 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -223,26 +223,13 @@ class User < ActiveRecord::Base
    html
    font: 13px/1.231 helvetica, clean, sans-serif
    #hd::after, #bd::after, #ft::after
    content: "."
    display: block
    height: 0
    clear: both
    visibility: hidden
    body
    text-align: left
    background-color: white
    a, a:hover, a:visited
    color: blue
    #hd
    margin-bottom: 0.5em
    #hd h1
    font-size: 1.5em
    .signin-bar
    float: right
    GENERAL
  15. paulmars revised this gist Sep 28, 2012. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -210,9 +210,9 @@ class User < ActiveRecord::Base


    # SASS and SCSS
    create_file "app/assets/stylesheets/bootstrap.css", <<-BOOTSTRAP
    // http://twitter.github.com/bootstrap/
    BOOTSTRAP
    # create_file "app/assets/stylesheets/bootstrap.css", <<-BOOTSTRAP
    # // http://twitter.github.com/bootstrap/
    # BOOTSTRAP

    create_file "config/initializers/formtastic.rb", <<-FORMBOOT
    Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
  16. paulmars revised this gist Sep 28, 2012. 1 changed file with 22 additions and 16 deletions.
    38 changes: 22 additions & 16 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -150,27 +150,33 @@ class User < ActiveRecord::Base
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>#{app_name.humanize}</title>
    <title>Janus</title>
    <%= stylesheet_link_tag "application" %>
    <%= csrf_meta_tag %>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
    </head>
    <body>
    <div id="hd" class="container">
    <div class="row">
    <div id="titlebar" class="span8">
    <h1><%= link_to h(#{app_name.humanize}), "/" %></h1>
    </div>
    <div class="span4">
    <ul class="signin-bar unstyled">
    <% if !user_signed_in? %>
    <li><%= link_to "Sign in", new_user_session_url, :id => "signin-btn", :class => "btn" %></li>
    <li><%= link_to "Sign up", new_user_registration_url, :id => "signup-btn", :class => "btn" %></li>
    <% else %>
    <li><%= link_to "Sign out", destroy_user_session_url, {:method => :delete, :id => "signout-btn", :class => "btn"} %></li>
    <% end %>
    </ul>
    <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
    <div class="container">
    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </a>
    <%= link_to h(#{app_name.humanize}), "/", :class => "brand" %>
    <div class="nav-collapse collapse">
    <ul class="nav pull-right">
    <% if !user_signed_in? %>
    <li><%= link_to "Sign in", signin_path, :id => "signin-btn" %></li>
    <li><%= link_to "Sign up", signup_path, :id => "signup-btn" %></li>
    <% else %>
    <li><%= link_to "Sign out", signout_path, :id => "signout-btn" %></li>
    <% end %>
    </ul>
    </div><!--/.nav-collapse -->
    </div>
    </div>
    </div>
    @@ -191,6 +197,7 @@ class User < ActiveRecord::Base
    <%= yield %>
    </div>
    <%= javascript_include_tag :application %>
    <script type="text/javascript">
    <%= yield :javascripts %>
    @@ -215,7 +222,6 @@ class User < ActiveRecord::Base
    create_file "app/assets/stylesheets/_general.sass", <<-GENERAL
    html
    font: 13px/1.231 helvetica, clean, sans-serif
    background-color: #eee
    #hd::after, #bd::after, #ft::after
    content: "."
  17. paulmars revised this gist Sep 28, 2012. 1 changed file with 17 additions and 1 deletion.
    18 changes: 17 additions & 1 deletion template.rb
    Original file line number Diff line number Diff line change
    @@ -76,14 +76,30 @@

    ## Devise routes
    routes = <<-ROUTES
    devise_scope :user do
    devise_for :user
    devise_scope :user do
    get "signup", :to => "devise/registrations#new"
    get "signin", :to => "devise/sessions#new"
    get "signout", :to => "devise/sessions#destroy"
    end
    ROUTES
    route routes

    devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :validatable

    ## Sign in files
    user = <<-USER
    class User < ActiveRecord::Base
    devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :validatable
    attr_accessible :email, :password, :password_confirmation
    end
    USER
    remove_file "app/model/user.rb"
    create_file "app/model/user.rb", user

    ## Sign in files
    signin = <<-SIGNIN
    <h2>Sign in</h2>
  18. paulmars revised this gist Sep 28, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ## Rails App Template
    ## Updated for Rails 3.2.2
    ## Updated on 3/10/12
    ## Updated for Rails 3.2.8
    ## Updated on 9/24/12
    ## Run using $ rails new [appname] -JT -m https://raw.github.com/gist/960988/template.rb
    ## Gems

  19. paulmars revised this gist Sep 28, 2012. 1 changed file with 12 additions and 3 deletions.
    15 changes: 12 additions & 3 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -44,6 +44,9 @@
    gem 'formtastic', '2.0.2'
    gem 'formtastic-bootstrap'

    gem "less"
    gem "twitter-bootstrap-rails"

    ## Generators

    inject_into_file('config/application.rb', :after => "config.filter_parameters += [:password]") do
    @@ -69,6 +72,7 @@
    generate "devise:install"
    generate "devise:views"
    generate "devise User"
    generate "bootstrap:install"

    ## Devise routes
    routes = <<-ROUTES
    @@ -142,15 +146,15 @@
    <div id="titlebar" class="span8">
    <h1><%= link_to h(#{app_name.humanize}), "/" %></h1>
    </div>
    <div class="span2">
    <ol class="signin-bar">
    <div class="span4">
    <ul class="signin-bar unstyled">
    <% if !user_signed_in? %>
    <li><%= link_to "Sign in", new_user_session_url, :id => "signin-btn", :class => "btn" %></li>
    <li><%= link_to "Sign up", new_user_registration_url, :id => "signup-btn", :class => "btn" %></li>
    <% else %>
    <li><%= link_to "Sign out", destroy_user_session_url, {:method => :delete, :id => "signout-btn", :class => "btn"} %></li>
    <% end %>
    </ol>
    </ul>
    </div>
    </div>
    </div>
    @@ -248,3 +252,8 @@

    git :init
    git :add => "."


    # Todo
    # //= require jquery
    # //= require jquery_ujs
  20. paulmars revised this gist Sep 28, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion template.rb
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@

    # Warden and Devise for security
    gem 'warden', '1.1'
    gem 'devise', '2.0.0'
    gem 'devise', '>= 2.0.0'

    # Extra Plugins

  21. paulmars revised this gist Sep 28, 2012. 1 changed file with 0 additions and 40 deletions.
    40 changes: 0 additions & 40 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,6 @@
    # Extra Plugins

    # SASS for Templating
    gem 'compass-rails', :group => [:assets]
    # gem 'sass-rails', :group => [:assets]
    gem 'coffee-rails', '~> 3.2.1', :group => [:assets]
    gem 'uglifier', '>= 1.0.3', :group => [:assets]
    @@ -36,7 +35,6 @@
    gem 'mysql2'
    gem 'yajl-ruby'
    gem 'escape_utils'
    gem 'compass-rails'
    gem 'jquery-rails'

    # extras
    @@ -195,8 +193,6 @@


    create_file "app/assets/stylesheets/_general.sass", <<-GENERAL
    @import "compass"
    html
    font: 13px/1.231 helvetica, clean, sans-serif
    background-color: #eee
    @@ -215,15 +211,6 @@
    a, a:hover, a:visited
    color: blue
    h1
    font-size: 1.5em
    h2
    font-size: 1.3em
    h3
    font-size: 1.1em
    #hd
    margin-bottom: 0.5em
    @@ -232,7 +219,6 @@
    .signin-bar
    float: right
    +horizontal-list
    GENERAL

    inject_into_file('app/assets/stylesheets/application.css', :after => "*= require_self") do
    @@ -242,32 +228,6 @@
    }
    end

    create_file "config/compass.rb", <<-COMPASS
    # This configuration file works with both the Compass command line tool and within Rails.
    # Require any additional compass plugins here.
    project_type = :rails
    # Set this to the root of your project when deployed:
    http_path = "/"
    # You can select your preferred output style here (can be overridden via the command line):
    # output_style = :expanded or :nested or :compact or :compressed
    # To enable relative paths to assets via compass helper functions. Uncomment:
    # relative_assets = true
    # To disable debugging comments that display the original location of your selectors. Uncomment:
    # line_comments = false
    # If you prefer the indented syntax, you might want to regenerate this
    # project again passing --syntax sass, or you can uncomment this:
    # preferred_syntax = :sass
    # and then run:
    # sass-convert -R --from scss --to sass app/stylesheets scss && rm -rf sass && mv scss sass
    COMPASS

    ## Git

    gitignore = <<-END
  22. paulmars revised this gist Mar 10, 2012. 1 changed file with 7 additions and 8 deletions.
    15 changes: 7 additions & 8 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -20,13 +20,13 @@
    gem 'uglifier', '>= 1.0.3', :group => [:assets]

    # Cucumber and Friends
    gem 'ruby-debug19', :group => [:test, :cucumber]
    gem "rspec-rails", '~> 2.8.0.rc1', :group => [:test, :cucumber]
    gem 'remarkable_activerecord', '~> 4.0.0.alpha4', :group => [:test, :cucumber]
    gem "cucumber-rails", ">= 1.2.0", :group => [:test, :cucumber]
    gem "capybara", :group => [:test, :cucumber]
    gem "database_cleaner", :group => [:test, :cucumber]
    gem "factory_girl_rails", :group => [:test, :cucumber]
    gem 'ruby-debug19', :group => [:development, :test]
    gem "rspec", :group => [:development, :test]
    gem "rspec-rails", '~> 2.8.0.rc1', :group => [:development, :test]
    gem 'remarkable_activerecord', '~> 4.0.0.alpha4', :group => [:development, :test]
    gem "capybara", :group => [:development, :test]
    gem "database_cleaner", :group => [:development, :test]
    gem "factory_girl_rails", :group => [:development, :test]

    # development
    gem 'auto_tagger', '0.2.3', :group => [:development]
    @@ -68,7 +68,6 @@

    # Run all the generators
    generate "rspec:install"
    generate "cucumber:install --capybara --rspec --spork"
    generate "devise:install"
    generate "devise:views"
    generate "devise User"
  23. paulmars revised this gist Mar 10, 2012. 1 changed file with 74 additions and 87 deletions.
    161 changes: 74 additions & 87 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,28 @@
    ## Rails App Template
    ## Updated for Rails 3.1
    ## Created on 10/23/10
    ## Updated on 11/6/11
    ## Updated for Rails 3.2.2
    ## Updated on 3/10/12
    ## Run using $ rails new [appname] -JT -m https://raw.github.com/gist/960988/template.rb
    ## Gems

    # General
    gem 'rake', '0.9.2.2'

    # Warden and Devise for security
    gem 'warden', '1.0.5'
    gem 'devise', '1.4.9'
    gem 'warden', '1.1'
    gem 'devise', '2.0.0'

    # Extra Plugins
    gem 'formtastic', '2.0.2'
    gem 'escape_utils'

    # SASS for Templating
    gem 'sass'
    gem 'compass', '~> 0.12.alpha'
    gem 'compass-rails', :group => [:assets]
    # gem 'sass-rails', :group => [:assets]
    gem 'coffee-rails', '~> 3.2.1', :group => [:assets]
    gem 'uglifier', '>= 1.0.3', :group => [:assets]

    # Cucumber and Friends
    gem "rspec-rails", ">= 2.7.0", :group => [:test, :cucumber]
    gem 'ruby-debug19', :group => [:test, :cucumber]
    gem "rspec-rails", '~> 2.8.0.rc1', :group => [:test, :cucumber]
    gem 'remarkable_activerecord', '~> 4.0.0.alpha4', :group => [:test, :cucumber]
    gem "cucumber-rails", ">= 1.2.0", :group => [:test, :cucumber]
    gem "capybara", :group => [:test, :cucumber]
    gem "database_cleaner", :group => [:test, :cucumber]
    @@ -31,8 +35,17 @@
    # all
    gem 'mysql2'
    gem 'yajl-ruby'
    gem 'escape_utils'
    gem 'compass-rails'
    gem 'jquery-rails'

    # extras
    gem 'escape_utils'
    gem 'will_paginate', '~> 3.0'
    gem 'bootstrap-will_paginate'
    gem 'formtastic', '2.0.2'
    gem 'formtastic-bootstrap'

    ## Generators

    inject_into_file('config/application.rb', :after => "config.filter_parameters += [:password]") do
    @@ -84,7 +97,7 @@
    <% end %>
    <% end %>
    <%= render :partial => "devise/shared/links" %>
    <%= render :partial => "devise/links" %>
    SIGNIN
    remove_file "app/views/devise/sessions/new.html.erb"
    create_file "app/views/devise/sessions/new.html.erb", signin
    @@ -103,7 +116,7 @@
    <% end %>
    <% end %>
    <%= render :partial => "devise/shared/links" %>
    <%= render :partial => "devise/links" %>
    SIGNUP
    remove_file "app/views/devise/registrations/new.html.erb"
    create_file "app/views/devise/registrations/new.html.erb", signup
    @@ -121,30 +134,45 @@
    <html>
    <head>
    <title>#{app_name.humanize}</title>
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css">
    <%= stylesheet_link_tag "application" %>
    <%= csrf_meta_tag %>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
    </head>
    <body>
    <div id="doc">
    <div id="hd">
    <ol class="signin-bar">
    <% if !user_signed_in? %>
    <li><%= link_to "Sign in", signin_url %></li>
    <li><%= link_to "Sign up", signup_url %></li>
    <% else %>
    <li><%= link_to "Sign out", signout_url %></li>
    <% end %>
    </ol>
    <h1>#{app_name.humanize}</h1></div>
    <div id="bd">
    <p class="notice"><%= notice %></p>
    <p class="alert"><%= alert %></p>
    <div>
    <%= yield %>
    <div id="hd" class="container">
    <div class="row">
    <div id="titlebar" class="span8">
    <h1><%= link_to h(#{app_name.humanize}), "/" %></h1>
    </div>
    <div class="span2">
    <ol class="signin-bar">
    <% if !user_signed_in? %>
    <li><%= link_to "Sign in", new_user_session_url, :id => "signin-btn", :class => "btn" %></li>
    <li><%= link_to "Sign up", new_user_registration_url, :id => "signup-btn", :class => "btn" %></li>
    <% else %>
    <li><%= link_to "Sign out", destroy_user_session_url, {:method => :delete, :id => "signout-btn", :class => "btn"} %></li>
    <% end %>
    </ol>
    </div>
    </div>
    <div id="ft"><p></p></div>
    </div>
    <div id="body" class="container">
    <% if flash.any? %>
    <div class="row">
    <div class="span8">
    <% if flash[:notice].present? %>
    <p class="notice"><%= notice %></p>
    <% end %>
    <% if flash[:alert].present? %>
    <p class="alert"><%= alert %></p>
    <% end %>
    </div>
    </div>
    <% end %>
    <%= yield %>
    </div>
    <%= javascript_include_tag :application %>
    <script type="text/javascript">
    @@ -158,12 +186,21 @@


    # SASS and SCSS
    create_file "app/assets/stylesheets/bootstrap.css", <<-BOOTSTRAP
    // http://twitter.github.com/bootstrap/
    BOOTSTRAP

    create_file "config/initializers/formtastic.rb", <<-FORMBOOT
    Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
    FORMBOOT


    create_file "app/assets/stylesheets/_general.sass", <<-GENERAL
    @import "compass"
    @import "compass/typography/lists"
    html
    font: 13px/1.231 helvetica, clean, sans-serif
    background-color: #eee
    #hd::after, #bd::after, #ft::after
    content: "."
    @@ -174,14 +211,6 @@
    body
    text-align: left
    background-color: #eee
    #doc
    margin: auto
    text-align: left
    width: 57.69em
    border: 1px solid #ddd
    padding: 0 1em
    background-color: white
    a, a:hover, a:visited
    @@ -207,54 +236,12 @@
    +horizontal-list
    GENERAL

    # formtastic

    generate "formtastic:install"

    run "mv public/stylesheets/formtastic.css app/assets/stylesheets/_formtastic.scss"

    remove_file "public/stylesheets/formtastic_changes.css"
    create_file "app/assets/stylesheets/_formtastic_changes.scss", <<-CHANGES
    $leftcolumnsize: 98.5%;
    form.formtastic fieldset { overflow: visible; }
    form.formtastic fieldset > ol > li { margin-bottom: 0.5em; overflow: visible; }
    form.formtastic fieldset > ol > li label { display:block; width: 100%; padding-top:0; }
    form.formtastic fieldset > ol > li p.inline-errors { margin:0.5em 0 0 0; }
    form.formtastic fieldset > ol > li ul.errors { margin:0.5em 0 0 0; }
    form.formtastic fieldset > ol > li.string input,
    form.formtastic fieldset > ol > li.password input,
    form.formtastic fieldset > ol > li.numeric input,
    form.formtastic fieldset > ol > li.email input,
    form.formtastic fieldset > ol > li.url input,
    form.formtastic fieldset > ol > li.phone input,
    form.formtastic fieldset > ol > li.search input { width:$leftcolumnsize; }
    form.formtastic fieldset > ol > li.string input[size],
    form.formtastic fieldset > ol > li.password input[size],
    form.formtastic fieldset > ol > li.numeric input[size],
    form.formtastic fieldset > ol > li.email input[size],
    form.formtastic fieldset > ol > li.url input[size],
    form.formtastic fieldset > ol > li.phone input[size],
    form.formtastic fieldset > ol > li.search input[size] { width:auto; max-width:$leftcolumnsize; }
    form.formtastic fieldset > ol > li.search input { width:$leftcolumnsize; }
    form.formtastic fieldset > ol > li.search input[size] { width:auto; max-width:$leftcolumnsize; }
    form.formtastic fieldset > ol > li.text textarea { width:$leftcolumnsize; }
    form.formtastic fieldset > ol > li.text textarea[cols] { width:auto; max-width:$leftcolumnsize; }
    form.formtastic fieldset.buttons { padding-left: 0; }
    form.formtastic label abbr { display:none }
    form.formtastic fieldset.inputs { margin-bottom: 0.5em; }
    form.formtastic fieldset legend { font-weight: bold; }
    CHANGES
    inject_into_file('app/assets/stylesheets/application.css', :after => "*= require_self") do
    %q{
    *= require bootstrap
    *= require formtastic-bootstrap
    }
    end

    create_file "config/compass.rb", <<-COMPASS
  24. paulmars revised this gist Feb 19, 2012. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion .gitignore
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    .idea
  25. paulmars revised this gist Nov 23, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -121,6 +121,7 @@
    <html>
    <head>
    <title>#{app_name.humanize}</title>
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css">
    <%= stylesheet_link_tag "application" %>
    <%= csrf_meta_tag %>
    </head>
  26. paulmars revised this gist Nov 23, 2011. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion template.rb
    Original file line number Diff line number Diff line change
    @@ -132,7 +132,6 @@
    <li><%= link_to "Sign in", signin_url %></li>
    <li><%= link_to "Sign up", signup_url %></li>
    <% else %>
    <li><%= current_user.name %></li>
    <li><%= link_to "Sign out", signout_url %></li>
    <% end %>
    </ol>
  27. paulmars revised this gist Nov 23, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion template.rb
    Original file line number Diff line number Diff line change
    @@ -163,7 +163,7 @@
    @import "compass/typography/lists"
    html
    font: 13px/1.231 arial, helvetica, clean, sans-serif
    font: 13px/1.231 helvetica, clean, sans-serif
    #hd::after, #bd::after, #ft::after
    content: "."
  28. paulmars revised this gist Nov 7, 2011. 1 changed file with 8 additions and 11 deletions.
    19 changes: 8 additions & 11 deletions template.rb
    Original file line number Diff line number Diff line change
    @@ -2,39 +2,36 @@
    ## Updated for Rails 3.1
    ## Created on 10/23/10
    ## Updated on 11/6/11
    ## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb

    ## Run using $ rails new [appname] -JT -m https://raw.github.com/gist/960988/template.rb
    ## Gems

    # Warden and Devise for security
    gem 'warden', '1.0.5'
    gem 'devise', '1.4.7'
    gem 'devise', '1.4.9'

    # Extra Plugins
    gem 'formtastic', '1.2.3'
    gem 'formtastic', '2.0.2'
    gem 'escape_utils'

    # SASS for Templating
    gem 'sass'
    gem 'compass', '~> 0.12.alpha'

    # Cucumber and Friends
    gem "rspec-rails", ">= 2.5.0", :group => [:test, :cucumber]
    gem "cucumber-rails", ">= 0.4.1", :group => [:test, :cucumber]
    gem "rspec-rails", ">= 2.7.0", :group => [:test, :cucumber]
    gem "cucumber-rails", ">= 1.2.0", :group => [:test, :cucumber]
    gem "capybara", :group => [:test, :cucumber]
    gem "database_cleaner", :group => [:test, :cucumber]
    gem "factory_girl_rails", :group => [:test, :cucumber]
    gem "launchy", ">= 0.3.7", :group => [:test, :cucumber]
    gem "spork", ">= 0.8.4", :group => [:test, :cucumber]

    # development
    gem 'auto_tagger', '0.2.3', :group => [:development]
    gem 'rails3-generators', '0.17.4', :group => [:development]

    # all
    gem 'mysql2', '0.2.6'
    gem 'json_pure', '1.4.6'
    gem "jquery-rails"
    gem 'mysql2'
    gem 'yajl-ruby'
    gem 'jquery-rails'

    ## Generators

  29. paulmars renamed this gist Nov 7, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tpl-cukeapp.rb → template.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ## Rails App Template
    ## Updated for Rails 3.0.7
    ## Updated for Rails 3.1
    ## Created on 10/23/10
    ## Updated on 5/7/11
    ## Updated on 11/6/11
    ## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb

    ## Gems
  30. paulmars revised this gist Oct 2, 2011. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions tpl-cukeapp.rb
    Original file line number Diff line number Diff line change
    @@ -116,7 +116,6 @@
    remove_file "public/images/rails.png"
    # Make a blank application javascript file
    remove_file "public/javascripts/application.js"
    create_file "public/javascripts/application.js"

    ## Layout

    @@ -150,7 +149,7 @@
    </div>
    <div id="ft"><p></p></div>
    </div>
    <%= javascript_include_tag :defaults %>
    <%= javascript_include_tag :application %>
    <script type="text/javascript">
    <%= yield :javascripts %>
    </script>