Skip to content

Commit

Permalink
Adjustments to work with esse 0.2 API (#3)
Browse files Browse the repository at this point in the history
* update esse dependency to 0.2.3 or upper

* chore: update dev dependencies

* minor adjustments to the rubocop rules

* chore: fix rubocop offenses

* chore: update specs and readme to use new esse API

* chore: use stub index rspec helpers from esse-rspec

* fix: delete callback should not throw an error when document does not exist

* feat: add github actions workflow

* feat: add sqlite3 dependency to the github actions workflow

* fix: use real models instead of a Dummy class with ActiveModels callbacks

* feat: extend the matrix of ruby and rails versions in the ci

* chore: separate liner to a new step
  • Loading branch information
marcosgz authored Jan 24, 2024
1 parent d0c5348 commit db9057a
Show file tree
Hide file tree
Showing 30 changed files with 1,383 additions and 294 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Tests

on:
push:
branches:
- main
pull_request:

jobs:
linter:
runs-on: ubuntu-latest
name: "Rubocop"
env:
BUNDLE_GEMFILE: ci/Gemfile.rails-6.1
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: Run linter
run: bundle exec rubocop
ruby-2:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "2.7"
gemfile:
- ci/Gemfile.rails-5.2
name: "ruby-${{ matrix.ruby }}/${{ matrix.gemfile }} specs"
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rspec
ruby-3:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
gemfile:
- ci/Gemfile.rails-6.0
- ci/Gemfile.rails-6.1
- ci/Gemfile.rails-7.0
- ci/Gemfile.rails-7.1
name: "ruby-${{ matrix.ruby }}/${{ matrix.gemfile }} specs"
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rspec
16 changes: 16 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ AllCops:
- "db/**/*"
- "tmp/**/*"
- "vendor/**/*"
NewCops: enable

RSpec/MultipleExpectations:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/MessageSpies:
Enabled: false

RSpec/FilePath:
Enabled: false

RSpec/SpecFilePathFormat:
Enabled: false

Layout/SpaceInsideHashLiteralBraces:
Enabled: false
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

source 'https://rubygems.org'

gem 'esse', github: 'marcosgz/esse', branch: 'master'
gem 'esse', '~> 0.2.4'
gem 'sqlite3', '~> 1.3.6'
gem 'activerecord', '~> 5.2'
gem 'esse-rspec', '~> 0.0.6'
gem 'elasticsearch', '~> 7.17', '>= 7.17.10'

# Specify your gem's dependencies in esse-active_record.gemspec
gemspec
165 changes: 99 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
GIT
remote: https://github.com/marcosgz/esse.git
revision: fa4eb4d8c54aae89c388415585b4b27c75b31198
branch: master
specs:
esse (0.2.1)
multi_json
thor (>= 0.19)

PATH
remote: .
specs:
esse-active_record (0.1.1)
esse-active_record (0.2.0)
activerecord (>= 4.2, < 8)
esse
esse (>= 0.2.3)

GEM
remote: https://rubygems.org/
Expand All @@ -28,80 +19,119 @@ GEM
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
arel (9.0.0)
ast (2.4.2)
awesome_print (1.9.2)
base64 (0.2.0)
coderay (1.1.3)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.3)
crack (0.4.5)
rexml
diff-lcs (1.5.0)
dotenv (2.7.6)
hashdiff (1.0.1)
i18n (1.12.0)
dotenv (2.8.1)
elasticsearch (7.17.10)
elasticsearch-api (= 7.17.10)
elasticsearch-transport (= 7.17.10)
elasticsearch-api (7.17.10)
multi_json
elasticsearch-transport (7.17.10)
faraday (>= 1, < 3)
multi_json
esse (0.2.6)
multi_json
thor (>= 0.19)
esse-rspec (0.0.6)
esse (>= 0.2.4)
rspec (>= 3)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
hashdiff (1.1.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.7.1)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
method_source (1.0.0)
minitest (5.16.2)
minitest (5.21.2)
multi_json (1.15.0)
parallel (1.22.1)
parser (3.1.2.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
pry (0.14.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.7)
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rake (12.3.3)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rake (13.1.0)
regexp_parser (2.9.0)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.29.1)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.17.0, < 2.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
rubocop-performance (1.13.3)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-performance (1.16.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rspec (2.11.1)
rubocop (~> 1.19)
ruby-progressbar (1.11.0)
rubocop-rspec (2.20.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sqlite3 (1.3.13)
standard (1.12.1)
rubocop (= 1.29.1)
rubocop-performance (= 1.13.3)
thor (1.2.1)
standard (1.28.5)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50.2)
standard-custom (~> 1.0.0)
standard-performance (~> 1.0.1)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.0.1)
lint_roller (~> 1.0)
rubocop-performance (~> 1.16.0)
thor (1.3.0)
thread_safe (0.3.6)
tzinfo (1.2.10)
tzinfo (1.2.11)
thread_safe (~> 0.1)
unicode-display_width (2.2.0)
webmock (3.14.0)
unicode-display_width (2.5.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
yard (0.9.28)
webrick (~> 1.7.0)
yard (0.9.34)

PLATFORMS
x86_64-darwin-19
Expand All @@ -111,18 +141,21 @@ DEPENDENCIES
activerecord (~> 5.2)
awesome_print
dotenv
esse!
elasticsearch (~> 7.17, >= 7.17.10)
esse (~> 0.2.4)
esse-active_record!
esse-rspec (~> 0.0.6)
factory_bot
pry
rake (~> 12.3)
rspec (~> 3.0)
rubocop (~> 1.20)
rubocop-performance (~> 1.11, >= 1.11.5)
rubocop-rspec (~> 2.4)
rake
rspec
rubocop
rubocop-performance
rubocop-rspec
sqlite3 (~> 1.3.6)
standard (~> 1.3)
webmock (~> 3.14)
yard (~> 0.9.20)
standard
webmock
yard

BUNDLED WITH
2.3.21
2.3.22
Loading

0 comments on commit db9057a

Please sign in to comment.