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 e3d40b7 commit 05e018a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ AllCops:
- bin/*
- gemfiles/*
- spec/dummy/**/*
- lib/generators/**/*.rb

Gemspec/RequireMFA:
Enabled: false
Expand Down
4 changes: 3 additions & 1 deletion lib/generators/royce/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails/generators'
require 'rails/generators/active_record'

Expand All @@ -6,7 +8,7 @@ class InstallGenerator < ::Rails::Generators::Base

include ::Rails::Generators::Migration

source_root File.expand_path('../templates', __FILE__)
source_root File.expand_path('templates', __dir__)

desc 'Generates DB migration files for Royce'
def create_migration_file
Expand Down
13 changes: 8 additions & 5 deletions lib/royce.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# frozen_string_literal: true

# require external dependencies
require 'zeitwerk'
loader = Zeitwerk::Loader.for_gem
generators = "#{__dir__}/generators"
loader.ignore(generators)
loader.setup

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

module Royce
require 'royce/engine' if defined?(Rails)
require_relative 'royce/engine' if defined?(Rails)
end

0 comments on commit 05e018a

Please sign in to comment.