Sha256: 3277f35b893eac0e5dfd2f7de60ff7836c4c6f0cab1a140254f0b8c7efa389c1

Contents?: true

Size: 743 Bytes

Versions: 1

Compression:

Stored size: 743 Bytes

Contents

require "rails/generators"

module Suspenders
  class SecurityGenerator < Rails::Generators::Base
    source_root File.expand_path(
      File.join("..", "..", "..", "templates"),
      File.dirname(__FILE__),
    )

    def add_checkers_gems
      gem 'brakeman', require: false, group: :development
      gem 'bundler-audit', '>= 0.5.0', require: false, group: :development
      Bundler.with_clean_env { run "bundle install" }
    end


    def setup_brakeman
      copy_file "brakeman.rake", "lib/tasks/brakeman.rake"
    end

    def setup_bundler_audit
      copy_file "bundler_audit.rake", "lib/tasks/bundler_audit.rake"
    end

    def create_binstubs
      Bundler.with_clean_env { run "bundle binstubs brakeman" }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
welaika-suspenders-2.29.0.alpha.1 lib/suspenders/generators/security_generator.rb