diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aaa09d..866e7b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,6 @@ jobs: fail-fast: false matrix: ruby: - - '2.7' - - '3.0' - '3.1' - '3.2' - '3.3' @@ -21,10 +19,6 @@ jobs: - rails6.1 - rails7.0 - rails7.1 - include: - - {ruby: '2.7', gemfile: rails5.1} - - {ruby: '2.7', gemfile: rails5.2} - - {ruby: '2.7', gemfile: rails6.0} steps: - uses: zendesk/checkout@v4 - uses: zendesk/setup-ruby@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fcbe63..68f3ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Unreleased +* Drop support for Ruby < 3.1. +* Drop support for Rails < 6.1. + ### Curly 3.3.0 (November 13, 2023) * Add support for Rails 7.1 diff --git a/Gemfile b/Gemfile index ad2091c..3dc5fe5 100644 --- a/Gemfile +++ b/Gemfile @@ -1 +1 @@ -eval_gemfile 'gemfiles/rails5.2.gemfile' +eval_gemfile 'gemfiles/rails6.1.gemfile' diff --git a/curly-templates.gemspec b/curly-templates.gemspec index 5255c58..5bed5e4 100644 --- a/curly-templates.gemspec +++ b/curly-templates.gemspec @@ -1,10 +1,6 @@ require './lib/curly/version' Gem::Specification.new do |s| - s.specification_version = 2 if s.respond_to? :specification_version= - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.rubygems_version = '1.3.5' - s.name = 'curly-templates' s.version = Curly::VERSION @@ -20,7 +16,9 @@ Gem::Specification.new do |s| s.rdoc_options = ["--charset=UTF-8"] - s.add_dependency("actionpack", [">= 5.1", "< 7.2"]) + s.required_ruby_version = ">= 3.1" + + s.add_dependency("actionpack", [">= 6.1", "< 7.2"]) s.add_dependency("sorted_set") s.add_development_dependency("railties", [">= 5.1", "< 7.2"]) diff --git a/gemfiles/rails5.1.gemfile b/gemfiles/rails5.1.gemfile deleted file mode 100644 index 9210f51..0000000 --- a/gemfiles/rails5.1.gemfile +++ /dev/null @@ -1,4 +0,0 @@ -eval_gemfile 'common.rb' - -gem 'rails', '~> 5.1.0' -gem 'genspec', '>= 0.3.0' diff --git a/gemfiles/rails5.1.gemfile.lock b/gemfiles/rails5.1.gemfile.lock deleted file mode 100644 index 366dfd0..0000000 --- a/gemfiles/rails5.1.gemfile.lock +++ /dev/null @@ -1,187 +0,0 @@ -PATH - remote: .. - specs: - curly-templates (3.3.0) - actionpack (>= 5.1, < 7.2) - sorted_set - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.1.7) - actionpack (= 5.1.7) - nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.7) - actionpack (= 5.1.7) - actionview (= 5.1.7) - activejob (= 5.1.7) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.1.7) - actionview (= 5.1.7) - activesupport (= 5.1.7) - rack (~> 2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.7) - activesupport (= 5.1.7) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.7) - activesupport (= 5.1.7) - globalid (>= 0.3.6) - activemodel (5.1.7) - activesupport (= 5.1.7) - activerecord (5.1.7) - activemodel (= 5.1.7) - activesupport (= 5.1.7) - arel (~> 8.0) - activesupport (5.1.7) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (8.0.0) - benchmark-ips (2.12.0) - builder (3.2.4) - concurrent-ruby (1.2.2) - crass (1.0.6) - date (3.3.4) - diff-lcs (1.5.0) - erubi (1.12.0) - genspec (0.3.2) - rspec (>= 2, < 4) - thor - github-markup (4.0.2) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - loofah (2.21.4) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - mail (2.8.1) - mini_mime (>= 0.1.1) - net-imap - net-pop - net-smtp - method_source (1.0.0) - mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.20.0) - net-imap (0.4.5) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.4.0) - net-protocol - nio4r (2.5.9) - nokogiri (1.15.4) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - racc (1.7.3) - rack (2.2.8) - rack-test (2.1.0) - rack (>= 1.3) - rails (5.1.7) - actioncable (= 5.1.7) - actionmailer (= 5.1.7) - actionpack (= 5.1.7) - actionview (= 5.1.7) - activejob (= 5.1.7) - activemodel (= 5.1.7) - activerecord (= 5.1.7) - activesupport (= 5.1.7) - bundler (>= 1.3.0) - railties (= 5.1.7) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.2.0) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (5.1.7) - actionpack (= 5.1.7) - activesupport (= 5.1.7) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (13.1.0) - rbtree (0.4.6) - redcarpet (3.6.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (4.1.2) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.1) - set (1.0.3) - sorted_set (1.0.3) - rbtree - set (~> 1.0) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - stackprof (0.2.25) - thor (1.3.0) - thread_safe (0.3.6) - timeout (0.4.1) - tomparse (0.4.2) - tzinfo (1.2.11) - thread_safe (~> 0.1) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - yard (0.9.34) - yard-tomdoc (0.7.1) - tomparse (>= 0.4.0) - yard - -PLATFORMS - ruby - -DEPENDENCIES - benchmark-ips - curly-templates! - genspec (>= 0.3.0) - github-markup - rails (~> 5.1.0) - railties (>= 5.1, < 7.2) - rake - redcarpet - rspec (>= 3) - rspec-rails - stackprof - yard - yard-tomdoc - -BUNDLED WITH - 2.4.17 diff --git a/gemfiles/rails5.2.gemfile b/gemfiles/rails5.2.gemfile deleted file mode 100644 index 535b837..0000000 --- a/gemfiles/rails5.2.gemfile +++ /dev/null @@ -1,4 +0,0 @@ -eval_gemfile 'common.rb' - -gem 'rails', '~> 5.2.0' -gem 'genspec', '>= 0.3.0' diff --git a/gemfiles/rails5.2.gemfile.lock b/gemfiles/rails5.2.gemfile.lock deleted file mode 100644 index d904004..0000000 --- a/gemfiles/rails5.2.gemfile.lock +++ /dev/null @@ -1,193 +0,0 @@ -PATH - remote: .. - specs: - curly-templates (3.3.0) - actionpack (>= 5.1, < 7.2) - sorted_set - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.2.8.1) - actionpack (= 5.2.8.1) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailer (5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.8.1) - actionview (= 5.2.8.1) - activesupport (= 5.2.8.1) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8.1) - activesupport (= 5.2.8.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.8.1) - activesupport (= 5.2.8.1) - globalid (>= 0.3.6) - activemodel (5.2.8.1) - activesupport (= 5.2.8.1) - activerecord (5.2.8.1) - activemodel (= 5.2.8.1) - activesupport (= 5.2.8.1) - arel (>= 9.0) - activestorage (5.2.8.1) - actionpack (= 5.2.8.1) - activerecord (= 5.2.8.1) - marcel (~> 1.0.0) - activesupport (5.2.8.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) - benchmark-ips (2.12.0) - builder (3.2.4) - concurrent-ruby (1.2.2) - crass (1.0.6) - date (3.3.4) - diff-lcs (1.5.0) - erubi (1.12.0) - genspec (0.3.2) - rspec (>= 2, < 4) - thor - github-markup (4.0.2) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - loofah (2.21.4) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - mail (2.8.1) - mini_mime (>= 0.1.1) - net-imap - net-pop - net-smtp - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.20.0) - net-imap (0.4.5) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.4.0) - net-protocol - nio4r (2.5.9) - nokogiri (1.15.4) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - racc (1.7.3) - rack (2.2.8) - rack-test (2.1.0) - rack (>= 1.3) - rails (5.2.8.1) - actioncable (= 5.2.8.1) - actionmailer (= 5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - activemodel (= 5.2.8.1) - activerecord (= 5.2.8.1) - activestorage (= 5.2.8.1) - activesupport (= 5.2.8.1) - bundler (>= 1.3.0) - railties (= 5.2.8.1) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.2.0) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (5.2.8.1) - actionpack (= 5.2.8.1) - activesupport (= 5.2.8.1) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (13.1.0) - rbtree (0.4.6) - redcarpet (3.6.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.1) - set (1.0.3) - sorted_set (1.0.3) - rbtree - set (~> 1.0) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - stackprof (0.2.25) - thor (1.3.0) - thread_safe (0.3.6) - timeout (0.4.1) - tomparse (0.4.2) - tzinfo (1.2.11) - thread_safe (~> 0.1) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - yard (0.9.34) - yard-tomdoc (0.7.1) - tomparse (>= 0.4.0) - yard - -PLATFORMS - ruby - -DEPENDENCIES - benchmark-ips - curly-templates! - genspec (>= 0.3.0) - github-markup - rails (~> 5.2.0) - railties (>= 5.1, < 7.2) - rake - redcarpet - rspec (>= 3) - rspec-rails - stackprof - yard - yard-tomdoc - -BUNDLED WITH - 2.4.17 diff --git a/gemfiles/rails6.0.gemfile b/gemfiles/rails6.0.gemfile deleted file mode 100644 index 718411b..0000000 --- a/gemfiles/rails6.0.gemfile +++ /dev/null @@ -1,4 +0,0 @@ -eval_gemfile 'common.rb' - -gem 'rails', '~> 6.0.0' -gem 'genspec', github: 'zendesk/genspec', branch: 'rails-7' diff --git a/gemfiles/rails6.0.gemfile.lock b/gemfiles/rails6.0.gemfile.lock deleted file mode 100644 index cf7fe81..0000000 --- a/gemfiles/rails6.0.gemfile.lock +++ /dev/null @@ -1,215 +0,0 @@ -GIT - remote: https://github.com/zendesk/genspec.git - revision: 76116991caf40ef940076f702f70a141ced84ce2 - branch: rails-7 - specs: - genspec (0.3.2) - rspec (>= 2, < 4) - thor - -PATH - remote: .. - specs: - curly-templates (3.3.0) - actionpack (>= 5.1, < 7.2) - sorted_set - -GEM - remote: https://rubygems.org/ - specs: - actioncable (6.0.6.1) - actionpack (= 6.0.6.1) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (6.0.6.1) - actionpack (= 6.0.6.1) - activejob (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) - mail (>= 2.7.1) - actionmailer (6.0.6.1) - actionpack (= 6.0.6.1) - actionview (= 6.0.6.1) - activejob (= 6.0.6.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.0.6.1) - actionview (= 6.0.6.1) - activesupport (= 6.0.6.1) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.6.1) - actionpack (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) - nokogiri (>= 1.8.5) - actionview (6.0.6.1) - activesupport (= 6.0.6.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.6.1) - activesupport (= 6.0.6.1) - globalid (>= 0.3.6) - activemodel (6.0.6.1) - activesupport (= 6.0.6.1) - activerecord (6.0.6.1) - activemodel (= 6.0.6.1) - activesupport (= 6.0.6.1) - activestorage (6.0.6.1) - actionpack (= 6.0.6.1) - activejob (= 6.0.6.1) - activerecord (= 6.0.6.1) - marcel (~> 1.0) - activesupport (6.0.6.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) - benchmark-ips (2.12.0) - builder (3.2.4) - concurrent-ruby (1.2.2) - crass (1.0.6) - date (3.3.4) - diff-lcs (1.5.0) - erubi (1.12.0) - github-markup (4.0.2) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - loofah (2.21.4) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - mail (2.8.1) - mini_mime (>= 0.1.1) - net-imap - net-pop - net-smtp - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.20.0) - net-imap (0.4.5) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.4.0) - net-protocol - nio4r (2.5.9) - nokogiri (1.15.4) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - racc (1.7.3) - rack (2.2.8) - rack-test (2.1.0) - rack (>= 1.3) - rails (6.0.6.1) - actioncable (= 6.0.6.1) - actionmailbox (= 6.0.6.1) - actionmailer (= 6.0.6.1) - actionpack (= 6.0.6.1) - actiontext (= 6.0.6.1) - actionview (= 6.0.6.1) - activejob (= 6.0.6.1) - activemodel (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) - bundler (>= 1.3.0) - railties (= 6.0.6.1) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.2.0) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (6.0.6.1) - actionpack (= 6.0.6.1) - activesupport (= 6.0.6.1) - method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) - rake (13.1.0) - rbtree (0.4.6) - redcarpet (3.6.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.1) - set (1.0.3) - sorted_set (1.0.3) - rbtree - set (~> 1.0) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - stackprof (0.2.25) - thor (1.3.0) - thread_safe (0.3.6) - timeout (0.4.1) - tomparse (0.4.2) - tzinfo (1.2.11) - thread_safe (~> 0.1) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - yard (0.9.34) - yard-tomdoc (0.7.1) - tomparse (>= 0.4.0) - yard - zeitwerk (2.6.12) - -PLATFORMS - ruby - -DEPENDENCIES - benchmark-ips - curly-templates! - genspec! - github-markup - rails (~> 6.0.0) - railties (>= 5.1, < 7.2) - rake - redcarpet - rspec (>= 3) - rspec-rails - stackprof - yard - yard-tomdoc - -BUNDLED WITH - 2.4.17 diff --git a/gemfiles/rails6.1.gemfile.lock b/gemfiles/rails6.1.gemfile.lock index 780e8e8..6d43e7e 100644 --- a/gemfiles/rails6.1.gemfile.lock +++ b/gemfiles/rails6.1.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: curly-templates (3.3.0) - actionpack (>= 5.1, < 7.2) + actionpack (>= 6.1, < 7.2) sorted_set GEM diff --git a/gemfiles/rails7.0.gemfile.lock b/gemfiles/rails7.0.gemfile.lock index 96d12e2..f25ab88 100644 --- a/gemfiles/rails7.0.gemfile.lock +++ b/gemfiles/rails7.0.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: curly-templates (3.3.0) - actionpack (>= 5.1, < 7.2) + actionpack (>= 6.1, < 7.2) sorted_set GEM diff --git a/gemfiles/rails7.1.gemfile.lock b/gemfiles/rails7.1.gemfile.lock index 58bccff..7f5bc4d 100644 --- a/gemfiles/rails7.1.gemfile.lock +++ b/gemfiles/rails7.1.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: curly-templates (3.3.0) - actionpack (>= 5.1, < 7.2) + actionpack (>= 6.1, < 7.2) sorted_set GEM @@ -100,8 +100,7 @@ GEM crass (1.0.6) date (3.3.4) diff-lcs (1.5.0) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) erubi (1.12.0) github-markup (4.0.2) globalid (1.2.1) @@ -206,7 +205,6 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - ruby2_keywords (0.0.5) set (1.0.3) sorted_set (1.0.3) rbtree diff --git a/lib/curly/template_handler.rb b/lib/curly/template_handler.rb index 492f375..fd7d151 100644 --- a/lib/curly/template_handler.rb +++ b/lib/curly/template_handler.rb @@ -13,17 +13,9 @@ class << self # template - The ActionView::Template template that should be compiled. # # Returns a String containing the Ruby code representing the template. - if ActionView::VERSION::MAJOR < 6 - def call(template) - instrument(template) do - compile_for_actionview5(template) - end - end - else - def call(template, source) - instrument(template) do - compile(template, source) - end + def call(template, source) + instrument(template) do + compile(template, source) end end diff --git a/spec/integration/context_blocks_spec.rb b/spec/integration/context_blocks_spec.rb index 1e401eb..b867c30 100644 --- a/spec/integration/context_blocks_spec.rb +++ b/spec/integration/context_blocks_spec.rb @@ -4,49 +4,24 @@ example "A context block" do get '/new' - case "#{ActionPack::VERSION::MAJOR}.#{ActionPack::VERSION::MINOR}" - when '6.1', '7.0', '7.1' - expect(response.body).to have_structure <<-HTML.strip_heredoc - -
-Thank you!
- - - HTML - when '4.2', '5.1', '5.2', '6.0' - expect(response.body).to have_structure <<-HTML.strip_heredoc - - -Thank you!
- - - HTML - else - raise "curly-templates does not support Rails #{ActionPack::VERSION::MAJOR}.#{ActionPack::VERSION::MINOR}" - end +Thank you!
+ + + HTML end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7ba4c1e..26bf8b9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -34,12 +34,8 @@ def render(source, options = {}, &block) handler = Curly::TemplateHandler template = ActionView::Template.new(source, identifier, handler, **details) - view = if ActionView::VERSION::MAJOR < 6 - ActionView::Base.new - else - lookup_context = ActionView::LookupContext.new([]) - ActionView::Base.with_empty_template_cache.new(lookup_context, {}, nil) - end + lookup_context = ActionView::LookupContext.new([]) + view = ActionView::Base.with_empty_template_cache.new(lookup_context, {}, nil) begin template.render(view, locals, &block) diff --git a/spec/template_handler_spec.rb b/spec/template_handler_spec.rb index 2efe13b..e3a1c46 100644 --- a/spec/template_handler_spec.rb +++ b/spec/template_handler_spec.rb @@ -202,12 +202,7 @@ def safe_concat(str) end def render(source) - if ActionView::VERSION::MAJOR < 6 - allow(template).to receive(:source).and_return(source) - code = Curly::TemplateHandler.call(template) - else - code = Curly::TemplateHandler.call(template, source) - end + code = Curly::TemplateHandler.call(template, source) context.reset! context.instance_eval(code)