dbee 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b8250c307ad60bdb8bc51e19fdb93b2c9eb3db0cccfb5daad0a2e621aab57cb
4
- data.tar.gz: db66f66f4a56dd40bbaa347218d0827291c789733b9c3f7086ca416e85a09246
3
+ metadata.gz: 234c40439102547cc3c8b78cbde5bc3755fcf49d8515c81eed7c7942f1c6a526
4
+ data.tar.gz: b9bb06a2e773786bb7e19b541f1dd6f104909baeea93148bbde78f9c5965ced8
5
5
  SHA512:
6
- metadata.gz: '0085b06c34404de9b93b728713fd118189a2693920668685e66574c2bd23b8cb2009d0ab4a047dbbc8b4e7c69084a3ec595d1fa80aaf6de06bce023d5fff3d1a'
7
- data.tar.gz: a295c963939ce9df84689bd3ab34852df111a7c57e685ac07abdb661498dc269fe85e661fae49b77826e43054030fb09c18fe7da648a1cdc78020024bac15a52
6
+ metadata.gz: 3484318a258c8788fa7b08533cb3b27679fc52903e70f2914d4ab8ddd36921fcf628d3f934dbc0704fbf38f1d49c03c087a3c656121d0266083c3c98e41cde75
7
+ data.tar.gz: 53c8425f56c659f222d729c71855d4c1ecaaa3dd90d21ced647152d49c00bdc5ed2bc550bae7c307f098835a13d165c423685033df6ffee62e3867bfc32c0224
@@ -0,0 +1,71 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ status_to_ms_teams: bluemarblepayroll/status_to_ms_teams_pure_bash@1.0.0
5
+
6
+ jobs:
7
+ build:
8
+ parameters:
9
+ use-bundler-cache:
10
+ type: boolean
11
+ default: true
12
+
13
+ docker:
14
+ - image: circleci/ruby:2.6.6-buster
15
+ environment:
16
+ FORBID_FOCUSED_SPECS: 1
17
+ working_directory: ~/dbee
18
+ steps:
19
+ - checkout
20
+
21
+ # TODO: wrap bundler caching logic into an Orb:
22
+ - when:
23
+ condition: << parameters.use-bundler-cache >>
24
+ steps:
25
+ - restore_cache:
26
+ key: v1.0.0-build-ruby-dependency-cache-{{ checksum "dbee.gemspec" }}-{{ checksum "Gemfile" }}-{{ checksum ".ruby-version" }}
27
+
28
+ - run: bundle install --path vendor/bundle
29
+
30
+ - when:
31
+ condition: << parameters.use-bundler-cache >>
32
+ steps:
33
+ - save_cache:
34
+ key: v1.0.0-build-ruby-dependency-cache-{{ checksum "dbee.gemspec" }}-{{ checksum "Gemfile" }}-{{ checksum ".ruby-version" }}
35
+ paths:
36
+ - vendor/bundle
37
+
38
+ - store_artifacts:
39
+ path: Gemfile.lock
40
+
41
+ - run: bundle exec rubocop
42
+
43
+ - run: COVERAGE=true bundle exec rspec -r rspec_junit_formatter --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml
44
+
45
+ - store_test_results:
46
+ path: test-results
47
+
48
+ - store_artifacts:
49
+ path: coverage
50
+
51
+ - status_to_ms_teams/report:
52
+ webhook_url: $MS_TEAMS_WEBHOOK_URL
53
+
54
+ workflows:
55
+ version: 2.1
56
+ build:
57
+ jobs:
58
+ - build:
59
+ context: org-global
60
+ monthly-gem-dependency-refresh-check:
61
+ triggers:
62
+ - schedule:
63
+ cron: '0 0 1 * *'
64
+ filters:
65
+ branches:
66
+ only:
67
+ - master
68
+ jobs:
69
+ - build:
70
+ context: org-global
71
+ use-bundler-cache: false
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ Layout/LineLength:
6
6
  Max: 100
7
7
 
8
8
  Metrics/AbcSize:
9
- Max: 16
9
+ Max: 20
10
10
 
11
11
  Metrics/BlockLength:
12
12
  IgnoredMethods:
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.6.6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 3.1.0 (October 4th, 2021)
2
+
3
+ Additions
4
+
5
+ * Added Query#offset to help with callers needing paging support.
1
6
  # 3.0.0 (March 11th, 2021)
2
7
 
