Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6 support #30

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in chart.gemspec
gemspec

# Speed up dependency resolution
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
# Speed up dependency resolution
gem 'rails', '~> 5.2.0'
end
1 change: 1 addition & 0 deletions lib/pageflow-before-after.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pageflow/before_after/engine'
require 'pageflow/before_after/version'

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

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

if Rails.respond_to?(:autoloaders)
lib = root.join('lib')

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

initializer 'pageflow_before_after.autoloading' do
Rails.autoloaders.main.ignore(
lib.join('pageflow-before-after.rb'),
lib.join('pageflow/before_after/version.rb')
)
end
else
config.autoload_paths << File.join(config.root, 'lib')
end
end
end
end
9 changes: 7 additions & 2 deletions pageflow-before-after.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

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

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

spec.add_dependency 'jquery-ui-rails', '~> 5.0'

spec.add_development_dependency 'pageflow-support', ['>= 14', '< 17']
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

# Semantic versioning rake tasks
spec.add_development_dependency 'semmy', '~> 1.0'
Expand Down
Loading