diff --git a/Gemfile b/Gemfile index cb6a04e..8d1d891 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/lib/pageflow-vr.rb b/lib/pageflow/vr.rb similarity index 95% rename from lib/pageflow-vr.rb rename to lib/pageflow/vr.rb index 80989fd..68c07cd 100644 --- a/lib/pageflow-vr.rb +++ b/lib/pageflow/vr.rb @@ -1,4 +1,5 @@ require 'pageflow/vr/engine' +require 'pageflow/vr/version' module Pageflow module Vr diff --git a/lib/pageflow/vr/engine.rb b/lib/pageflow/vr/engine.rb index c3b7473..c722325 100644 --- a/lib/pageflow/vr/engine.rb +++ b/lib/pageflow/vr/engine.rb @@ -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| diff --git a/pageflow-vr.gemspec b/pageflow-vr.gemspec index 44abbc4..14b4858 100644 --- a/pageflow-vr.gemspec +++ b/pageflow-vr.gemspec @@ -15,7 +15,7 @@ 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' @@ -23,6 +23,12 @@ Gem::Specification.new do |spec| 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