Sha256: 0c374248fec843853197fefdc8420c915443340f74ecf827cedd8db0fc6ecafc

Contents?: true

Size: 963 Bytes

Versions: 7

Compression:

Stored size: 963 Bytes

Contents

# coding: utf-8
module Formtastic
  class InstallGenerator < Rails::Generators::Base
    desc "Copies formtastic.css and formtastic_changes.css to public/stylesheets/ and a config initializer to config/initializers/formtastic_config.rb"

    def self.source_root
      # Set source directory for the templates to the rails2 generator template directory
      @source_root ||= File.expand_path(File.join('..', '..', '..', '..', 'generators', 'formtastic', 'templates'), File.dirname(__FILE__))
    end
    
    def self.banner
      "rails generate formtastic:install [options]"
    end

    def copy_files
      empty_directory 'config/initializers'
      template        'formtastic.rb', 'config/initializers/formtastic.rb'

      empty_directory 'public/stylesheets'
      template        'formtastic.css',         'public/stylesheets/formtastic.css'
      template        'formtastic_changes.css', 'public/stylesheets/formtastic_changes.css'
    end
  end
end

Version data entries

7 entries across 7 versions & 4 rubygems

Version Path
formtastic-1.1.0 lib/generators/formtastic/install/install_generator.rb
formtastic-1.1.0.beta lib/generators/formtastic/install/install_generator.rb
sensis-formtastic-rails3-1.d4e5326 lib/generators/formtastic/install/install_generator.rb
techthumb-formtastic-1.rails3.sha lib/generators/formtastic/install/install_generator.rb
formtastic-rails3-1.0.0.beta3 lib/generators/formtastic/install/install_generator.rb
formtastic-rails3-0.9.10.1 lib/generators/formtastic/install/install_generator.rb
formtastic-rails3-0.9.10.0 lib/generators/formtastic/install/install_generator.rb