Sha256: 0b66d266eedad151ca305adc76e8568e7188685e71a932787a982b87c68ea6f0

Contents?: true

Size: 730 Bytes

Versions: 14

Compression:

Stored size: 730 Bytes

Contents

module ActiveadminAddons
  module Generators
    class InstallGenerator < Rails::Generators::Base
      def add_javascripts
        file_path = 'app/assets/javascripts/active_admin.js.coffee'
        line_to_add = "#= require activeadmin_addons/all\n"
        reference = "#= require active_admin/base\n"
        inject_into_file(file_path, line_to_add, after: reference)
      end

      def add_stylesheets
        file_path = 'app/assets/stylesheets/active_admin'
        line_to_add = "//= require activeadmin_addons/all\n"

        begin
          prepend_file("#{file_path}.scss", line_to_add)
        rescue Errno::ENOENT
          prepend_file("#{file_path}.css.scss", line_to_add)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
activeadmin_addons-0.10.1 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.10.0 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.9.3 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.9.2 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.9.1 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.9.0 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.8.0 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.7.0 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.6.4 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.6.3 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.6.2 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.6.1 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.6.0 lib/generators/activeadmin_addons/install/install_generator.rb
activeadmin_addons-0.5.0 lib/generators/activeadmin_addons/install/install_generator.rb