dockerfile-rails 1.6.16 → 1.6.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58f8f53b0d27c7e345bd334b553fee30ae766900f396097e062a6436aeada430
4
- data.tar.gz: 71f820e93e2b14351a33a1ab0f612850446676d24060e8f44d53f7e4a38da3ba
3
+ metadata.gz: e637270c44cb54868cd8947bc9347000e60ae76395d5f2033ca61f67f8266bac
4
+ data.tar.gz: afe0959d1da483ca595e1b13bf5f7568bf470aa1b6abaf8e3e604b21cebcf793
5
5
  SHA512:
6
- metadata.gz: 9d959ba0aaf0890a66a914054c624e7575536ea33e441aa672bfd445f683964bab05bbb7f87ee11aaab9b6a285cc955c71164fb48668b5a194670eec97dc8dd3
7
- data.tar.gz: 473551cdb95d6c409252ceda5cb721991b36b86c283960ca188c0b05bc7b0d417bec97b95ab5a3c2c285b0800fa1690417e294277e3aa535a95ba8b39f77dfeb
6
+ metadata.gz: 11c0b726982acebf8d3943aaf2c498e9ecfb4960f943f3ef094881390601c9c6bdfb1d2cb69a45fbf4b0d481284d3cefc76986b3187f7b6d09a53434cd26f373
7
+ data.tar.gz: 5c971c5b102ec993900e0bb75ccb52e17335499649ae05c23c2d6302f12e8514e200071cdd19015af5f0e28d65e2405f77799bcb7089fdd2ae7de0c38ade0f9d
data/Rakefile CHANGED
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rails"
4
+ Rails.env = "test"
5
+
3
6
  require "bundler/gem_tasks"
4
7
 
5
8
  # Run `rake release` to release a new version of the gem.
@@ -14,6 +14,12 @@ module DockerfileRails
14
14
  @git ||= ENV["RAILS_ENV"] != "test" && parser.specs.any? do |spec|
15
15
  spec.source.instance_of? Bundler::Source::Git
16
16
  end
17
+
18
+ # determine if the application is affected by the net-pop bug
19
+ # https://github.com/ruby/ruby/pull/11006#issuecomment-2176562332
20
+ if RUBY_VERSION == "3.3.3" && @gemfile.include?("net-pop")
21
+ @netpopbug = parser.specs.find { |spec| spec.name == "net-pop" }.dependencies.empty?
22
+ end
17
23
  end
18
24
 
19
25
  if File.exist? "Gemfile"
@@ -86,5 +92,11 @@ module DockerfileRails
86
92
  def using_trilogy?
87
93
  @gemfile.include?("trilogy") || @gemfile.include?("activerecord-trilogy-adapter")
88
94
  end
95
+
96
+ ### patches ###
97
+ if RUBY_VERSION == "3.3.3"
98
+ Bundler::LockfileParser.new(Bundler.read_file("Gemfile.lock"))
99
+
100
+ end
89
101
  end
90
102
  end
@@ -402,6 +402,15 @@ class DockerfileGenerator < Rails::Generators::Base
402
402
  STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
403
403
  end
404
404
 
405
+ if @netpopbug && !dockerfile.include?("net-pop")
406
+ message = "Ruby 3.3.3 net-pop bug detected."
407
+ STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
408
+ STDERR.puts "Please see https://github.com/ruby/ruby/pull/11006"
409
+ STDERR.puts "Change your Ruby version, or run `bin/rails generate dockerfile`,"
410
+ STDERR.puts "or add the following to your Dockerfile:"
411
+ STDERR.puts 'RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock'
412
+ end
413
+
405
414
  if (options.sqlite3? || @sqlite3) && !dockerfile.include?("DATABASE_URL") && File.exist?("fly.toml")
406
415
  toml = IO.read("fly.toml")
407
416
  if !toml.include?("[[env]]")
@@ -1394,10 +1403,10 @@ private
1394
1403
  "kb" => 1000,
1395
1404
  "mib" => 1048576,
1396
1405
  "m" => 1048576,
1397
- "mb" => 100000,
1406
+ "mb" => 1000000,
1398
1407
  "gib" => 1073741824,
1399
1408
  "g" => 1073741824,
1400
- "gb" => 100000000,
1409
+ "gb" => 1000000000,
1401
1410
  }
1402
1411
 
1403
1412
  pattern = Regexp.new("^(\\d+)(#{suffixes.keys.join('|')})?$", "i")
@@ -87,6 +87,9 @@ ENV <%= build_env.join(" \\\n ") %>
87
87
  <% end -%>
88
88
  # Install application gems
89
89
  COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %>.ruby-version <% end %>./
90
+ <% if @netpopbug && Rails.env != "test" -%>
91
+ RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock
92
+ <% end -%>
90
93
  <% if options.cache? -%>
91
94
  RUN --mount=type=cache,id=bld-gem-cache,sharing=locked,target=/srv/vendor \
92
95
  <% if private_gemserver_env_variable_name -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.16
4
+ version: 1.6.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-05 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,7 +37,6 @@ files:
37
37
  - Rakefile
38
38
  - lib/dockerfile-rails.rb
39
39
  - lib/dockerfile-rails/scanner.rb
40
- - lib/fly_replay.rb
41
40
  - lib/generators/dockerfile_generator.rb
42
41
  - lib/generators/templates/Dockerfile.erb
43
42
  - lib/generators/templates/_apt_install.erb
@@ -75,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
74
  - !ruby/object:Gem::Version
76
75
  version: '0'
77
76
  requirements: []
78
- rubygems_version: 3.5.9
77
+ rubygems_version: 3.5.10
79
78
  signing_key:
80
79
  specification_version: 4
81
80
  summary: Dockerfile generator for Rails
data/lib/fly_replay.rb DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Fly
4
- class FlyReplay
5
- def initialize(app)
6
- @app = app
7
- end
8
-
9
- def call(env)
10
- # replay /prometheus/* to the prom proxy in bubblegum
11
- if env["PATH_INFO"].starts_with?("/prometheus")
12
- return [307, { "Fly-Replay" => "app=flyio-bubblegum-api" }, []]
13
- end
14
-
15
- # replay /debug to the debug app. unsure if this is actually used
16
- if env["PATH_INFO"].starts_with?("/debug")
17
- return [307, { "Fly-Replay" => "app=debug" }, []]
18
- end
19
-
20
- @status, @headers, @response = @app.call(env)
21
-
22
- context = OpenTelemetry::Trace.current_span.context
23
- @headers["fly-trace-id"] = context.trace_id.unpack1("H*")
24
- @headers["fly-span-id"] = context.span_id.unpack1("H*")
25
-
26
- [@status, @headers, @response]
27
- end
28
- end
29
- end