queryable_collection 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +6 -1
- data/.rubocop.yml +4 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/README.md +1 -0
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/lib/queryable_collection/version.rb +1 -1
- data/lib/queryable_collection/worker.rb +6 -2
- data/lib/queryable_collection.rb +2 -0
- data/queryable_collection.gemspec +6 -7
- metadata +7 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a738d561b62e7febc9b27c12b9515eb9f9e2b634998448c532ec561af195e0
|
4
|
+
data.tar.gz: bd1a98435914ec618eca432f1c87dadd7598333496aac0c41755fd10ee376eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4306b6931e3153810d75618addb026311692a69dc85d5625e67957e5bf885f6a11d81dc2c9ca5baab9edf122f7f75778a0cd1ad96bb11747720c35729fb6a53
|
7
|
+
data.tar.gz: ef19cf6ac38d1d20a1454c3944a31d093e12222c153267735b1427266e983abaa4fe898e1a5fa095e3b3820afa8a9670518205728ff839133ec18c80341fe343
|
data/.github/workflows/ruby.yml
CHANGED
@@ -5,7 +5,7 @@ jobs:
|
|
5
5
|
strategy:
|
6
6
|
fail-fast: false
|
7
7
|
matrix:
|
8
|
-
ruby: ["2.6", "2.7", "3.0"]
|
8
|
+
ruby: ["2.6", "2.7", "3.0", "3.1"]
|
9
9
|
runs-on: ubuntu-latest
|
10
10
|
steps:
|
11
11
|
- uses: actions/checkout@v2
|
@@ -14,3 +14,8 @@ jobs:
|
|
14
14
|
ruby-version: ${{ matrix.ruby }}
|
15
15
|
bundler-cache: true
|
16
16
|
- run: bundle exec rake
|
17
|
+
- name: Coveralls
|
18
|
+
uses: coverallsapp/github-action@master
|
19
|
+
with:
|
20
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
21
|
+
path-to-lcov: coverage/lcov.info
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.6
|
3
3
|
|
4
4
|
Metrics/LineLength:
|
5
5
|
Max: 100
|
@@ -12,3 +12,6 @@ Style/BlockDelimiters:
|
|
12
12
|
|
13
13
|
Style/TrivialAccessors:
|
14
14
|
AllowPredicates: true
|
15
|
+
|
16
|
+
Metrics/BlockLength:
|
17
|
+
IgnoredMethods: ['describe', 'context']
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1.0
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
|
5
5
|
|
6
|
+
## 0.3.0
|
7
|
+
|
8
|
+
- [PLAT-183] Ruby 3.1 and use coverage-kit
|
9
|
+
|
6
10
|
## 0.2.0
|
7
11
|
|
8
12
|
- [TT-8612] Update to build with github actions / ruby 3.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/queryable_collection.svg)](http://badge.fury.io/rb/queryable_collection)
|
4
4
|
[![Build Status](https://github.com/sealink/queryable_collection/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/queryable_collection/actions)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/github/sealink/queryable_collection/badge.svg?branch=master)](https://coveralls.io/github/sealink/queryable_collection?branch=master)
|
5
6
|
|
6
7
|
QueryableCollection allows you to create a collection of objects and then query them based on a (user) defined set of queryable properties
|
7
8
|
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'adamantium'
|
2
4
|
|
3
5
|
module QueryableCollection
|
@@ -6,8 +8,9 @@ module QueryableCollection
|
|
6
8
|
|
7
9
|
def initialize(elements, queryable_attributes)
|
8
10
|
@elements = Array(elements)
|
9
|
-
|
11
|
+
raise(Error, 'Queryable attributes must be a non empty list of attributes') unless
|
10
12
|
valid_queryable_attributes? queryable_attributes
|
13
|
+
|
11
14
|
@queryable_attributes = queryable_attributes.map(&:to_s)
|
12
15
|
end
|
13
16
|
|
@@ -69,7 +72,8 @@ module QueryableCollection
|
|
69
72
|
def validate!
|
70
73
|
non_queryable_attributes = @query.keys.reject { |attribute| queryable?(attribute) }
|
71
74
|
return if non_queryable_attributes.empty?
|
72
|
-
|
75
|
+
|
76
|
+
raise Error, "Attributes #{non_queryable_attributes.join(', ')} can't be used in query"
|
73
77
|
end
|
74
78
|
end
|
75
79
|
end
|
data/lib/queryable_collection.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'queryable_collection/version'
|
5
6
|
|
@@ -28,12 +29,10 @@ Gem::Specification.new do |spec|
|
|
28
29
|
spec.add_dependency 'adamantium', '~> 0.2'
|
29
30
|
|
30
31
|
spec.add_development_dependency 'bundler'
|
31
|
-
spec.add_development_dependency '
|
32
|
+
spec.add_development_dependency 'coverage-kit'
|
32
33
|
spec.add_development_dependency 'dotenv'
|
34
|
+
spec.add_development_dependency 'pry-byebug'
|
35
|
+
spec.add_development_dependency 'rake'
|
33
36
|
spec.add_development_dependency 'rspec'
|
34
|
-
spec.add_development_dependency 'simplecov'
|
35
|
-
spec.add_development_dependency 'simplecov-rcov'
|
36
|
-
spec.add_development_dependency 'coveralls'
|
37
37
|
spec.add_development_dependency 'rubocop'
|
38
|
-
spec.add_development_dependency 'pry-byebug'
|
39
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queryable_collection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akil Madan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: adamantium
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: coverage-kit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -67,21 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: simplecov
|
70
|
+
name: pry-byebug
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
@@ -95,7 +81,7 @@ dependencies:
|
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
84
|
+
name: rake
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - ">="
|
@@ -109,7 +95,7 @@ dependencies:
|
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
98
|
+
name: rspec
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - ">="
|
@@ -136,20 +122,6 @@ dependencies:
|
|
136
122
|
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: pry-byebug
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
125
|
description: Allows the caller to define a queryable collection of elements and the
|
154
126
|
attributes that can be used for querying. Provides the necessary methods to query
|
155
127
|
the collection
|
@@ -197,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
169
|
- !ruby/object:Gem::Version
|
198
170
|
version: '0'
|
199
171
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.3.3
|
201
173
|
signing_key:
|
202
174
|
specification_version: 4
|
203
175
|
summary: Allows the creation and querying of a collection of elements
|