Sha256: 2ef00fca61f9c23370ff352ebec8a518719c91d52917b46373c39e653e153071

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require "rails/generators"

##
# Generates an intializer for configuring the Honeycomb beeline
#
class HoneycombGenerator < Rails::Generators::Base
  source_root File.expand_path("templates", __dir__)

  argument :write_key, required: true, desc: "required"

  class_option :dataset, type: :string, default: "rails"

  gem "honeycomb-beeline"

  desc "Configures honeycomb with your write key"

  def create_initializer_file
    initializer "honeycomb.rb" do
      <<-RUBY.strip_heredoc
        Honeycomb.configure do |config|
          config.write_key = #{write_key.inspect}
          config.dataset = #{options['dataset'].inspect}
          config.notification_events = %w[
            sql.active_record
            render_template.action_view
            render_partial.action_view
            render_collection.action_view
            process_action.action_controller
            send_file.action_controller
            send_data.action_controller
            deliver.action_mailer
          ].freeze
        end
      RUBY
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
honeycomb-beeline-1.3.0 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.2.0 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.1.1 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.1.0 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.0.1 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.0.0 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.0.0.pre.beta4 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.0.0.pre.beta3 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.0.0.pre.beta2 lib/generators/honeycomb/honeycomb_generator.rb
honeycomb-beeline-1.0.0.pre.beta1 lib/generators/honeycomb/honeycomb_generator.rb