Skip to content

Commit

Permalink
Merge 19a6a07 into ec21922
Browse files Browse the repository at this point in the history
  • Loading branch information
bwillis committed Mar 11, 2020
2 parents ec21922 + 19a6a07 commit db72911
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 11 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ rvm:

gemfile:
- gemfiles/rails5.0.gemfile
- gemfiles/rails5.2.gemfile
- gemfiles/rails5.2.gemfile
- gemfiles/rails6.0.gemfile

matrix:
exclude:
- rvm: 2.3.3
gemfile: gemfiles/rails6.0.gemfile
- rvm: 2.4.7
gemfile: gemfiles/rails6.0.gemfile
6 changes: 6 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ appraise "rails5.2" do
gem('activesupport', '~> 5.2.0')
gem('railties', '~> 5.2.0')
end

appraise "rails6.0" do
gem('actionpack', '~> 5.2.0')
gem('activesupport', '~> 5.2.0')
gem('railties', '~> 5.2.0')
end
9 changes: 9 additions & 0 deletions gemfiles/rails6.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "actionpack", "~> 5.2.0"
gem "activesupport", "~> 5.2.0"
gem "railties", "~> 5.2.0"

gemspec path: "../"
122 changes: 122 additions & 0 deletions gemfiles/rails6.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
PATH
remote: ..
specs:
versioncake (3.4.0)
actionpack (>= 5.0)
activesupport (>= 5.0)
railties (>= 5.0)
tzinfo

GEM
remote: https://rubygems.org/
specs:
actionpack (5.2.4.1)
actionview (= 5.2.4.1)
activesupport (= 5.2.4.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.4.1)
activesupport (= 5.2.4.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activesupport (5.2.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
builder (3.2.4)
concurrent-ruby (1.1.6)
coveralls (0.8.21)
json (>= 1.8, < 3)
simplecov (~> 0.14.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
tins (~> 1.6)
crass (1.0.6)
diff-lcs (1.3)
docile (1.1.5)
erubi (1.9.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
json (2.2.0)
loofah (2.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (0.9.2)
mini_portile2 (2.4.0)
minitest (5.14.0)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.2.4.1)
actionpack (= 5.2.4.1)
activesupport (= 5.2.4.1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (13.0.1)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
simplecov (0.14.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
term-ansicolor (1.6.0)
tins (~> 1.0)
thor (0.19.4)
thread_safe (0.3.6)
tins (1.15.0)
tzinfo (1.2.6)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
actionpack (~> 5.2.0)
activesupport (~> 5.2.0)
appraisal
coveralls
railties (~> 5.2.0)
rake
rspec
rspec-rails
versioncake!

BUNDLED WITH
1.17.2
34 changes: 24 additions & 10 deletions lib/versioncake/view_additions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@
ActionView::LookupContext.register_detail(:versions){ [] }

ActionView::PathResolver.class_eval do
ActionView::PathResolver::EXTENSIONS.replace({
locale: ".",
formats: ".",
versions: ".",
variants: "+",
handlers: "."
})
def initialize(pattern = nil)
@pattern = pattern || ":prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:versions,}{.:handlers,}"
super()
if ActionPack::VERSION::MAJOR >= 6
ActionView::PathResolver::EXTENSIONS.replace({
locale: ".",
formats: ".",
versions: ".",
variants: "+",
handlers: "."
})
Kernel::silence_warnings {
ActionView::PathResolver::DEFAULT_PATTERN = ":prefix/:action{.:locale,}{.:formats,}{.:versions,}{+:variants,}{.:handlers,}"
}
elsif ActionPack::VERSION::MAJOR >= 4 && ActionPack::VERSION::MINOR >= 1 || ActionPack::VERSION::MAJOR >= 5
ActionView::PathResolver::EXTENSIONS.replace({
locale: ".",
formats: ".",
versions: ".",
variants: "+",
handlers: "."
})

def initialize(pattern = nil)
@pattern = pattern || ":prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:versions,}{.:handlers,}"
super()
end
end

# The default extract handler expects that the handler is the last extension and
Expand Down

0 comments on commit db72911

Please sign in to comment.