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

Support Rails 7.1+ #39

Merged
merged 8 commits into from
May 17, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
bundler_version: [2.1.1]
bundler_version: [2.2.8]
faraday_version: ['~> 2.0']
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 3.3.1
- name: Install bundler
run: gem install bundler -v ${{ matrix.bundler_version }}
- name: Install dependencies
Expand All @@ -33,9 +33,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: ["3.2"]
rails_version: [7.0.4.2, 6.1.7.2]
bundler_version: [2.1.1]
ruby_version: [3.3.1]
rails_version: [7.1.3.2, 7.0.8.1]
bundler_version: [2.2.8]
faraday_version: ['~> 2.0']

name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / faraday ${{ matrix.faraday_version }}
Expand Down
10 changes: 5 additions & 5 deletions geoblacklight_sidecar_images.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ Gem::Specification.new do |s|
s.add_dependency "image_processing", "~> 1.6"
s.add_dependency "mimemagic", "~> 0.3"
s.add_dependency "mini_magick", "~> 4.9.4"
s.add_dependency "rails", ">= 5.2", "< 7.1"
s.add_dependency "rails", ">= 5.2", "< 8.0"
s.add_dependency "statesman", ">= 3.4"

s.add_development_dependency "byebug"
s.add_development_dependency "capybara"
s.add_development_dependency "webdrivers"
s.add_development_dependency "database_cleaner", "~> 1.3"
s.add_development_dependency "engine_cart", "~> 2.2"
s.add_development_dependency "rspec-rails", "~> 3.0"
s.add_development_dependency "database_cleaner", "~> 2.0"
s.add_development_dependency "engine_cart", "~> 2.0"
s.add_development_dependency "rspec-rails", "~> 6.0"
s.add_development_dependency "selenium-webdriver"
s.add_development_dependency "simplecov", "~> 0.22"
s.add_development_dependency "solr_wrapper", "~> 4.0"
s.add_development_dependency "sprockets", "< 4"
s.add_development_dependency "standard", "~> 1.24"
s.add_development_dependency "standard", "~> 1.0"
end
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ConfigGenerator < Rails::Generators::Base
DESCRIPTION

def set_active_storage_processor
app_config = <<-"APP"
app_config = <<-APP

config.active_storage.variant_processor = :mini_magick
APP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class JobsGenerator < Rails::Generators::Base
DESCRIPTION

def config_development_jobs_queue_adapter
job_config = <<-"JOBS"
job_config = <<-JOBS
config.active_job.queue_adapter = :inline
JOBS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def copy_migrations
end

def include_sidecar_solrdocument
sidecar = <<-"SIDECAR"
sidecar = <<-SIDECAR
def sidecar
# Find or create, and set version
sidecar = SolrDocumentSidecar.where(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def container_classes
#
# @param [Hash] options
# @return [String]
def render_nav_actions(options = {}, &block)
render_filtered_partials(blacklight_config.navbar.partials, options, &block)
def render_nav_actions(options = {}, &)
render_filtered_partials(blacklight_config.navbar.partials, options, &)
end

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class='col-2 thumbnail'>
<% if document.sidecar.image.attached? %>
<% if document.sidecar.image.variable? %>
<%= image_tag document.sidecar.image.variant(resize: "200") %>
<%= image_tag document.sidecar.image.variant(resize_to_fit: [200, 200]) %>
<% else %>
<%= image_tag document.sidecar.image %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion spec/jobs/store_image_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rails_helper"
require "spec_helper"

describe GeoblacklightSidecarImages::StoreImageJob, type: :job do
let(:document) { SolrDocument.new(document_attributes) }
Expand Down
1 change: 0 additions & 1 deletion spec/lib/tasks/geoblacklight_sidecar_images_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "rails_helper"
require "spec_helper"
require "rake"

Expand Down
2 changes: 1 addition & 1 deletion spec/models/solr_document_sidecar_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rails_helper"
require "spec_helper"

describe SolrDocumentSidecar do
let(:document) { SolrDocument.new(document_attributes) }
Expand Down
2 changes: 1 addition & 1 deletion spec/models/solr_document_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rails_helper"
require "spec_helper"

describe Geoblacklight::SolrDocument do
let(:document) { SolrDocument.new(document_attributes) }
Expand Down
59 changes: 0 additions & 59 deletions spec/rails_helper.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/services/image_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rails_helper"
require "spec_helper"

describe GeoblacklightSidecarImages::ImageService do
# Dynamic Map Layer
Expand Down
33 changes: 23 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
# frozen_string_literal: true

ENV["RAILS_ENV"] = "test"
ENV["RAILS_ENV"] ||= "test"

require "simplecov"
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
# require "simplecov"
# SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter

SimpleCov.start "rails" do
# @TODO
# refuse_coverage_drop
end
# SimpleCov.start "rails" do
# @TODO
# refuse_coverage_drop
# end

require "database_cleaner"
require "capybara/rspec"
require "selenium-webdriver"
require "webdrivers"

require "rails/all"
require "blacklight"
require "geoblacklight"
require "geoblacklight_sidecar_images"

require "engine_cart"
EngineCart.load_application!

require "rspec/rails"
require "capybara/rspec"
require "selenium-webdriver"
require "webdrivers"

def json_data(filename)
file_content = file_fixture("#{filename}.json").read
JSON.parse(file_content, symbolize_names: true)
end

RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"

config.use_transactional_fixtures = false

config.before do
Expand All @@ -36,3 +45,7 @@ def json_data(filename)
DatabaseCleaner.clean
end
end

def main_app
Rails.application.class.routes.url_helpers
end
3 changes: 2 additions & 1 deletion spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gem 'faraday', ENV["FARADAY_VERSION"].to_s != "" ? ENV["FARADAY_VERSION"] : '>= 1.0'
gem 'faraday', ENV["FARADAY_VERSION"].to_s != "" ? ENV["FARADAY_VERSION"] : '>= 1.0'
gem 'devise'
Loading