lib/generators/dockerfile_generator.rb in dockerfile-rails-1.5.7 vs lib/generators/dockerfile_generator.rb in dockerfile-rails-1.5.8

- old
+ new

@@ -385,10 +385,15 @@ def using_node? return @using_node if @using_node != nil @using_node = File.exist? "package.json" end + def using_bun? + return @using_bun if @using_bun != nil + @using_bun = File.exist?("bun.config.js") || File.exist?("bun.lockb") + end + def using_redis? # Note: If you have redis installed on your computer, 'rails new` will # automatically add redis to your Gemfile, so having it in your Gemfile is # not a reliable indicator of whether or not your application actually uses # redis. @@ -499,11 +504,11 @@ gems = ["bundler"] if options.ci? && options.lock? && @gemfile.include?("debug") # https://github.com/rails/rails/pull/47515 # https://github.com/rubygems/rubygems/issues/6082#issuecomment-1329756343 - gems += %w(irb reline) - @gemfile unless Gem.ruby_version >= "3.2.2" + gems += %w(irb reline) - @gemfile unless Gem.ruby_version >= Gem::Version.new("3.2.2") end gems.sort end @@ -952,10 +957,18 @@ version rescue "latest" end + + def bun_version + version = `bun --version`[/\d+\.\d+\.\d+/] + version ||= `npm show bun version`[/\d+\.\d+\.\d+/] + + version + end + def depend_on_bootsnap? @gemfile.include? "bootsnap" end def api_only? @@ -980,10 +993,10 @@ def api_client_files client = api_client_dir return unless client - Dir["#{client}/{package.json,package-lock.json,yarn.lock}"] + Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb}"] end def dbprep_command if !options.migrate.blank? options.migrate