@@ -112,19 +112,25 @@ def initialize(options = {})
112112
113113 contents = @gemfile_lock_path . read ( mode : "rt" )
114114 bundled_with = contents . match ( BUNDLED_WITH_REGEX )
115+ dot_ruby_version_file = @gemfile_lock_path . join ( ".." ) . join ( ".ruby-version" )
115116 @report . capture (
116- "bundled_with" => bundled_with &.[]( "version" ) || "empty"
117+ "bundler.bundled_with" => bundled_with &.[]( "version" ) || "empty" ,
118+ # We use this bundler class to detect the Requested ruby version from the Gemfile.lock
119+ # Rails 8 stopped generating `RUBY VERSION` in the Gemfile.lock and started generating
120+ # a `.ruby-version` file. This will observe the formats to help guide implementation
121+ # decisions
122+ "ruby.dot_ruby_version" => dot_ruby_version_file . exist? ? dot_ruby_version_file . read &.strip : nil
117123 )
118124 @version = self . class . detect_bundler_version (
119125 contents : contents ,
120126 bundled_with : bundled_with
121127 )
122128 parts = @version . split ( "." )
123129 @report . capture (
124- "bundler_version_installed " => @version ,
125- "bundler_major " => parts &.shift ,
126- "bundler_minor " => parts &.shift ,
127- "bundler_patch " => parts &.shift
130+ "bundler.version_installed " => @version ,
131+ "bundler.major " => parts &.shift ,
132+ "bundler.minor " => parts &.shift ,
133+ "bundler.patch " => parts &.shift
128134 )
129135 @dir_name = "bundler-#{ @version } "
130136
0 commit comments