Sha256: c05fcc59843e4b6ca568e3f7959e83eef6f0b94cd32bbb04c6d890c15ed39ab4

Contents?: true

Size: 785 Bytes

Versions: 5

Compression:

Stored size: 785 Bytes

Contents

require 'rails/generators'

module SimpleFormDatetimepicker
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      desc "Installs SimpleFormDatetimepicker"

      def self.source_root
        @source_root ||= File.join(File.dirname(__FILE__), 'templates')
      end

      def copy_initializer
        copy_file 'simple_form_datetimepicker.rb', 'config/initializers/simple_form_datetimepicker.rb'
        inject_into_file 'app/assets/javascripts/application.js',  :before => '//= require_tree .' do
          "//= require simple_form_datetimepicker/init\n"
        end
        inject_into_file 'app/assets/stylesheets/application.css', :before => ' *= require_self' do
          " *= require bootstrap-datetimepicker\n"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_form_datetimepicker-0.0.9 lib/generators/simple_form_datetimepicker/install/install_generator.rb
simple_form_datetimepicker-0.0.8 lib/generators/simple_form_datetimepicker/install/install_generator.rb
simple_form_datetimepicker-0.0.7 lib/generators/simple_form_datetimepicker/install/install_generator.rb
simple_form_datetimepicker-0.0.6 lib/generators/simple_form_datetimepicker/install/install_generator.rb
simple_form_datetimepicker-0.0.5 lib/generators/simple_form_datetimepicker/install/install_generator.rb