Sha256: c706e757704f408f7d4054f745508627f4f5cfd725a8a30e7f49348d48752052

Contents?: true

Size: 771 Bytes

Versions: 9

Compression:

Stored size: 771 Bytes

Contents

class ActiveadminJobs::InstallGenerator < Rails::Generators::Base
  def add_javascripts
    file_path = "app/assets/javascripts/active_admin.js.coffee"
    line_to_add = "#= require activeadmin_jobs/base\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 = "@import \"activeadmin_jobs/base\";\n"
    reference = "@import \"active_admin/base\";\n"
    inject_into_file("#{file_path}.scss", line_to_add, after: reference)

  rescue Errno::ENOENT
    inject_into_file("#{file_path}.css.scss", line_to_add, after: reference)
  end

  def run_job_notifier_generator
    generate("job_notifier:install")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
activeadmin_jobs-0.5.2 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.5.1 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.5.0 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.4.1 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.4.0 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.3.0 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.2.1 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.2.0 lib/generators/activeadmin_jobs/install/install_generator.rb
activeadmin_jobs-0.1.2 lib/generators/activeadmin_jobs/install/install_generator.rb