File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,9 @@ def ruby(*ruby_version)
4242 # Loads the file relative to the dirname of the Gemfile itself.
4343 def normalize_ruby_file ( filename )
4444 file_content = Bundler . read_file ( gemfile . dirname . join ( filename ) )
45- # match "ruby-3.2.2" or "ruby 3.2.2" capturing version string up to the first space or comment
46- if /^ruby(-| \s +) ([^\s #]+)/ . match ( file_content )
47- $2
45+ # match "ruby-3.2.2", ruby = "3.2.2" or "ruby 3.2.2" capturing version string up to the first space or comment
46+ if /^ruby[ \s -]*(?:= \s *)?"? ([^\s #" ]+)"? / . match ( file_content )
47+ $1
4848 else
4949 file_content . strip
5050 end
Original file line number Diff line number Diff line change @@ -172,6 +172,19 @@ class MockDSL
172172 end
173173 end
174174
175+ context "with a mise.toml file format" do
176+ let ( :file ) { "mise.toml" }
177+ let ( :ruby_version_arg ) { nil }
178+ let ( :file_content ) do
179+ <<~TOML
180+ [tools]
181+ ruby = "#{ version } "
182+ TOML
183+ end
184+
185+ it_behaves_like "it stores the ruby version"
186+ end
187+
175188 context "with a .tool-versions file format" do
176189 let ( :file ) { ".tool-versions" }
177190 let ( :ruby_version_arg ) { nil }
You can’t perform that action at this time.
0 commit comments