Skip to content

Commit

Permalink
Workaround for Ruby 2.1-2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Feb 9, 2023
1 parent f3e6538 commit e7713ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/thor/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def apply(path, config = {})

contents = if is_uri
require "open-uri"
URI.open(path, "Accept" => "application/x-thor-template", &:read)
# for ruby 2.1-2.4
URI.send(:open, path, "Accept" => "application/x-thor-template", &:read)
else
File.open(path, &:read)
end
Expand Down

0 comments on commit e7713ad

Please sign in to comment.