Sha256: 8ff97b3edc9624ae61f6574edc5d8ba29d6fc4cf4e09dad98cfe1bc6161b987d

Contents?: true

Size: 1.33 KB

Versions: 18

Compression:

Stored size: 1.33 KB

Contents

# Application template recipe for the rails_apps_composer. Check for a newer version here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/cleanup.rb

after_bundler do

  say_wizard "Cleanup recipe running 'after bundler'"

  # remove unnecessary files
  %w{
    README
    doc/README_FOR_APP
    public/index.html
  }.each { |file| remove_file file }
  
  if recipes.include? 'rails 3.0'
    %w{
      public/images/rails.png
    }.each { |file| remove_file file }
  else
    %w{
      app/assets/images/rails.png
    }.each { |file| remove_file file }
  end
  
  # add placeholder READMEs
  get "https://raw.github.com/RailsApps/rails3-application-templates/master/files/sample_readme.txt", "README"
  get "https://raw.github.com/RailsApps/rails3-application-templates/master/files/sample_readme.textile", "README.textile"
  gsub_file "README", /App_Name/, "#{app_name.humanize.titleize}"
  gsub_file "README.textile", /App_Name/, "#{app_name.humanize.titleize}"

  # remove commented lines from Gemfile
  # thanks to https://github.com/perfectline/template-bucket/blob/master/cleanup.rb
  gsub_file "Gemfile", /#.*\n/, "\n"
  gsub_file "Gemfile", /\n+/, "\n"

end

__END__

name: Cleanup
description: "Remove unnecessary files left over from generating a new Rails app."
author: RailsApps

category: other
tags: [utilities, configuration]

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rails_apps_composer-1.0.26 recipes/cleanup.rb
rails_apps_composer-1.0.25 recipes/cleanup.rb
rails_apps_composer-1.0.24 recipes/cleanup.rb
rails_apps_composer-1.0.23 recipes/cleanup.rb
rails_apps_composer-1.0.22 recipes/cleanup.rb
rails_apps_composer-1.0.21 recipes/cleanup.rb
rails_apps_composer-1.0.20 recipes/cleanup.rb
rails_apps_composer-1.0.19 recipes/cleanup.rb
rails_apps_composer-1.0.18 recipes/cleanup.rb
rails_apps_composer-1.0.17 recipes/cleanup.rb
rails_apps_composer-1.0.16 recipes/cleanup.rb
rails_apps_composer-1.0.15 recipes/cleanup.rb
rails_apps_composer-1.0.14 recipes/cleanup.rb
rails_apps_composer-1.0.12 recipes/cleanup.rb
rails_apps_composer-1.0.11 recipes/cleanup.rb
rails_apps_composer-1.0.10 recipes/cleanup.rb
rails_apps_composer-1.0.7 recipes/cleanup.rb
rails_apps_composer-1.0.6 recipes/cleanup.rb