Skip to content

Commit

Permalink
Add spring watch
Browse files Browse the repository at this point in the history
When a pack moves, we want spring to update the loaded classes
so that packwerk prints correct results
  • Loading branch information
professor committed Feb 2, 2024
1 parent 13b0c4a commit e4cd167
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/packs/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ class Railtie < ::Rails::Railtie
# hook into packs-rails via ActiveSupport hooks.
ActiveSupport.run_load_hooks(:packs_rails, Packs)
end


config.after_initialize do |app|
if defined?(Spring)
puts "Hello Db Blasters!"
Packs::Specification::Configuration.fetch.pack_paths.each do |dir|
puts "#{dir}"
Dir["#{dir}/package.yml"].each { |f|
puts f
Spring.watch(f)
}
end
end
end
end
end
end

0 comments on commit e4cd167

Please sign in to comment.