Skip to content

Commit

Permalink
Merge pull request #34 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 7385bc6 + d115f5d commit ca40eec
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
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

# Help bundler not exceed time limit
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
# Help bundler not exceed time limit
gem 'rails', '~> 5.2.0'
end
1 change: 1 addition & 0 deletions lib/pageflow-text-page.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pageflow/text_page/engine'
require 'pageflow/text_page/version'

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

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_text_page.autoloading' do
Rails.autoloaders.main.ignore(
lib.join('pageflow-text-page.rb'),
lib.join('pageflow/text_page/version.rb')
)
end
else
config.autoload_paths << File.join(config.root, 'lib')
end

config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]
end
end
Expand Down
9 changes: 7 additions & 2 deletions pageflow-text-page.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_runtime_dependency 'pageflow', ['>= 15', '< 17']
spec.add_runtime_dependency 'pageflow-public-i18n', '~> 1.0'

spec.add_development_dependency 'bundler', ['>= 1.0', '< 3']
spec.add_development_dependency 'pageflow-support', ['>= 15', '< 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

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

0 comments on commit ca40eec

Please sign in to comment.