3
8
  ### Additions
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Dbee
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/dbee.svg)](https://badge.fury.io/rb/dbee) [![Build Status](https://travis-ci.org/bluemarblepayroll/dbee.svg?branch=master)](https://travis-ci.org/bluemarblepayroll/dbee) [![Maintainability](https://api.codeclimate.com/v1/badges/208b36a1d13751687df9/maintainability)](https://codeclimate.com/github/bluemarblepayroll/dbee/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/208b36a1d13751687df9/test_coverage)](https://codeclimate.com/github/bluemarblepayroll/dbee/test_coverage) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ [![CircleCI](https://circleci.com/bb/bluemarble-ondemand/dbee/tree/master.svg?style=svg&circle-token=7f7afbea94912b2b75a889cae3e2c46a3a869d21)](https://circleci.com/bb/bluemarble-ondemand/dbee/tree/master)
4
4
 
5
5
  Dbee arose out of a need for an ad-hoc reporting solution that included:
6
6
 
@@ -25,7 +25,7 @@ This specific library is the core modeling component of the Dbee framework, but
25
25
  To install through Rubygems:
26
26
 
27
27
  ````
28
- gem install install dbee
28
+ gem install dbee
29
29
  ````
30
30
 
31
31
  You can also add this to your Gemfile:
@@ -310,7 +310,7 @@ query = {
310
310
  }
311
311
  ````
312
312
 
313
- Get all practices, limit to 10, and sort by name (descending) then id (ascending):
313
+ Get all practices, limit to 2, offset by 3, and sort by name (descending) then id (ascending):
314
314
 
315
315
  ````ruby
316
316
  query = {
@@ -324,7 +324,8 @@ query = {
324
324
  { key_path: 'name', direction: :descending },
325
325
  { key_path: 'id' }
326
326
  ],
327
- limit: 10
327
+ limit: 2,
328
+ offset: 3
328
329
  }
329
330
  ````
330
331
 
@@ -661,7 +662,7 @@ Note: ensure you have proper authorization before trying to publish new versions
661
662
  After code changes have successfully gone through the Pull Request review process then the following steps should be followed for publishing new versions:
662
663
 
663
664
  1. Merge Pull Request into master
664
- 2. Update `lib/dbee/version.rb` using [semantic versioning](https://semver.org/)
665
+ 2. Update `version.rb` using [semantic versioning](https://semver.org/)
665
666
  3. Install dependencies: `bundle`
666
667
  4. Update `CHANGELOG.md` with release notes
667
668
  5. Commit & push master to remote and ensure CI builds master successfully
data/dbee.gemspec CHANGED
@@ -17,15 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.bindir = 'exe'
19
19
  s.executables = []
20
- s.homepage = 'https://github.com/bluemarblepayroll/dbee'
21
20
  s.license = 'MIT'
22
- s.metadata = {
23
- 'bug_tracker_uri' => 'https://github.com/bluemarblepayroll/dbee/issues',
24
- 'changelog_uri' => 'https://github.com/bluemarblepayroll/dbee/blob/master/CHANGELOG.md',
25
- 'documentation_uri' => 'https://www.rubydoc.info/gems/dbee',
26
- 'homepage_uri' => s.homepage,
27
- 'source_code_uri' => s.homepage
28
- }
29
21
 
30
22
  s.required_ruby_version = '>= 2.5'
31
23
 
@@ -37,6 +29,7 @@ Gem::Specification.new do |s|
37
29
  s.add_development_dependency('pry-byebug')
38
30
  s.add_development_dependency('rake', '~> 13')
39
31
  s.add_development_dependency('rspec')
32
+ s.add_development_dependency('rspec_junit_formatter')
40
33
  s.add_development_dependency('rubocop', '~> 1')
41
34
  s.add_development_dependency('rubocop-rake')
42
35
  s.add_development_dependency('rubocop-rspec')
@@ -37,7 +37,7 @@ module Dbee
37
37
 
38
38
  private
39
39
 
40
- def model_config(dsl_model) #:nodoc:
40
+ def model_config(dsl_model) # :nodoc:
41
41
  {
42
42
  name: dsl_model.inflected_class_name,
43
43
  partitioners: dsl_model.inherited_partitioners,
data/lib/dbee/query.rb CHANGED
@@ -25,6 +25,7 @@ module Dbee
25
25
  :filters,
26
26
  :from,
27
27
  :limit,
28
+ :offset,
28
29
  :sorters
29
30
 
30
31
  def_delegator :fields, :sort, :sorted_fields
@@ -36,12 +37,14 @@ module Dbee
36
37
  from: nil,
37
38
  filters: [],
38
39
  limit: nil,
40
+ offset: nil,
39
41
  sorters: []
40
42
  )
41
43
  @fields = Field.array(fields)
42
44
  @filters = Filters.array(filters).uniq
43
45
  @from = from.to_s
44
46
  @limit = limit.to_s.empty? ? nil : limit.to_i
47
+ @offset = offset.to_s.empty? ? nil : offset.to_i
45
48
  @sorters = Sorters.array(sorters).uniq
46
49
 
47
50
  freeze
@@ -50,6 +53,7 @@ module Dbee
50
53
  def ==(other)
51
54
  other.instance_of?(self.class) &&
52
55
  other.limit == limit &&
56
+ other.offset == offset &&
53
57
  other.from == from &&
54
58
  other.sorted_fields == sorted_fields &&
55
59
  other.sorted_filters == sorted_filters &&
data/lib/dbee/version.rb CHANGED
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module Dbee
11
- VERSION = '3.0.0'
11
+ VERSION = '3.1.0'
12
12
  end
@@ -17,7 +17,7 @@ README_EXAMPLES = {
17
17
  { key_path: 'name' }
18
18
  ]
19
19
  },
20
- 'Get all practices, limit to 10, and sort by name (descending) then id (ascending)' => {
20
+ 'Get practices, limit to 2, offset by 3, and sort by name (descending) then id (ascending)' => {
21
21
  fields: [
22
22
  { key_path: 'id' },
23
23
  { key_path: 'active' },
@@ -27,7 +27,8 @@ README_EXAMPLES = {
27
27
  { key_path: 'name', direction: :descending },
28
28
  { key_path: 'id' }
29
29
  ],
30
- limit: 10
30
+ limit: 2,
31
+ offset: 3
31
32
  },
32
33
  "Get top 5 active practices and patient whose name start with 'Sm':" => {
33
34
  fields: [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbee
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2021-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts_as_hashable
@@ -114,6 +114,20 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: rspec_junit_formatter
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: rubocop
119
133
  requirement: !ruby/object:Gem::Requirement
@@ -194,11 +208,12 @@ executables: []
194
208
  extensions: []
195
209
  extra_rdoc_files: []
196
210
  files:
211
+ - ".circleci/config.yml"
197
212
  - ".editorconfig"
198
213
  - ".gitignore"
199
214
  - ".rubocop.yml"
200
215
  - ".ruby-version"
201
- - ".travis.yml"
216
+ - ".tool-versions"
202
217
  - CHANGELOG.md
203
218
  - CODE_OF_CONDUCT.md
204
219
  - Gemfile
@@ -277,15 +292,10 @@ files:
277
292
  - spec/fixtures/models.rb
278
293
  - spec/fixtures/models.yaml
279
294
  - spec/spec_helper.rb
280
- homepage: https://github.com/bluemarblepayroll/dbee
295
+ homepage:
281
296
  licenses:
282
297
  - MIT
283
- metadata:
284
- bug_tracker_uri: https://github.com/bluemarblepayroll/dbee/issues
285
- changelog_uri: https://github.com/bluemarblepayroll/dbee/blob/master/CHANGELOG.md
286
- documentation_uri: https://www.rubydoc.info/gems/dbee
287
- homepage_uri: https://github.com/bluemarblepayroll/dbee
288
- source_code_uri: https://github.com/bluemarblepayroll/dbee
298
+ metadata: {}
289
299
  post_install_message:
290
300
  rdoc_options: []
291
301
  require_paths:
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- env:
2
- global:
3
- - CC_TEST_REPORTER_ID=e7db23dad7560a076e48357331b0362db3741b62dbdd537bc30de27fa9cab69b
4
- - DISABLE_RSPEC_FOCUS=true
5
- language: ruby
6
- rvm:
7
- # Build on the latest stable of all supported Rubies (https://www.ruby-lang.org/en/downloads/):
8
- - 2.5.8
9
- - 2.6.6
10
- - 2.7.2
11
- cache: bundler
12
- before_script:
13
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
14
- - chmod +x ./cc-test-reporter
15
- - ./cc-test-reporter before-build
16
- script:
17
- - bundle exec rubocop
18
- - bundle exec rspec spec --format documentation
19
- after_script:
20
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
21
- addons:
22
- # https://docs.travis-ci.com/user/uploading-artifacts/
23
- artifacts:
24
- paths:
25
- - Gemfile.lock