lib/qodex-rails.rb in qodex-rails-0.1.0 vs lib/qodex-rails.rb in qodex-rails-0.1.1
- old
+ new
@@ -1,9 +1,24 @@
require "qodex-rails/version"
require "qodex-rails/middleware"
+require "qodex-rails/configuration" # Require the new configuration file
module QodexRails
class Error < StandardError; end
+
+ class << self
+ attr_writer :configuration
+
+ # Get or initialize the configuration
+ def configuration
+ @configuration ||= Configuration.new
+ end
+
+ # Allow block-style configuration
+ def configure
+ yield(configuration)
+ end
+ end
class Railtie < Rails::Railtie
initializer "qodex-rails.insert_middleware" do |app|
app.config.middleware.use Middleware::RequestLogger
end