Sha256: e2a2a4dd6babfc0147cf67deaf04365219db3d30541d09027147896d2ea4e3b4

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

require 'rails/generators'
require 'rails/generators/named_base'

module LinkToAction
  module Generators
    class InstallGenerator < Rails::Generators::Base
      desc "Copy LinkToAction configuration file"
      source_root File.expand_path('../templates', __FILE__)

      def copy_initializers
        copy_file 'link_to_action.rb', 'config/initializers/link_to_action.rb'
      end

      def copy_locale_file
        copy_file '../../../link_to_action/locale/en.yml',
          'config/locales/link_to_action.en.yml'
      end
      
      def copy_templates
        # TODO: one LOC
        copy_file 'edit.html.erb', 'lib/templates/erb/scaffold/edit.html.erb'
        copy_file 'index.html.erb', 'lib/templates/erb/scaffold/index.html.erb'
        copy_file 'new.html.erb', 'lib/templates/erb/scaffold/new.html.erb'
        copy_file 'show.html.erb', 'lib/templates/erb/scaffold/show.html.erb'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
link_to_action-0.2.5 lib/generators/link_to_action/install_generator.rb