will_paginate 3.0.4 → 3.1.0

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.
@@ -1,16 +1,29 @@
1
1
  require 'active_support'
2
+ require 'stringio'
2
3
  begin
4
+ $stderr = StringIO.new
3
5
  require 'minitest/unit'
4
6
  rescue LoadError
5
7
  # Fails on Ruby 1.8, but it's OK since we only need MiniTest::Assertions
6
8
  # on Rails 4 which doesn't support 1.8 anyway.
9
+ ensure
10
+ $stderr = STDERR
11
+ end
12
+
13
+ begin
14
+ require 'rails/dom/testing/assertions'
15
+ rescue LoadError
16
+ require 'action_dispatch/testing/assertions'
7
17
  end
8
- require 'action_dispatch/testing/assertions'
9
18
  require 'will_paginate/array'
10
19
 
11
20
  module ViewExampleGroup
12
21
 
13
- include ActionDispatch::Assertions::SelectorAssertions
22
+ if defined?(Rails::Dom::Testing::Assertions)
23
+ include Rails::Dom::Testing::Assertions::SelectorAssertions
24
+ else
25
+ include ActionDispatch::Assertions::SelectorAssertions
26
+ end
14
27
  include MiniTest::Assertions if defined? MiniTest
15
28
 
16
29
  def assert(value, message)
@@ -35,11 +48,23 @@ module ViewExampleGroup
35
48
 
36
49
  @render_output
37
50
  end
38
-
51
+
52
+ def parse_html_document(html)
53
+ @html_document ||= if defined?(Rails::Dom::Testing::Assertions)
54
+ Nokogiri::HTML::Document.parse(html)
55
+ else
56
+ HTML::Document.new(html, true, false)
57
+ end
58
+ end
59
+
39
60
  def html_document
40
- @html_document ||= HTML::Document.new(@render_output, true, false)
61
+ @html_document ||= parse_html_document(@render_output)
41
62
  end
42
-
63
+
64
+ def document_root_element
65
+ html_document.root
66
+ end
67
+
43
68
  def response_from_page_or_rjs
44
69
  html_document.root
45
70
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
5
- prerelease:
4
+ version: 3.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mislav Marohnić
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-10 00:00:00.000000000 Z
11
+ date: 2016-01-03 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: will_paginate provides a simple API for performing paginated queries
15
14
  with Active Record, DataMapper and Sequel, and includes helpers for rendering pagination
@@ -21,7 +20,9 @@ extra_rdoc_files:
21
20
  - README.md
22
21
  - LICENSE
23
22
  files:
24
- - Rakefile
23
+ - LICENSE
24
+ - README.md
25
+ - lib/will_paginate.rb
25
26
  - lib/will_paginate/active_record.rb
26
27
  - lib/will_paginate/array.rb
27
28
  - lib/will_paginate/collection.rb
@@ -30,27 +31,28 @@ files:
30
31
  - lib/will_paginate/deprecation.rb
31
32
  - lib/will_paginate/i18n.rb
32
33
  - lib/will_paginate/locale/en.yml
34
+ - lib/will_paginate/mongoid.rb
33
35
  - lib/will_paginate/page_number.rb
34
36
  - lib/will_paginate/per_page.rb
35
37
  - lib/will_paginate/railtie.rb
36
38
  - lib/will_paginate/sequel.rb
37
39
  - lib/will_paginate/version.rb
40
+ - lib/will_paginate/view_helpers.rb
38
41
  - lib/will_paginate/view_helpers/action_view.rb
39
42
  - lib/will_paginate/view_helpers/link_renderer.rb
40
43
  - lib/will_paginate/view_helpers/link_renderer_base.rb
41
44
  - lib/will_paginate/view_helpers/merb.rb
42
45
  - lib/will_paginate/view_helpers/sinatra.rb
43
- - lib/will_paginate/view_helpers.rb
44
- - lib/will_paginate.rb
45
- - spec/ci.rb
46
46
  - spec/collection_spec.rb
47
47
  - spec/console
48
48
  - spec/console_fixtures.rb
49
49
  - spec/database.yml
50
+ - spec/fake_rubygems.rb
50
51
  - spec/finders/active_record_spec.rb
51
52
  - spec/finders/activerecord_test_connector.rb
52
53
  - spec/finders/data_mapper_spec.rb
