Sha256: 8c733b9c62aa8e177bc4661167cf4fb267361bd8ad1efdb985e276b51cae4e4f

Contents?: true

Size: 616 Bytes

Versions: 7

Compression:

Stored size: 616 Bytes

Contents

module Chapter07
  module Generators
    class SolutionsGenerator < Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      def copy_app_tree
        directory(self.class.source_root, Rails.root)
      end

      def add_help_route

        dest = File.join(Rails.root,'config','routes.rb')
        insert_into_file(dest, :after => %r{/about.*:to.*pages#about.*$}) do
          "\n  match '/help',    :to => 'pages#help'"
        end
      end

      def remove_static_index_html_file
        remove_file(File.join(Rails.root, 'public', 'index.html'))
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
tft_rails_dbc-0.1.3 lib/generators/chapter07/solutions/solutions_generator.rb
tft_rails_dbc-0.1.1 lib/generators/chapter07/solutions/solutions_generator.rb
tft_rails_dbc-0.1 lib/generators/chapter07/solutions/solutions_generator.rb
tft_rails-0.6.2 lib/generators/chapter07/solutions/solutions_generator.rb
tft_rails-0.6.1 lib/generators/chapter07/solutions/solutions_generator.rb
tft_rails-0.6.0 lib/generators/chapter07/solutions/solutions_generator.rb
tft_rails-0.5.1 lib/generators/chapter07/solutions/solutions_generator.rb