Skip to content

Commit

Permalink
Coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Sep 30, 2024
1 parent 69bec4c commit 10ce246
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions lib/draper.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# frozen_string_literal: true

# require external dependencies
require 'active_support/concern'
require 'request_store'

require 'zeitwerk'
loader = Zeitwerk::Loader.for_gem
loader.ignore("#{__dir__}/draper/rails")
loader.ignore("#{__dir__}/draper/test")
loader.setup

# load zeitwerk
Zeitwerk::Loader.for_gem.tap do |loader|
loader.ignore("#{__dir__}/draper/rails")
loader.ignore("#{__dir__}/draper/test")
loader.setup
end

module Draper
require 'draper/engine' if defined?(Rails)
require_relative 'draper/engine' if defined?(Rails)

class UninferrableDecoratorError < NameError
def initialize(klass, decorator)
Expand Down
2 changes: 1 addition & 1 deletion lib/draper/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Engine < ::Rails::Engine

config.after_initialize do |_app|
if Rails.env.test? && defined?(RSpec) && RSpec.respond_to?(:configure)
require 'draper/test/rspec_integration'
require_relative 'test/rspec_integration'

RSpec.configure do |config|
config.include Draper::Test::RspecIntegration, file_path: %r{spec/decorators}, type: :decorator
Expand Down

0 comments on commit 10ce246

Please sign in to comment.