-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rubocop + add Github Actions (#67)
* Add rubocop and fix rubocop items * Replace Travis CI with Github Actions * Fix specs * Fix specs + more rubies * Enforce mongoid less than 7.3
- Loading branch information
1 parent
1287613
commit 128f2a9
Showing
15 changed files
with
213 additions
and
128 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,49 @@ | ||
name: CI RSpec Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: >- | ||
${{ matrix.ruby }} | ||
env: | ||
CI: true | ||
TESTOPTS: -v | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
ruby: [2.4, 2.5, 2.6, 2.7, 3.0, jruby, truffleruby] | ||
experimental: [false] | ||
include: | ||
- ruby: head | ||
experimental: true | ||
- ruby: jruby-head | ||
experimental: true | ||
- ruby: truffleruby-head | ||
experimental: true | ||
|
||
steps: | ||
- name: repo checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: start mongodb | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: 4.4 | ||
mongodb-replica-set: rs0 | ||
|
||
- name: load ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler: 2 | ||
|
||
- name: bundle install | ||
run: bundle install --jobs 4 --retry 3 | ||
|
||
- name: test | ||
timeout-minutes: 10 | ||
run: bundle exec rake spec | ||
continue-on-error: ${{ matrix.experimental }} |
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,48 @@ | ||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
NewCops: enable | ||
SuggestExtensions: false | ||
TargetRubyVersion: 2.6 | ||
Exclude: | ||
- spec/**/* | ||
- vendor/**/* | ||
|
||
Bundler/DuplicatedGem: | ||
Exclude: | ||
- 'Gemfile' | ||
|
||
Gemspec/RequiredRubyVersion: | ||
Enabled: false | ||
|
||
Layout/EmptyLineAfterGuardClause: | ||
Enabled: false | ||
|
||
Layout/IndentationWidth: | ||
IgnoredPatterns: | ||
- '^\s*module' | ||
|
||
Layout/LineLength: | ||
Max: 120 | ||
|
||
Layout/SpaceInsideBlockBraces: | ||
SpaceBeforeBlockParameters: false | ||
|
||
Naming/FileName: | ||
Exclude: | ||
- 'lib/mongoid-paranoia.rb' | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/DocumentDynamicEvalDefinition: | ||
Enabled: false | ||
|
||
Style/DoubleNegation: | ||
Enabled: false | ||
|
||
Style/OptionalBooleanParameter: | ||
Enabled: false | ||
|
||
Style/RaiseArgs: | ||
EnforcedStyle: compact |
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,20 @@ | ||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
Metrics/ClassLength: | ||
Enabled: false | ||
|
||
Metrics/CyclomaticComplexity: | ||
Enabled: false | ||
|
||
Metrics/MethodLength: | ||
Enabled: false | ||
|
||
Metrics/ModuleLength: | ||
Enabled: false | ||
|
||
Metrics/PerceivedComplexity: | ||
Enabled: false |
This file was deleted.
Oops, something went wrong.
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 | ||
|
||
source 'https://rubygems.org' | ||
gemspec name: 'mongoid_paranoia' | ||
|
||
|
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,14 +1,16 @@ | ||
require "bundler" | ||
# frozen_string_literal: true | ||
|
||
require 'bundler' | ||
Bundler.setup | ||
Bundler::GemHelper.install_tasks | ||
|
||
require "rspec/core/rake_task" | ||
require "rake" | ||
require 'rspec/core/rake_task' | ||
require 'rake' | ||
|
||
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) | ||
$LOAD_PATH.unshift File.expand_path('lib', __dir__) | ||
|
||
RSpec::Core::RakeTask.new("spec") do |spec| | ||
spec.pattern = "spec/**/*_spec.rb" | ||
RSpec::Core::RakeTask.new('spec') do |spec| | ||
spec.pattern = 'spec/**/*_spec.rb' | ||
end | ||
|
||
task :default => :spec | ||
task default: :spec |
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 @@ | ||
require "mongoid/paranoia" | ||
# frozen_string_literal: true | ||
|
||
require 'mongoid/paranoia' |
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 | ||
module Paranoia | ||
class Configuration | ||
|
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,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mongoid | ||
module Paranoia | ||
VERSION = '0.4.0'.freeze | ||
VERSION = '0.4.0' | ||
end | ||
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 +1,3 @@ | ||
require "mongoid/paranoia" | ||
# frozen_string_literal: true | ||
|
||
require 'mongoid/paranoia' |
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,20 +1,23 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path('../lib', __FILE__) | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.push File.expand_path('lib', __dir__) | ||
require 'mongoid/paranoia/version' | ||
|
||
Gem::Specification.new do |gem| | ||
gem.name = 'mongoid_paranoia' | ||
gem.version = Mongoid::Paranoia::VERSION | ||
gem.authors = ['Durran Jordan', 'Josef Šimánek'] | ||
gem.email = ['[email protected]', '[email protected]'] | ||
gem.description = %q{There may be times when you don't want documents to actually get deleted from the database, but "flagged" as deleted. Mongoid provides a Paranoia module to give you just that.} | ||
gem.summary = %q{Paranoid documents} | ||
gem.description = 'Provides a Paranoia module documents which soft-deletes documents.' | ||
gem.summary = 'Paranoid documents' | ||
gem.homepage = 'https://github.com/simi/mongoid-paranoia' | ||
gem.license = 'MIT' | ||
|
||
gem.files = Dir.glob('lib/**/*') + %w(LICENSE README.md) | ||
gem.files = Dir.glob('lib/**/*') + %w[LICENSE README.md] | ||
gem.test_files = Dir.glob('{perf,spec}/**/*') | ||
gem.require_paths = ['lib'] | ||
|
||
gem.add_dependency 'mongoid', '~> 7.0' | ||
gem.add_dependency 'mongoid', '>= 7.0', '< 7.3' | ||
|
||
gem.add_development_dependency 'rubocop', '>= 1.8.1' | ||
end |
Oops, something went wrong.