Skip to content

Commit

Permalink
Merge pull request #119 from jrafanie/allow_rails_7
Browse files Browse the repository at this point in the history
Allow rails 7 gems in gemspec
  • Loading branch information
agrare committed Jan 16, 2024
2 parents 137ba56 + be68fe7 commit b7ce09a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
rails-version:
# rails 6.1 supports ruby >= 2.5
# rails 7.0 supports ruby >= 2.7
- '6.1'
- '7.0'
include:
# rails 5.2 (EOL 6/22) supports ruby < 2.7 (2.6 EOL 3/22)
- ruby-version: '2.5'
rails-version: '5.2'
# rails 6.0 (security EOL 6/23?) supports ruby < 2.8 (2.7 EOL 3/23?;)
- ruby-version: '2.6'
rails-version: '6.0'
Expand Down
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ namespace :spec do

def connection_spec
require 'yaml'
@connection_spec ||= YAML.load_file(File.join(__dir__, %w[config database.yml]))
@connection_spec ||=
if YAML.respond_to?(:safe_load)
YAML.safe_load(File.read(File.join(__dir__, %w[config database.yml])), :aliases => true)
else
YAML.load_file(File.join(__dir__, %w[config database.yml]))
end
end

def test_database_name
Expand Down
2 changes: 1 addition & 1 deletion inventory_refresh.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.metadata['rubygems_mfa_required'] = 'true'

spec.add_dependency "activerecord", ">=5.0", "< 7.0"
spec.add_dependency "activerecord", ">=5.0", "<7.1"
spec.add_dependency "more_core_extensions", ">=3.5", "< 5"
spec.add_dependency "pg", "> 0"

Expand Down
7 changes: 6 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
puts "\e[93mUsing ActiveRecord #{ActiveRecord.version}\e[0m"

require 'yaml'
connection_spec = YAML.load_file(File.join(__dir__, %w[.. config database.yml]))
connection_spec =
if YAML.respond_to?(:safe_load)
YAML.safe_load(File.read(File.join(__dir__, %w[.. config database.yml])), :aliases => true)
else
YAML.load_file(File.join(__dir__, %w[.. config database.yml]))
end
ActiveRecord::Base.establish_connection(connection_spec["test"])

0 comments on commit b7ce09a

Please sign in to comment.