Skip to content

Commit

Permalink
Introduce Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
makicamel committed Oct 9, 2023
1 parent 1d230d3 commit 0f07e9b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 25 additions & 0 deletions lib/bulletmark_repairer/configuration.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions lib/bulletmark_repairer/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f07e9b

Please sign in to comment.