Skip to content

Commit 1934d55

Browse files
committed
Make sure future versions of ERB are invoked appropriately
Fix introduced in #594 misidentifies versions with more numerics. Version "2.11.0", for example, would be called using the deprecated API. Long live ERB.
1 parent 006832e commit 1934d55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/thor/actions/file_manipulation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def template(source, *args, &block)
117117
context = config.delete(:context) || instance_eval("binding")
118118

119119
create_file destination, nil, config do
120-
match = ERB.version.match(/(\d\.\d\.\d)/)
120+
match = ERB.version.match(/(\d+\.\d+\.\d+)/)
121121
capturable_erb = if match && match[1] >= "2.2.0" # Ruby 2.6+
122122
CapturableERB.new(::File.binread(source), :trim_mode => "-", :eoutvar => "@output_buffer")
123123
else

0 commit comments

Comments
 (0)