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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b9c92a0ce3f9e697334ea1bf11c0b57bdfd9fe2
4
- data.tar.gz: b2794b2de86ceaa34f86d06f2c1952484b5409f9
3
+ metadata.gz: 990ad7af08e5c983697a5c1c679801e1641fe3fa
4
+ data.tar.gz: be048d581649ca2a21e671ab46ea603a291ebff8
5
5
  SHA512:
6
- metadata.gz: fe7a7e48c35bda6cd6648f5243f3992ebe576f586afd5d140066fa05ecdd83862681245f44e554f5483e5dc4fe9f957e3b84b6208cc91a8e1dd1804c8593a49b
7
- data.tar.gz: 5c388ced4fd0b8ad3da2ce6c5e9b2323b4cff1b950fdf3b35cc6e148b1e12509e8b6c0b83156b483d1a732ce4fe2497a4c09553b2650775cc922803699bf4347
6
+ metadata.gz: d5fda69cc13387b95b761efc5c697030cf36f41acbc87f513ed5eef5e629aaecab44e94a45150c4c236444d7a79c6653f446d12f4539f057f1789600682209c2
7
+ data.tar.gz: 449283390fb84c7a91fb50fd007e1f9207024ef7a8ed16b28cd6887ee2f1b1ba5e9f8a4cb4e175fd44aa4298b45bbf5164cb45d63853faa0ccd2537768f1c269
@@ -40,7 +40,7 @@ module WillPaginate
40
40
  alias is_a? kind_of?
41
41
  end
42
42
 
43
- # Ultrahax: makes `Fixnum === current_page` checks pass
43
+ # Ultrahax: makes `Integer === current_page` checks pass
44
44
  Numeric.extend Module.new {
45
45
  def ===(obj)
46
46
  obj.instance_of? PageNumber or super
@@ -2,7 +2,7 @@ module WillPaginate #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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?(Fixnum) ?
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? Fixnum
91
+ if target.is_a?(Integer)
92
92
  attributes[:rel] = rel_value(target)
93
93
  target = url(target)
94
94
  end
@@ -6,7 +6,7 @@ sqlite3:
6
6
  mysql: &mysql
7
7
  adapter: mysql
8
8
  database: will_paginate
9
- username:
9
+ username: root
10
10
  encoding: utf8
11
11
  <% if File.exist?("/var/run/mysql5/mysqld.sock") %>
12
12
  host: localhost
@@ -3,7 +3,6 @@ require 'will_paginate/active_record'
3
3
  require File.expand_path('../activerecord_test_connector', __FILE__)
4
4
 
5
5
  ActiverecordTestConnector.setup
6
- abort unless ActiverecordTestConnector.able_to_connect
7
6
 
8
7
  describe WillPaginate::ActiveRecord do
9
8
 
@@ -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 || !self.able_to_connect
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
- begin
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
- begin
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
- rescue LoadError => error
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
@@ -1,13 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
- begin
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
@@ -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 Fixnum" do
27
- (num.is_a? Fixnum).should be
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 Fixnum" do
31
- (num.instance_of? Fixnum).should_not be
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
- (Fixnum === num).should be
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.5
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: 2016-10-15 00:00:00.000000000 Z
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