Sha256: 6ffc84fdb1b7bd589816b24c8adfff81a70a1f941eae66da1909c88e495c59e3

Contents?: true

Size: 850 Bytes

Versions: 47

Compression:

Stored size: 850 Bytes

Contents

# Creates the Airbrake initializer file for Rails apps.
#
# @example Invokation from terminal
#   rails generate airbrake PROJECT_KEY PROJECT_ID [NAME]
#
class AirbrakeGenerator < Rails::Generators::Base
  # Adds current directory to source paths, so we can find the template file.
  source_root File.expand_path(__dir__)

  argument :project_id, required: false
  argument :project_key, required: false

  # Makes the NAME option optional, which allows to subclass from Base, so we
  # can pass arguments to the ERB template.
  #
  # @see http://asciicasts.com/episodes/218-making-generators-in-rails-3
  argument :name, type: :string, default: 'application'

  desc 'Configures the Airbrake notifier with your project id and project key'
  def generate_layout
    template 'airbrake_initializer.rb.erb', 'config/initializers/airbrake.rb'
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
airbrake-10.0.0 lib/generators/airbrake_generator.rb
airbrake-9.5.5 lib/generators/airbrake_generator.rb
airbrake-9.5.4 lib/generators/airbrake_generator.rb
airbrake-9.5.3 lib/generators/airbrake_generator.rb
airbrake-9.5.2 lib/generators/airbrake_generator.rb
airbrake-9.5.1 lib/generators/airbrake_generator.rb
airbrake-9.5.0 lib/generators/airbrake_generator.rb
airbrake-9.4.5 lib/generators/airbrake_generator.rb
airbrake-9.4.4 lib/generators/airbrake_generator.rb
airbrake-9.4.3 lib/generators/airbrake_generator.rb
airbrake-9.4.2 lib/generators/airbrake_generator.rb
airbrake-9.4.1 lib/generators/airbrake_generator.rb
airbrake-9.4.0 lib/generators/airbrake_generator.rb
airbrake-9.3.0 lib/generators/airbrake_generator.rb
airbrake-9.2.2 lib/generators/airbrake_generator.rb
airbrake-9.2.1 lib/generators/airbrake_generator.rb
airbrake-9.2.0 lib/generators/airbrake_generator.rb
airbrake-9.1.0 lib/generators/airbrake_generator.rb
airbrake-9.0.2 lib/generators/airbrake_generator.rb
airbrake-9.0.1 lib/generators/airbrake_generator.rb