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 +4 -4
- data/.circleci/config.yml +71 -0
- data/.rubocop.yml +1 -1
- data/.tool-versions +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +6 -5
- data/dbee.gemspec +1 -8
- data/lib/dbee/dsl_schema_builder.rb +1 -1
- data/lib/dbee/query.rb +4 -0
- data/lib/dbee/version.rb +1 -1
- data/spec/dbee/query_spec.rb +3 -2
- metadata +20 -10
- data/.travis.yml +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 234c40439102547cc3c8b78cbde5bc3755fcf49d8515c81eed7c7942f1c6a526
|
4
|
+
data.tar.gz: b9bb06a2e773786bb7e19b541f1dd6f104909baeea93148bbde78f9c5965ced8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.6.6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Dbee
|
2
2
|
|
3
|
-
[![
|
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
|
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
|
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:
|
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 `
|
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')
|
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
data/spec/dbee/query_spec.rb
CHANGED
@@ -17,7 +17,7 @@ README_EXAMPLES = {
|
|
17
17
|
{ key_path: 'name' }
|
18
18
|
]
|
19
19
|
},
|
20
|
-
'Get
|
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:
|
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.
|
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-
|
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
|
-
- ".
|
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:
|
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
|