Skip to content

Commit 32d9911

Browse files
committed
Re-enable support for Ruby 2.7
We should make one release which claims to support Ruby 2.7 and also actually supports Ruby 2.7 so that Gemfiles on older Rubies can pick up a working version. After release I will revert this commit so that we can move forward on 3.1+.
1 parent 022433e commit 32d9911

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/helpers/importmap/importmap_tags_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Importmap::ImportmapTagsHelper
33
def javascript_importmap_tags(entry_point = "application", importmap: Rails.application.importmap)
44
safe_join [
55
javascript_inline_importmap_tag(importmap.to_json(resolver: self)),
6-
javascript_importmap_module_preload_tags(importmap, entry_point:),
6+
javascript_importmap_module_preload_tags(importmap, entry_point: entry_point),
77
javascript_import_module_tag(entry_point)
88
], "\n"
99
end
@@ -25,7 +25,7 @@ def javascript_import_module_tag(*module_names)
2525
# (defaults to Rails.application.importmap), such that they'll be fetched
2626
# in advance by browsers supporting this link type (https://caniuse.com/?search=modulepreload).
2727
def javascript_importmap_module_preload_tags(importmap = Rails.application.importmap, entry_point: "application")
28-
javascript_module_preload_tag(*importmap.preloaded_module_paths(resolver: self, entry_point:, cache_key: entry_point))
28+
javascript_module_preload_tag(*importmap.preloaded_module_paths(resolver: self, entry_point: entry_point, cache_key: entry_point))
2929
end
3030

3131
# Link tag(s) for preloading the JavaScript module residing in `*paths`. Will return one link tag per path element.

importmap-rails.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
1414

1515
spec.files = Dir["{app,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
1616

17-
spec.required_ruby_version = ">= 3.1.0"
17+
spec.required_ruby_version = ">= 2.7.0"
1818
spec.add_dependency "railties", ">= 6.0.0"
1919
spec.add_dependency "activesupport", ">= 6.0.0"
2020
spec.add_dependency "actionpack", ">= 6.0.0"

lib/importmap/map.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def pin_all_from(dir, under: nil, to: nil, preload: true)
4242
# the different cases.
4343
def preloaded_module_paths(resolver:, entry_point: "application", cache_key: :preloaded_module_paths)
4444
cache_as(cache_key) do
45-
resolve_asset_paths(expanded_preloading_packages_and_directories(entry_point:), resolver:).values
45+
resolve_asset_paths(expanded_preloading_packages_and_directories(entry_point: entry_point), resolver: resolver).values
4646
end
4747
end
4848

0 commit comments

Comments
 (0)