queryable_collection 0.2.0 → 0.4.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: 2efa1fed69163d92ca5140fa0eb565caaebda6df741344d10659c2b06a59a431
4
- data.tar.gz: aeb88380eef87bc23e65c62f99c797f7d6d836502ba24756f3dd57c7194f6523
3
+ metadata.gz: cf35c3ca7869212459238abd6d2c801bb7b06ab539024aa9ab24ef20fdbb7e8f
4
+ data.tar.gz: eb8f8ca2dc3898ce4de4f78a11719d055fe9341a5b98d20ab687cfbd34eae458
5
5
  SHA512:
6
- metadata.gz: 19e4da927b3bdb502c802062e6964a0d8ed896a85e2441e5b65c1a749d31642f5b21595af275e418d6e2796f270363e5c54a1449cfcd4252b2f734676c95fc07
7
- data.tar.gz: 9d0bc5b86ba52b784f28778030855c9afd838eb7aecf7fd27e072f870cf3810673f7ffb5611e6f7a0f2bef5e74179330ef527627b28bfe540949f4f24ce42d3f
6
+ metadata.gz: 9e172c39d0f3e56f51dd7fa1452ea0f0c7ccfbd10c481c194d4017712c79bfca511afb6a4254c66125d3f88873a470045dfaf836d058679258d121ba39b217ed
7
+ data.tar.gz: c3a4f14d95fc376dfeedbe8dc79b5fc1b52ed45f3dd0359392bda0336b92177342afbc9ca29fbad8d659eaf1e41e2a4c1ef4629a2838c58506ee09ced7c32ecf
@@ -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: ["3.0", "3.1", "3.2"]
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.3
2
+ TargetRubyVersion: 3.2
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.0.0
1
+ 3.2.0
data/CHANGELOG.md CHANGED
@@ -1,7 +1,16 @@
1
1
  # Change Log
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
  This project adheres to [Semantic Versioning](http://semver.org/).
4
- This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
5
+ This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
6
+
7
+ ## 0.4.0
8
+
9
+ - [PLAT-1175] Update to Ruby 3.2
10
+
11
+ ## 0.3.0
12
+
13
+ - [PLAT-183] Ruby 3.1 and use coverage-kit
5
14
 
6
15
  ## 0.2.0
7
16
 
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'queryable-collection'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QueryableCollection
4
- VERSION = '0.2.0'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -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
- fail(Error, 'Queryable attributes must be a non empty list of attributes') unless
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
- fail Error, "Attributes #{non_queryable_attributes.join(', ')} can't be used in query"
75
+
76
+ raise Error, "Attributes #{non_queryable_attributes.join(', ')} can't be used in query"
73
77
  end
74
78
  end
75
79
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module QueryableCollection
2
4
  def self.create(elements, queryable_attributes)
3
5
  QueryableCollection::Worker.new elements, queryable_attributes
@@ -1,5 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
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
 
@@ -23,17 +24,15 @@ Gem::Specification.new do |spec|
23
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
25
  spec.require_paths = ['lib']
25
26
 
26
- spec.required_ruby_version = '>= 2.6'
27
+ spec.required_ruby_version = '>= 3.0'
27
28
 
28
29
  spec.add_dependency 'adamantium', '~> 0.2'
29
30
 
30
31
  spec.add_development_dependency 'bundler'
31
- spec.add_development_dependency 'rake'
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.2.0
4
+ version: 0.4.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: 2021-01-06 00:00:00.000000000 Z
11
+ date: 2023-01-17 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: rake
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: rspec
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: simplecov-rcov
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: coveralls
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
@@ -190,14 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
162
  requirements:
191
163
  - - ">="
192
164
  - !ruby/object:Gem::Version
193
- version: '2.6'
165
+ version: '3.0'
194
166
  required_rubygems_version: !ruby/object:Gem::Requirement
195
167
  requirements:
196
168
  - - ">="
197
169
  - !ruby/object:Gem::Version
198
170
  version: '0'
199
171
  requirements: []
200
- rubygems_version: 3.2.3
172
+ rubygems_version: 3.4.1
201
173
  signing_key:
202
174
  specification_version: 4
203
175
  summary: Allows the creation and querying of a collection of elements