Skip to content

Commit af456ca

Browse files
committed
Add puma plugin on install
1 parent 56eaa12 commit af456ca

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

lib/install/bun/install.rb

+5
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@
2828
copy_file "#{__dir__}/.gitattributes", ".gitattributes"
2929
end
3030
say %(Run `git config diff.lockb.textconv bun && git config diff.lockb.binary true` to enable pretty diffs for Bun's .lockb file), :green
31+
32+
if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
33+
say %(Adding plugin to puma.rb)
34+
insert_into_file puma_config_path, %|\nplugin :bun if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
35+
end

lib/install/esbuild/install.rb

+5
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@
1717
else
1818
say %(Add "scripts": { "build": "#{build_script}" } to your package.json), :green
1919
end
20+
21+
if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
22+
say %(Adding plugin to puma.rb)
23+
insert_into_file puma_config_path, %|\nplugin :yarn if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
24+
end

lib/install/rollup/install.rb

+5
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@
1818
else
1919
say %(Add "scripts": { "build": "#{build_script}" } to your package.json), :green
2020
end
21+
22+
if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
23+
say %(Adding plugin to puma.rb)
24+
insert_into_file puma_config_path, %|\nplugin :yarn if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
25+
end

lib/install/webpack/install.rb

+5
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@
1818
else
1919
say %(Add "scripts": { "build": "#{build_script}" } to your package.json), :green
2020
end
21+
22+
if (puma_config_path = Rails.root.join("config/puma.rb")).exist?
23+
say %(Adding plugin to puma.rb)
24+
insert_into_file puma_config_path, %|\nplugin :yarn if ENV.fetch("RAILS_ENV", "development") == "development"|, after: "plugin :tmp_restart"
25+
end

0 commit comments

Comments
 (0)