Skip to content

Commit

Permalink
Add puma plugin on install
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorrjohn committed Dec 10, 2024
1 parent bba6357 commit 278b173
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/install/bun/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@
copy_file "#{__dir__}/.gitattributes", ".gitattributes"
end
say %(Run `git config diff.lockb.textconv bun && git config diff.lockb.binary true` to enable pretty diffs for Bun's .lockb file), :green

if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
say %(Adding plugin to puma.rb)
insert_into_file puma_config_path, %|\nplugin :bun if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
end
5 changes: 5 additions & 0 deletions lib/install/esbuild/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
else
say %(Add "scripts": { "build": "#{build_script}" } to your package.json), :green
end

if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
say %(Adding plugin to puma.rb)
insert_into_file puma_config_path, %|\nplugin :yarn if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
end
5 changes: 5 additions & 0 deletions lib/install/rollup/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@
else
say %(Add "scripts": { "build": "#{build_script}" } to your package.json), :green
end

if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
say %(Adding plugin to puma.rb)
insert_into_file puma_config_path, %|\nplugin :yarn if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
end
5 changes: 5 additions & 0 deletions lib/install/webpack/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@
else
say %(Add "scripts": { "build": "#{build_script}" } to your package.json), :green
end

if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
say %(Adding plugin to puma.rb)
insert_into_file puma_config_path, %|\nplugin :yarn if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
end

0 comments on commit 278b173

Please sign in to comment.