will_paginate 3.1.5 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/will_paginate/page_number.rb +1 -1
- data/lib/will_paginate/version.rb +1 -1
- data/lib/will_paginate/view_helpers/link_renderer.rb +2 -2
- data/spec/database.yml +1 -1
- data/spec/finders/active_record_spec.rb +0 -1
- data/spec/finders/activerecord_test_connector.rb +1 -6
- data/spec/finders/data_mapper_spec.rb +3 -5
- data/spec/finders/mongoid_spec.rb +11 -6
- data/spec/finders/sequel_spec.rb +3 -5
- data/spec/page_number_spec.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 990ad7af08e5c983697a5c1c679801e1641fe3fa
|
4
|
+
data.tar.gz: be048d581649ca2a21e671ab46ea603a291ebff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5fda69cc13387b95b761efc5c697030cf36f41acbc87f513ed5eef5e629aaecab44e94a45150c4c236444d7a79c6653f446d12f4539f057f1789600682209c2
|
7
|
+
data.tar.gz: 449283390fb84c7a91fb50fd007e1f9207024ef7a8ed16b28cd6887ee2f1b1ba5e9f8a4cb4e175fd44aa4298b45bbf5164cb45d63853faa0ccd2537768f1c269
|
@@ -24,7 +24,7 @@ module WillPaginate
|
|
24
24
|
# method as you see fit.
|
25
25
|
def to_html
|
26
26
|
html = pagination.map do |item|
|
27
|
-
item.is_a?(
|
27
|
+
item.is_a?(Integer) ?
|
28
28
|
page_number(item) :
|
29
29
|
send(item)
|
30
30
|
end.join(@options[:link_separator])
|
@@ -88,7 +88,7 @@ module WillPaginate
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def link(text, target, attributes = {})
|
91
|
-
if target.is_a?
|
91
|
+
if target.is_a?(Integer)
|
92
92
|
attributes[:rel] = rel_value(target)
|
93
93
|
target = url(target)
|
94
94
|
end
|
data/spec/database.yml
CHANGED
@@ -38,7 +38,6 @@ end
|
|
38
38
|
module ActiverecordTestConnector
|
39
39
|
extend self
|
40
40
|
|
41
|
-
attr_accessor :able_to_connect
|
42
41
|
attr_accessor :connected
|
43
42
|
|
44
43
|
FIXTURES_PATH = File.expand_path('../../fixtures', __FILE__)
|
@@ -49,18 +48,14 @@ module ActiverecordTestConnector
|
|
49
48
|
|
50
49
|
# Set our defaults
|
51
50
|
self.connected = false
|
52
|
-
self.able_to_connect = true
|
53
51
|
|
54
52
|
def setup
|
55
|
-
unless self.connected
|
53
|
+
unless self.connected
|
56
54
|
setup_connection
|
57
55
|
load_schema
|
58
56
|
add_load_path FIXTURES_PATH
|
59
57
|
self.connected = true
|
60
58
|
end
|
61
|
-
rescue Exception => e # errors from ActiveRecord setup
|
62
|
-
$stderr.puts "\nSkipping ActiveRecord tests: #{e}\n\n"
|
63
|
-
self.able_to_connect = false
|
64
59
|
end
|
65
60
|
|
66
61
|
private
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
if !ENV['SKIP_NONRAILS_TESTS']
|
4
4
|
require 'will_paginate/data_mapper'
|
5
5
|
require File.expand_path('../data_mapper_test_connector', __FILE__)
|
6
|
-
rescue LoadError => error
|
7
|
-
warn "Error running DataMapper specs: #{error.message}"
|
8
|
-
datamapper_loaded = false
|
9
|
-
else
|
10
6
|
datamapper_loaded = true
|
7
|
+
else
|
8
|
+
datamapper_loaded = false
|
11
9
|
end
|
12
10
|
|
13
11
|
describe WillPaginate::DataMapper do
|
@@ -1,18 +1,23 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
if !ENV['SKIP_NONRAILS_TESTS']
|
4
|
+
if defined?(Rails)
|
5
|
+
old_rails = Rails
|
6
|
+
# Mongoid sees the `Rails` constant and then proceeds to `require "rails"`
|
7
|
+
# from its railtie. This tricks it into believing there is no Rails.
|
8
|
+
Object.send(:remove_const, :Rails)
|
9
|
+
end
|
4
10
|
require 'will_paginate/mongoid'
|
5
|
-
|
6
|
-
warn "Error running Mongoid specs: #{error.message}"
|
7
|
-
mongoid_loaded = false
|
8
|
-
else
|
9
|
-
Mongoid.connect_to 'will_paginate_test'
|
11
|
+
Object.send(:const_set, :Rails, old_rails) if old_rails
|
10
12
|
|
13
|
+
Mongoid.connect_to 'will_paginate_test'
|
11
14
|
class MongoidModel
|
12
15
|
include Mongoid::Document
|
13
16
|
end
|
14
17
|
|
15
18
|
mongoid_loaded = true
|
19
|
+
else
|
20
|
+
mongoid_loaded = false
|
16
21
|
end
|
17
22
|
|
18
23
|
describe WillPaginate::Mongoid do
|
data/spec/finders/sequel_spec.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
if !ENV['SKIP_NONRAILS_TESTS']
|
4
4
|
require 'will_paginate/sequel'
|
5
5
|
require File.expand_path('../sequel_test_connector', __FILE__)
|
6
|
-
rescue LoadError, ArgumentError => error
|
7
|
-
warn "Error running Sequel specs: #{error.message}"
|
8
|
-
sequel_loaded = false
|
9
|
-
else
|
10
6
|
sequel_loaded = true
|
7
|
+
else
|
8
|
+
sequel_loaded = false
|
11
9
|
end
|
12
10
|
|
13
11
|
describe Sequel::Dataset::Pagination, 'extension' do
|
data/spec/page_number_spec.rb
CHANGED
@@ -23,12 +23,12 @@ describe WillPaginate::PageNumber do
|
|
23
23
|
(num.is_a? Numeric).should be
|
24
24
|
end
|
25
25
|
|
26
|
-
it "is a kind of
|
27
|
-
(num.is_a?
|
26
|
+
it "is a kind of Integer" do
|
27
|
+
(num.is_a? Integer).should be
|
28
28
|
end
|
29
29
|
|
30
|
-
it "isn't directly a
|
31
|
-
(num.instance_of?
|
30
|
+
it "isn't directly a Integer" do
|
31
|
+
(num.instance_of? Integer).should_not be
|
32
32
|
end
|
33
33
|
|
34
34
|
it "passes the PageNumber=== type check" do |variable|
|
@@ -37,7 +37,7 @@ describe WillPaginate::PageNumber do
|
|
37
37
|
|
38
38
|
it "passes the Numeric=== type check" do |variable|
|
39
39
|
(Numeric === num).should be
|
40
|
-
(
|
40
|
+
(Integer === num).should be
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mislav Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: will_paginate provides a simple API for performing paginated queries
|
14
14
|
with Active Record, DataMapper and Sequel, and includes helpers for rendering pagination
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.5.1
|
103
|
+
rubygems_version: 2.4.5.1
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Pagination plugin for web frameworks and other apps
|