Skip to content

Commit

Permalink
Merge pull request #77 from tf/rails-6
Browse files Browse the repository at this point in the history
Rails 6 support
  • Loading branch information
tf authored Oct 2, 2023
2 parents d7177e0 + 09aeebd commit 7d0aba7
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
11 changes: 10 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ gemspec
gem 'spring-commands-rspec', group: :development
gem 'spring-commands-teaspoon', group: :development

gem 'rails', '5.2.6'
if ENV['PAGEFLOW_DEPENDENCIES'] == 'experimental'
git 'https://github.com/codevise/pageflow', branch: 'edge', glob: '**/*.gemspec' do
gem 'pageflow'
gem 'pageflow-support'
end

gem 'pageflow-external-links', git: 'https://github.com/codevise/pageflow-external-links'
else
gem 'rails', '5.2.6'
end
2 changes: 1 addition & 1 deletion bin/rspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV['RAILS_ENV'] ||= 'test'
dummy_root = File.expand_path("../spec/dummy/rails-4.1.9", File.dirname(__FILE__))

begin
load File.expand_path("../spring", __FILE__) if File.exists?(dummy_root)
load File.expand_path("../spring", __FILE__) if File.exist?(dummy_root)
rescue LoadError
end
require 'bundler/setup'
Expand Down
1 change: 1 addition & 0 deletions lib/pageflow-linkmap-page.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pageflow/linkmap_page/engine'
require 'pageflow/linkmap_page/version'

module Pageflow
module LinkmapPage
Expand Down
25 changes: 24 additions & 1 deletion lib/pageflow/linkmap_page/engine.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
require 'pageflow-external-links'
require 'paperclip'

require 'pageflow/linkmap_page/paperclip_processors/colors'
require 'pageflow/linkmap_page/paperclip_processors/color_mask'
require 'pageflow/linkmap_page/paperclip_processors/invoke_callback'
require 'pageflow/linkmap_page/paperclip_processors/image_dimensions'

module Pageflow
module LinkmapPage
class Engine < Rails::Engine
isolate_namespace Pageflow::LinkmapPage

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

initializer 'pageflow_linkmap_page.paperclip' do
Paperclip.configure do |config|
config.register_processor(:pageflow_linkmap_page_image_colors,
Expand Down
9 changes: 7 additions & 2 deletions pageflow-linkmap-page.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ 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.7', '< 17']
spec.add_runtime_dependency 'pageflow-external-links', '~> 2.x'

spec.add_development_dependency 'bundler', ['>= 1.0', '< 3']
spec.add_development_dependency 'pageflow-support', ['>= 15.0', '< 17']
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec-rails', '~> 3.7'
spec.add_development_dependency 'factory_bot_rails', '~> 4.8'
spec.add_development_dependency 'sqlite3', '~> 1.3'

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

# Browser like integration testing
spec.add_development_dependency 'capybara', '~> 2.13'

Expand Down

0 comments on commit 7d0aba7

Please sign in to comment.