53
54
  - spec/finders/data_mapper_test_connector.rb
55
+ - spec/finders/mongoid_spec.rb
54
56
  - spec/finders/sequel_spec.rb
55
57
  - spec/finders/sequel_test_connector.rb
56
58
  - spec/fixtures/admin.rb
@@ -65,6 +67,9 @@ files:
65
67
  - spec/fixtures/topics.yml
66
68
  - spec/fixtures/user.rb
67
69
  - spec/fixtures/users.yml
70
+ - spec/matchers/deprecation_matcher.rb
71
+ - spec/matchers/phrase_matcher.rb
72
+ - spec/matchers/query_count_matcher.rb
68
73
  - spec/page_number_spec.rb
69
74
  - spec/per_page_spec.rb
70
75
  - spec/spec_helper.rb
@@ -72,34 +77,31 @@ files:
72
77
  - spec/view_helpers/base_spec.rb
73
78
  - spec/view_helpers/link_renderer_base_spec.rb
74
79
  - spec/view_helpers/view_example_group.rb
75
- - README.md
76
- - LICENSE
77
80
  homepage: https://github.com/mislav/will_paginate/wiki
78
- licenses: []
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
79
84
  post_install_message:
80
85
  rdoc_options:
81
- - --main
86
+ - "--main"
82
87
  - README.md
83
- - --charset=UTF-8
88
+ - "--charset=UTF-8"
84
89
  require_paths:
85
90
  - lib
86
91
  required_ruby_version: !ruby/object:Gem::Requirement
87
- none: false
88
92
  requirements:
89
- - - ! '>='
93
+ - - ">="
90
94
  - !ruby/object:Gem::Version
91
95
  version: '0'
92
96
  required_rubygems_version: !ruby/object:Gem::Requirement
93
- none: false
94
97
  requirements:
95
- - - ! '>='
98
+ - - ">="
96
99
  - !ruby/object:Gem::Version
97
100
  version: '0'
98
101
  requirements: []
99
102
  rubyforge_project:
100
- rubygems_version: 1.8.23
103
+ rubygems_version: 2.5.1
101
104
  signing_key:
102
- specification_version: 3
105
+ specification_version: 4
103
106
  summary: Pagination plugin for web frameworks and other apps
104
107
  test_files: []
105
- has_rdoc:
data/Rakefile DELETED
@@ -1,25 +0,0 @@
1
- begin
2
- require 'rspec/core/rake_task'
3
- rescue LoadError
4
- # no spec tasks
5
- else
6
- task :default => :spec
7
-
8
- desc 'Run ALL OF the specs'
9
- RSpec::Core::RakeTask.new(:spec) do |t|
10
- # t.ruby_opts = '-w'
11
- t.pattern = 'spec/finders/active_record_spec.rb' if ENV['DB'] and ENV['DB'] != 'sqlite3'
12
- end
13
-
14
- namespace :spec do
15
- desc "Run Rails specs"
16
- RSpec::Core::RakeTask.new(:rails) do |t|
17
- t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb'
18
- end
19
- end
20
- end
21
-
22
- desc 'Run specs against both Rails 3.1 and Rails 3.0'
23
- task :rails3 do |variable|
24
- system 'bundle exec rake spec && BUNDLE_GEMFILE=Gemfile.rails3.0 bundle exec rake spec:rails'
25
- end
data/spec/ci.rb DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- databases = %w[ sqlite3 mysql mysql2 postgres ]
3
- databases.delete 'mysql2' if ENV['BUNDLE_GEMFILE'].to_s.include? 'rails3.0'
4
-
5
- def announce(name, msg)
6
- puts "\n\e[1;33m[#{name}] #{msg}\e[m\n"
7
- end
8
-
9
- def system(*args)
10
- puts "$ #{args.join(' ')}"
11
- super
12
- end
13
-
14
- if ENV['TRAVIS']
15
- system "mysql -e 'create database will_paginate;' >/dev/null"
16
- abort "failed to create mysql database" unless $?.success?
17
- system "psql -c 'create database will_paginate;' -U postgres >/dev/null"
18
- abort "failed to create postgres database" unless $?.success?
19
- end
20
-
21
- failed = false
22
-
23
- for db in databases
24
- announce "DB", db
25
- ENV['DB'] = db
26
- failed = true unless system %(rake)
27
- end
28
-
29
- exit 1 if failed