Sha256: ffbecd148fd23c883932e89e705f20758688019539b77572d788f1a4e713e03a

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

require 'rails/generators'

module Formnestic
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path("../../../../", __FILE__)
      
      def copy_javascript        
        directory "app/assets/javascripts/formnestic", 'app/assets/javascripts/formnestic'
      end
      
      def copy_css
        directory "app/assets/stylesheets/formnestic", 'app/assets/stylesheets/formnestic'
      end
      
      def inject_javascript
        append_to_file 'app/assets/javascripts/application.js' do
          out = "\n"
          out << "//= require formnestic/formnestic"
        end
      end
      
      def inject_css
        append_to_file 'app/assets/stylesheets/application.css' do
          out = "\n"
          out << "/* *= require formnestic/formnestic */"
        end
      end
      
      def copy_locales
        copy_file "config/locales/formnestic.en.yml", "config/locales/formnestic.en.yml"
      end            
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
formnestic-1.0.12 lib/generators/formnestic/install_generator.rb
formnestic-1.0.11 lib/generators/formnestic/install_generator.rb
formnestic-1.0.10 lib/generators/formnestic/install_generator.rb
formnestic-1.0.9 lib/generators/formnestic/install_generator.rb
formnestic-1.0.8 lib/generators/formnestic/install_generator.rb
formnestic-1.0.7 lib/generators/formnestic/install_generator.rb
formnestic-1.0.6 lib/generators/formnestic/install_generator.rb
formnestic-1.0.5 lib/generators/formnestic/install_generator.rb
formnestic-1.0.4 lib/generators/formnestic/install_generator.rb
formnestic-1.0.3 lib/generators/formnestic/install_generator.rb
formnestic-1.0.2 lib/generators/formnestic/install_generator.rb
formnestic-1.0.1 lib/generators/formnestic/install_generator.rb
formnestic-1.0.0 lib/generators/formnestic/install_generator.rb