geared_pagination 1.1.0 → 1.1.1

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: 05c58b3498b3b341fd11f5500545278837414633b714f7c02aca2c3718c86227
4
- data.tar.gz: b3c4729222ff73faf62566f48187ae522544a1491a6fba02ff4b921e24c1dcbd
3
+ metadata.gz: 750005ac1e001628bcb41a5fc7ff8c3816882df33785ff6038833d17ea9ea895
4
+ data.tar.gz: 983b5d46b9cb9174b1ced7931a0015b2d202f7f3bd578d6fd0172878ba57947a
5
5
  SHA512:
6
- metadata.gz: c327c83175f3a27a8a91732ab3ae81c3c5d0f0da3ef54726a0d30042e7bb90b4ba933781ccee5b57cc7808c477e9bb12b5e67204e0c2417450a82350eeeadacf
7
- data.tar.gz: ed877d95bad4a4d4083ee05f02d7211aa9e28c96eaf948cd387baa7b930373d5e08227024268bd1efef46c8fa75f84ac71c297a9080626c9c39ce8148e6e1e1c
6
+ metadata.gz: e66422eaa4008173bef8c798283f9b56a73853e88453b7d12fee2a6f5e0d0c88af0ab145fd83972bd41af017cafe35c4e306750aa75cb556ffd2bb51c465f208
7
+ data.tar.gz: 5e76d1a248cf859854b3c53eaaadcba3d14f11e4dd14dafbbca2cef30eeb1f6d791b35db386a9131eb2b9f0e4671921dcbd6171005da0f4d9dca90e0bbe9b453
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geared_pagination (1.1.0)
4
+ geared_pagination (1.1.1)
5
5
  activesupport (>= 5.0)
6
6
  addressable (>= 2.5.0)
7
7
 
@@ -82,7 +82,9 @@ GEM
82
82
  marcel (0.3.3)
83
83
  mimemagic (~> 0.3.2)
84
84
  method_source (1.0.0)
85
- mimemagic (0.3.5)
85
+ mimemagic (0.3.10)
86
+ nokogiri (~> 1)
87
+ rake
86
88
  mini_mime (1.0.2)
87
89
  mini_portile2 (2.4.0)
88
90
  minitest (5.14.0)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'geared_pagination'
3
- s.version = '1.1.0'
3
+ s.version = '1.1.1'
4
4
  s.authors = 'David Heinemeier Hansson'
5
5
  s.email = 'david@basecamp.com'
6
6
  s.summary = 'Paginate Active Record sets at variable speeds'
@@ -6,6 +6,8 @@ module GearedPagination
6
6
  class << self
7
7
  def from_param(key)
8
8
  key.present? ? decode(key) : new
9
+ rescue ArgumentError, JSON::ParserError
10
+ new
9
11
  end
10
12
 
11
13
  def decode(key)
data/test/cursor_test.rb CHANGED
@@ -7,6 +7,11 @@ class GearedPagination::CursorTest < ActiveSupport::TestCase
7
7
  assert_equal 1, GearedPagination::Cursor.from_param(" ").page_number
8
8
  end
9
9
 
10
+ test "from an invalid param" do
11
+ assert_equal 1, GearedPagination::Cursor.from_param("aGVsbG8K").page_number
12
+ assert_equal 1, GearedPagination::Cursor.from_param("\o/ not base64").page_number
13
+ end
14
+
10
15
  test "decode" do
11
16
  assert_equal 1, GearedPagination::Cursor.decode("eyJwYWdlX251bWJlciI6MX0=").page_number
12
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geared_pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.12'
55
- description:
55
+ description:
56
56
  email: david@basecamp.com
57
57
  executables: []
58
58
  extensions: []
@@ -162,7 +162,7 @@ homepage: https://github.com/basecamp/geared_pagination
162
162
  licenses:
163
163
  - MIT
164
164
  metadata: {}
165
- post_install_message:
165
+ post_install_message:
166
166
  rdoc_options: []
167
167
  require_paths:
168
168
  - lib
@@ -177,8 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubygems_version: 3.0.3
181
- signing_key:
180
+ rubygems_version: 3.1.4
181
+ signing_key:
182
182
  specification_version: 4
183
183
  summary: Paginate Active Record sets at variable speeds
184
184
  test_files: