diff --git a/lib/bulletmark_repairer/configuration.rb b/lib/bulletmark_repairer/configuration.rb new file mode 100644 index 0000000..4f8d6b9 --- /dev/null +++ b/lib/bulletmark_repairer/configuration.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module BulletmarkRepairer + class Configration + attr_writer :development + + def initialize + @development = false + end + + def development? + development + end + end + + class << self + def configure + yield config + end + + def config + @config ||= Configration.new + end + end +end diff --git a/lib/bulletmark_repairer/rack.rb b/lib/bulletmark_repairer/rack.rb index d4048c9..a58c475 100644 --- a/lib/bulletmark_repairer/rack.rb +++ b/lib/bulletmark_repairer/rack.rb @@ -19,8 +19,7 @@ def call(env) ) end rescue StandardError => e - # TODO: handle error - raise e + raise e if BulletmarkRepairer.config.development? end end end