-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Gemfile * fix security vulnerability https://github.com/mongoid/mongoid_search/security/dependabot/1 * update various dependencies * fix build * autofix rubocop errors * ignore relevant_search specs * fix Gemfile * ensure it works with github actions * ensure it picks the highest version in each major release * remove jruby tests jruby needs jruby-stemmer, perhaps this support can be added later * update CHANGELOG
- Loading branch information
Showing
23 changed files
with
155 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Danger | ||
on: [pull_request] | ||
jobs: | ||
danger: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
- run: | | ||
# Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub | ||
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) | ||
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Rubocop | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
- run: bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
entry: | ||
- { ruby: '2.7.1', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: '3.0.5', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: '3.1.3', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: '2.7.1', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: '3.0.5', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: '3.1.3', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: '2.7.1', mongo: 'mongo:4.4', mongoid: '8' } | ||
- { ruby: '3.0.5', mongo: 'mongo:4.4', mongoid: '8' } | ||
- { ruby: '3.1.3', mongo: 'mongo:4.4', mongoid: '8' } | ||
experimental: [false] | ||
|
||
name: test (ruby=${{ matrix.entry.ruby }}, mongo=${{ matrix.entry.mongo }}, mongoid=${{ matrix.entry.mongoid }}) | ||
runs-on: ubuntu-latest | ||
|
||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
services: | ||
mongo: | ||
image: ${{ matrix.entry.mongo }} | ||
ports: ["27017:27017"] | ||
|
||
env: | ||
MONGOID_VERSION: ${{ matrix.entry.mongoid }} | ||
COVERAGE: ${{ matrix.entry.coverage }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.entry.ruby }} | ||
bundler-cache: true | ||
|
||
- name: Run tests | ||
run: bundle exec rspec | ||
|
||
- name: Code Climate | ||
if: ${{ env.CC_TEST_REPORTER_ID != '' && success() && matrix.entry.coverage == 'true' }} | ||
uses: paambaati/codeclimate-action@v3.2.0 | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ vars.CC_TEST_REPORTER_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.7 | ||
Exclude: | ||
- vendor/**/* | ||
-Metrics/BlockLength: | ||
Enabled: false | ||
Metrics/CyclomaticComplexity: | ||
Max: 20 | ||
Metrics/PerceivedComplexity: | ||
Max: 30 | ||
Metrics/AbcSize: | ||
Max: 100 | ||
Exclude: | ||
- 'spec/**/*' | ||
|
||
inherit_from: .rubocop_todo.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
danger.import_dangerfile(gem: 'mongoid-danger') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'http://rubygems.org' | ||
|
||
gemspec | ||
|
||
case version = ENV['MONGOID_VERSION'] || '7.0' | ||
case version = ENV['MONGOID_VERSION'] || '8' | ||
when 'HEAD' | ||
gem 'mongoid', github: 'mongodb/mongoid' | ||
when /^8/ | ||
gem 'mongoid', '~> 8' | ||
when /^7/ | ||
gem 'mongoid', '~> 7.0' | ||
gem 'mongoid', '~> 7' | ||
when /^6/ | ||
gem 'mongoid', '~> 6.0' | ||
when /^5/ | ||
gem 'mongoid', '~> 5.0' | ||
when /^4/ | ||
gem 'mongoid', '~> 4.0' | ||
when /^3/ | ||
gem 'mongoid', '~> 3.1' | ||
gem 'mongoid', '~> 6' | ||
else | ||
gem 'mongoid', version | ||
end | ||
|
||
group :development do | ||
gem 'rake', '~> 11' | ||
gem 'rubocop', '0.52.0' | ||
gem 'rake', '>= 12.3.3' | ||
gem 'rubocop', '1.56.0' | ||
gem 'simplecov' | ||
end | ||
|
||
group :test do | ||
gem 'mongoid-danger', '~> 0.1.0', require: false | ||
gem 'mongoid-danger', '~> 0.2.0', require: false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rubygems' | ||
require 'rake' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Mongoid::Search::Log | ||
cattr_accessor :silent | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mongoid::Search | ||
class Railtie < Rails::Railtie | ||
rake_tasks do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Product | ||
include Mongoid::Document | ||
include Mongoid::Search | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Tag | ||
include Mongoid::Document | ||
include Mongoid::Search | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
autoload :Product, 'models/product.rb' | ||
class Variant < Product | ||
field :color | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters