Skip to content

Commit

Permalink
Merge pull request #21 from tf/rails-6
Browse files Browse the repository at this point in the history
Rails 6 suppport
  • Loading branch information
tf authored Oct 2, 2023
2 parents 6ef2b3c + 88ac3fc commit ef5bd65
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
13 changes: 10 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in pageflow-vr.gemspec
gemspec

group :development, :test do
# Help Bundler resolve dependencies
gem 'rails', '~> 5.2.0'
if ENV['PAGEFLOW_DEPENDENCIES'] == 'experimental'
git 'https://github.com/codevise/pageflow', branch: 'edge', glob: '**/*.gemspec' do
gem 'pageflow'
gem 'pageflow-support'
end
else
group :development, :test do
# Help Bundler resolve dependencies
gem 'rails', '~> 5.2.0'
end
end
1 change: 1 addition & 0 deletions lib/pageflow-vr.rb → lib/pageflow/vr.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pageflow/vr/engine'
require 'pageflow/vr/version'

module Pageflow
module Vr
Expand Down
17 changes: 16 additions & 1 deletion lib/pageflow/vr/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ module Vr
class Engine < Rails::Engine
isolate_namespace Pageflow::Vr

config.autoload_paths << File.join(config.root, 'lib')
if Rails.respond_to?(:autoloaders)
lib = root.join('lib')

config.autoload_paths << lib
config.eager_load_paths << lib

initializer 'pageflow_vr.autoloading' do
Rails.autoloaders.main.ignore(
lib.join('pageflow/vr/version.rb'),
lib.join('generators')
)
end
else
config.autoload_paths << File.join(config.root, 'lib')
end

config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]

initializer "pageflow-vr.add_watchable_files", group: :all do |app|
Expand Down
10 changes: 8 additions & 2 deletions pageflow-vr.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.require_paths = ['lib']

spec.required_ruby_version = '~> 2.1'
spec.required_ruby_version = '>= 2.1'

spec.add_dependency 'pageflow', ['>= 12.0', '< 17']
spec.add_dependency 'pageflow-public-i18n', '~> 1.10'

spec.add_development_dependency 'bundler', ['>= 1.12', '< 3']
spec.add_development_dependency 'pageflow-support', ['>= 14', '< 17']
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec-rails', '~> 3.0'

if ENV['PAGEFLOW_DEPENDENCIES'] == 'experimental'
spec.add_development_dependency 'rspec-rails', '~> 6.0'
else
spec.add_development_dependency 'rspec-rails', '~> 3.0'
end

spec.add_development_dependency 'semmy', '~> 1.0'
end

0 comments on commit ef5bd65

Please sign in to comment.