dockerfile-rails 1.7.3 → 1.7.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45a9050bf01761b7e8542d0a5a98b757ba10ad8237169a2c5adde8ef0defb68b
4
- data.tar.gz: ef2572435e69a2a38bbc40c1b7c5f6e8b2be9e68148be509d382b4f02f327e4d
3
+ metadata.gz: d70002b918b2110952ebace8ba264db76189fe7f5a27b1985313871e9318af8f
4
+ data.tar.gz: 9cd5e7a99158113277978a9787cb099ba002d35d2dfaef2fba58d9abf1a67225
5
5
  SHA512:
6
- metadata.gz: bf4676f2c8b5f2eb9a41c52d9ec7b48527ed90b1659f8786b70518fee5961ab0f7762577893acc6266de2830d658a0385d3385fd989bce7de32b12826326b0df
7
- data.tar.gz: 9547ff75541f16a457368d51bd3840f6e318e87dfa35a12c8db7b71928920ca5f6e1ee64b53a9d0e38fe565a4f49eb9cc4de608e2eb6b0391373f662a05bb920
6
+ metadata.gz: 93bc70acc19970a2813bfcd9e56138dd3216ea6998e8a883cff27a305e8cd2a6694a750333249e1367eea05b37edccc2183f2a1d09b2fc1f8f65428d66f38af4
7
+ data.tar.gz: 13f8868fbc6e5e09be03e3f323c9093e136b5b93d760d883d94057138f8e8c92ffd04841a5963a4c08175a011f03a44998ed7a396c2861da890ac4d3a6d8f001
@@ -515,7 +515,12 @@ private
515
515
  end
516
516
 
517
517
  def references_ruby_version_file?
518
- @references_ruby_version_file ||= IO.read("Gemfile").include?(".ruby-version")
518
+ @references_ruby_version_file ||= ruby_version_file.present?
519
+ end
520
+
521
+ def ruby_version_file
522
+ match = IO.read("Gemfile").match(/ruby file: ["'](.*)["']/)
523
+ match ? match[1] : nil
519
524
  end
520
525
 
521
526
  def using_redis?
@@ -1255,7 +1260,7 @@ private
1255
1260
  client = api_client_dir
1256
1261
  return unless client
1257
1262
 
1258
- Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb}"]
1263
+ Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb,bun.lock}"]
1259
1264
  end
1260
1265
 
1261
1266
  def dbprep_command
@@ -1600,7 +1605,7 @@ private
1600
1605
  def fix_database_config
1601
1606
  yaml = IO.read("config/database.yml")
1602
1607
 
1603
- production = YAML.load(yaml, aliases: true)["production"]
1608
+ production = YAML.load(yaml, aliases: true)["production"] rescue nil
1604
1609
  return unless production.is_a?(Hash) && production.values.all?(Hash)
1605
1610
  return if production.keys == [ "primary" ]
1606
1611
 
@@ -9,7 +9,7 @@
9
9
  # For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
10
10
  <% end -%>
11
11
 
12
- # Make sure RUBY_VERSION matches the Ruby version in .ruby-version
12
+ # Make sure RUBY_VERSION matches the Ruby version in <%= ruby_version_file || '.ruby-version' %>
13
13
  ARG RUBY_VERSION=<%= RUBY_VERSION %>
14
14
  <% if api_client_dir -%>
15
15
  <%= render partial: 'node_client' %>
@@ -70,7 +70,7 @@ FROM base AS <%= parallel? ? 'pre' : '' %>build
70
70
  FROM prebuild AS <% if using_bun? %>bun<% else %>node<% end %>
71
71
 
72
72
  <% end -%>
73
- <% if using_bun? and (!using_execjs? || File.exist?('bun.lockb')) -%>
73
+ <% if using_bun? and (!using_execjs? || File.exist?('bun.lockb') || File.exist?('bun.lock')) -%>
74
74
  <%= render partial: 'install_node', locals: {bun_version: using_execjs? ? nil : bun_version} %>
75
75
 
76
76
  <% elsif using_node? and (!using_execjs? || File.exist?('yarn.lock')) -%>
@@ -78,7 +78,7 @@ FROM prebuild AS <% if using_bun? %>bun<% else %>node<% end %>
78
78
 
79
79
  <% end -%>
80
80
  <% if parallel? -%>
81
- <%= render partial: 'npm_install', locals: {sources: Dir[*%w(package.json yarn.lock bun.lockb)]} %>
81
+ <%= render partial: 'npm_install', locals: {sources: Dir[*%w(package.json yarn.lock bun.lockb bun.lock)]} %>
82
82
 
83
83
 
84
84
  FROM prebuild AS build
@@ -95,7 +95,7 @@ ENV <%= build_env.join(" \\\n ") %>
95
95
 
96
96
  <% end -%>
97
97
  # Install application gems
98
- COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %>.ruby-version <% end %>./
98
+ COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %><%= ruby_version_file %> <% end %>./
99
99
  <% if @netpopbug && Rails.env != "test" -%>
100
100
  RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock
101
101
  <% end -%>
@@ -149,7 +149,7 @@ ENV PATH=/usr/local/node/bin:$PATH
149
149
  <% end -%>
150
150
 
151
151
  <% elsif using_node? || using_bun? -%>
152
- <%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock bun.lockb)]} %>
152
+ <%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock bun.lockb bun.lock)]} %>
153
153
 
154
154
  <% end -%>
155
155
  # Copy application code
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 1.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-20 00:00:00.000000000 Z
10
+ date: 2025-01-31 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails