Skip to content

Commit

Permalink
Merge pull request #214 from eqladios/chore/bump-mongoid-9-support-ru…
Browse files Browse the repository at this point in the history
…by-3.3

Chore: bump mongoid 9 and support ruby 3.3
  • Loading branch information
rmm5t authored Nov 22, 2024
2 parents fb33721 + ccb44b5 commit 4f649ef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ jobs:
strategy:
matrix:
mongodb: [4.4]
ruby: [2.7, "3.0", 3.1, 3.2]
ruby: [2.7, "3.0", 3.1, 3.2, 3.3]
gemfile:
- carrierwave-2.1
- carrierwave-2.2
- mongoid-7
- mongoid-8
- mongoid-9
include:
- { mongodb: "4.4", ruby: "2.6", gemfile: "carrierwave-0.10" }
- { mongodb: "4.4", ruby: "2.6", gemfile: "carrierwave-0.11" }
Expand All @@ -31,15 +32,15 @@ jobs:
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb }}
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mimemagic-0.4.3/gem_make.out
- run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/${{ matrix.ruby }}/extensions/x86_64-linux/${{ matrix.ruby }}/mimemagic-0.4.3/gem_make.out
if: ${{ failure() }}
- run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/3.0.0/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile
- run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/${{ matrix.ruby }}/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile
if: ${{ failure() }}
- name: Run tests
run: bundle exec rake
4 changes: 2 additions & 2 deletions carrierwave-mongoid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency "carrierwave", [">= 0.8", "< 3"]
s.add_dependency "mongoid", [">= 3.0", "< 9.0"]
s.add_dependency "mongoid", [">= 3.0", "< 10.0"]
s.add_dependency "mongoid-grid_fs", [">= 1.3", "< 3.0"]
s.add_dependency "mime-types", "< 3" if RUBY_VERSION < "2.0" # mime-types 3+ doesn't support ruby 1.9
s.add_development_dependency "rspec", "~> 3.4"
s.add_development_dependency "rake", ">= 12.3.3"
s.add_development_dependency "mini_magick"
s.add_development_dependency "mini_magick", "< 5"
s.add_development_dependency "pry"
end
6 changes: 6 additions & 0 deletions gemfiles/mongoid-9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source "https://rubygems.org"

gem "mongoid", "~> 9.0"
gem "carrierwave", "~> 2.2"

gemspec path: "../"
6 changes: 4 additions & 2 deletions spec/mongoid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,13 @@ def filename

it "attaches a new file to an existing document that had no file at first" do
doc = @class.new
doc.mongo_locations.build
new_file = doc.mongo_locations.build
expect(new_file.save).to be_truthy
expect(doc.save).to be_truthy
doc.reload

doc.mongo_locations.first.image = stub_file('test.jpeg')
new_file.image = stub_file('test.jpeg')
expect(new_file.save).to be_truthy
expect(doc.save).to be_truthy
doc.reload

Expand Down

0 comments on commit 4f649ef

Please sign in to comment.