rhino_project_core 0.22.0.beta.6 → 0.22.0.beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b642fee59635a246c0176684fafeea2361dbe9018ee49cc7de781fff41a4f32
4
- data.tar.gz: 3b458fc37810a55c6c924781d684d039c6c6365a152c3afb0abdf9cf4e82a612
3
+ metadata.gz: ff72f569e06461388653d0301fc523626fb2d738bce4cee23eeb097790a89948
4
+ data.tar.gz: 0b742c43b55c24367a7294f24c273b9d6a75719368d2a9163734110b22d74afb
5
5
  SHA512:
6
- metadata.gz: 4182c3a6e0fed89f86233a5438c4505e1436451a3b8f7543fc8968f114eea5f7d5ddf281214cb345daa86e88358e357cb9ecc747b65d92f416cd8052f80c3678
7
- data.tar.gz: 7ba2325b3a48ef9939e3ace9dfa4dac2e0fc471c9885533729d6e7ef808434d9267d7f698cafaa66b6d467479842dc46295a74a24137c2e15a7c9c57b557313b
6
+ metadata.gz: 5d043f55d66eb179c98da96d004b5d06ee7c17e2e67d39b046734d0f08831022c34294eae5809dc49d17900883ad267e05150c2176e512692651019e4a98b749
7
+ data.tar.gz: 666c16e6a708464cd628814ade3ba3d451b8490abf1a6450e7dad80b7544a000a4a07a264e8df1b3d2a258da8f40b5a5e4333e5c8a0cfcde979af989c506a089
@@ -3,17 +3,23 @@
3
3
  module Rhino
4
4
  module Sieve
5
5
  class Limit
6
- attr_accessor :default_limit
6
+ attr_accessor :default_limit, :max_limit
7
7
 
8
- def initialize(app, default_limit: 20)
8
+ def initialize(app, default_limit: 20, max_limit: 100)
9
9
  @app = app
10
10
 
11
11
  @default_limit = default_limit
12
+ @max_limit = max_limit
12
13
  end
13
14
 
14
15
  # limit=20
15
16
  def resolve(scope, params)
16
- @app.resolve(scope.limit(params[:limit] || default_limit), params)
17
+ # If we get a non-nil limit param we try and construct it as an integer
18
+ # Otherwise we use the default
19
+ param_limit = params[:limit].nil? ? default_limit : params[:limit].to_i
20
+
21
+ # Don't allow a limit above the max_limit
22
+ @app.resolve(scope.limit([param_limit, max_limit].min), params)
17
23
  end
18
24
  end
19
25
  end
data/lib/rhino/version.rb CHANGED
@@ -10,7 +10,7 @@ module Rhino
10
10
  MAJOR = 0
11
11
  MINOR = 22
12
12
  TINY = 0
13
- PRE = "beta.6"
13
+ PRE = "beta.7"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhino_project_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0.beta.6
4
+ version: 0.22.0.beta.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Rosevear
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-06 00:00:00.000000000 Z
11
+ date: 2024-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails