17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/smplkit/generators/install_generator.rb', line 17
def initializer_contents
<<~RUBY
# frozen_string_literal: true
# smplkit configuration. Anything you don't set here resolves through
# the standard SMPLKIT_* env vars or the ~/.smplkit profile file.
Rails.application.configure do
config.smplkit.environment = Rails.env
config.smplkit.service = "your-service-name"
# config.smplkit.api_key = ENV["SMPLKIT_API_KEY"]
# Optional: per-request context. The provider receives the Rack env
# and returns an Array of Smplkit::Context. Returning nil/[] is fine.
#
# config.smplkit.context_provider = ->(env) {
# user = env["warden"]&.user
# next [] unless user
#
# [Smplkit::Context.new("user", user.id.to_s, plan: user.plan)]
# }
end
RUBY
end
|