-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove support for Rails 5 Tech debt is too high. It's hard to know what's going on. Rails 5 is no longer listed under "Severe security issues" so it can safely be removed. * Add help command to README * Fix GitHub actions & update maildown in appraisals
- Loading branch information
Showing
15 changed files
with
53 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
if !defined?(ActionView::OptimizedFileSystemResolver) | ||
module ActionView | ||
# https://github.com/codetriage/maildown/issues/59 | ||
# | ||
# extract_handler_and_format_and_variant was removed in https://github.com/rails/rails/commit/2be8d3ebf85e26e936a7717b968737ee333d95bd | ||
# OptimizedFileSystemResolver was removed in https://github.com/rails/rails/commit/faac734387124c6d780dbfcfdab721b2f26ce865 | ||
class OptimizedFileSystemResolver < FileSystemResolver | ||
def extract_handler_and_format_and_variant(template) | ||
details = @path_parser.parse(template) | ||
[details.handler, details.format, details.variant] | ||
end | ||
end | ||
end | ||
end | ||
|
||
# This monkeypatch allows the use of `.md.erb` file extensions | ||
# in addition to `.md+erb` and `.md` | ||
module ActionView | ||
class OptimizedFileSystemResolver | ||
alias :original_extract_handler_and_format_and_variant :extract_handler_and_format_and_variant | ||
# | ||
# The calls to `ActionView::Template.register_template_handler` | ||
# prior to Rails 7 will only consider the last extension in a file | ||
# so if a file is labeled `foo.md.erb` the it will be treated as a | ||
# `.erb` file. This hack internally converts `.md.erb` files to | ||
# `.md+erb` which older versions of Rails will recognize. | ||
if defined?(ActionView::OptimizedFileSystemResolver) | ||
module ActionView | ||
class OptimizedFileSystemResolver | ||
alias :original_extract_handler_and_format_and_variant :extract_handler_and_format_and_variant | ||
|
||
# Different versions of rails have different | ||
# method signatures here, path is always first | ||
def extract_handler_and_format_and_variant(*args) | ||
if args.first.end_with?('md.erb') | ||
path = args.shift | ||
path = path.gsub(/\.md\.erb\z/, '.md+erb') | ||
args.unshift(path) | ||
# Different versions of rails have different | ||
# method signatures here, path is always first | ||
def extract_handler_and_format_and_variant(*args) | ||
if args.first.end_with?('md.erb') | ||
path = args.shift | ||
path = path.gsub(/\.md\.erb\z/, '.md+erb') | ||
args.unshift(path) | ||
end | ||
return original_extract_handler_and_format_and_variant(*args) | ||
end | ||
return original_extract_handler_and_format_and_variant(*args) | ||
end | ||
end | ||
end |
Oops, something went wrong.