nobrainer 0.34.1 → 0.35.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: ad996bff8cfeced8ef2da26c7b989d24138bb5e4c9a7aa53738cd2cbdfdd907c
4
- data.tar.gz: a24979230bc5d9deeb4dfbee4f353de22a61037dddff0e97521a8d72380db9af
3
+ metadata.gz: c6d7ce930d1fba4a7c3e3f6368c7a9650c0a298ae1bd46517097284591ae1a22
4
+ data.tar.gz: 6d9cc4350f77a229f779acc0d88f4893f146b0fd0028f9a214c29da9e4f5e70a
5
5
  SHA512:
6
- metadata.gz: c3fbe68aa20b186aaca5b5981c476754a9f3cb7e238d09db17340a348f983d48518e34927064cd124640b5dd47564406893613b2a39487b90712e7e02a5bcd58
7
- data.tar.gz: 34106b6e8c1be3260dc8e6356c0658deaabff758818def9aafead00445c2ffcb8b93f8c6b261b4d1d6555d0e5dae0f8c97aad1e123c583933b79eda283849791
6
+ metadata.gz: fcb9ef68e4ce874a89761465e0b9861182feb526665cfd08a19be7019a8a0e5f716e6fdd3d940648a42fe1fe1f2e1bba277291778a3752e06c21e67bb94163d3
7
+ data.tar.gz: fa9b10e21bfd4a987821f365e840c95b6314f5bbaf32efeebe0810f9d8157fe6b0f4f9607ab1931d278f2d22beb24442b0ed2f1115e360a7f82aa8ad3c5a111b
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+
10
+ ## [0.35.0] - 2021-08-08
11
+ ### Added
12
+ - Dockerfile, docker-compose and Earthfile
13
+ - Test Ruby 3 + Rails 6 on Travis CI
14
+ - Implements the ReQL `during` command
15
+
9
16
  ## [0.34.1] - 2021-02-18
10
17
  ### Fixed
11
18
  - Defining attributes at class level (Rails 6.1 compatibity)
@@ -93,7 +100,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93
100
  - Locks: bug fix: allow small timeouts in lock()
94
101
  - Fix reentrant lock counter on steals
95
102
 
96
- [Unreleased]: https://github.com/nobrainerorm/nobrainer/compare/v0.34.1...HEAD
103
+ [Unreleased]: https://github.com/nobrainerorm/nobrainer/compare/v0.35.0...HEAD
104
+ [0.35.0]: https://github.com/nobrainerorm/nobrainer/compare/v0.34.1...v0.35.0
97
105
  [0.34.1]: https://github.com/nobrainerorm/nobrainer/compare/v0.34.0...v0.34.1
98
106
  [0.34.0]: https://github.com/nobrainerorm/nobrainer/compare/v0.33.0...v0.34.0
99
107
  [0.33.0]: https://github.com/nobrainerorm/nobrainer/compare/v0.32.0...v0.33.0
@@ -104,6 +104,7 @@ module NoBrainer::Criteria::Where
104
104
  when :between then [key_modifier, op, (cast_value(value.min)..cast_value(value.max))]
105
105
  when :include then ensure_scalar_for(op); [:any, :eq, cast_value(value)]
106
106
  when :defined, :undefined then ensure_scalar_for(op); [key_modifier, op, cast_value(value)]
107
+ when :during then [key_modifier, op, [cast_value(value.first), cast_value(value.last)]]
107
108
  else [key_modifier, op, cast_value(value)]
108
109
  end
109
110
  BinaryOperator.new(new_key_path, new_key_modifier, new_op, new_value, model, true)
@@ -132,6 +133,7 @@ module NoBrainer::Criteria::Where
132
133
  when :between then (lvalue >= value.min) & (lvalue <= value.max)
133
134
  when :in then RethinkDB::RQL.new.expr(value).contains(lvalue)
134
135
  when :intersects then lvalue.intersects(value.to_rql)
136
+ when :during then lvalue.during(value.first, value.last)
135
137
  when :near
136
138
  # XXX options[:max_results] is not used, seems to be a workaround of rethinkdb index implementation.
137
139
  circle = value[:circle]
@@ -244,6 +246,7 @@ module NoBrainer::Criteria::Where
244
246
  when Symbol::Decoration
245
247
  case clause.args.size
246
248
  when 1 then parse_clause_stub(clause, clause.args.first, options)
249
+ when 2 then parse_clause_stub(clause, clause.args, options)
247
250
  else raise "Invalid argument: #{clause}"
248
251
  end
249
252
  else raise "Invalid clause: #{clause}"
@@ -263,6 +266,11 @@ module NoBrainer::Criteria::Where
263
266
  else instantiate_binary_op(key.to_sym, :eq, value, options)
264
267
  end
265
268
  when Symbol::Decoration then
269
+ # The :eq operator can have only one arg
270
+ if key.decorator == :eq && value.is_a?(Array) && value.size > 1
271
+ raise "Invalid key: #{key}"
272
+ end
273
+
266
274
  case key.decorator
267
275
  when :any, :all, :not then instantiate_binary_op(key, :eq, value, options)
268
276
  when :gte then instantiate_binary_op(key.symbol, :ge, value, options)
@@ -1,5 +1,5 @@
1
1
  module NoBrainer::SymbolDecoration
2
- NON_CHAINABLE_OPERATORS = %w(in eq gt ge gte lt le lte defined undefined near intersects include).map(&:to_sym)
2
+ NON_CHAINABLE_OPERATORS = %w(in eq gt ge gte lt le lte defined undefined near intersects include during).map(&:to_sym)
3
3
  CHAINABLE_OPERATORS = %w(not any all).map(&:to_sym)
4
4
  OPERATORS = CHAINABLE_OPERATORS + NON_CHAINABLE_OPERATORS
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nobrainer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.1
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Viennot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-25 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  - !ruby/object:Gem::Version
239
239
  version: '0'
240
240
  requirements: []
241
- rubygems_version: 3.1.4
241
+ rubygems_version: 3.1.6
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: A Ruby ORM for RethinkDB