rails_pagination 2.0.10 → 2.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.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. metadata +18 -174
  3. data/MIT-LICENSE +0 -20
  4. data/README.rdoc +0 -46
  5. data/Rakefile +0 -40
  6. data/app/views/rails_pagination/_pager.html.erb +0 -29
  7. data/config/locales/en.yml +0 -6
  8. data/config/locales/es.yml +0 -6
  9. data/lib/rails_pagination.rb +0 -11
  10. data/lib/rails_pagination/action_view/base.rb +0 -15
  11. data/lib/rails_pagination/active_record/base.rb +0 -28
  12. data/lib/rails_pagination/active_record/relation.rb +0 -81
  13. data/lib/rails_pagination/engine.rb +0 -7
  14. data/lib/rails_pagination/navigation.rb +0 -39
  15. data/lib/rails_pagination/pagination.rb +0 -97
  16. data/lib/rails_pagination/railtie.rb +0 -15
  17. data/lib/rails_pagination/version.rb +0 -5
  18. data/test/collection_empty_test.rb +0 -37
  19. data/test/collection_first_test.rb +0 -38
  20. data/test/collection_last_test.rb +0 -38
  21. data/test/collection_middle_test.rb +0 -38
  22. data/test/collection_padding_test.rb +0 -83
  23. data/test/dummy/README.rdoc +0 -261
  24. data/test/dummy/Rakefile +0 -7
  25. data/test/dummy/app/assets/javascripts/application.js +0 -15
  26. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  27. data/test/dummy/app/controllers/application_controller.rb +0 -3
  28. data/test/dummy/app/controllers/test_controller.rb +0 -7
  29. data/test/dummy/app/helpers/application_helper.rb +0 -2
  30. data/test/dummy/app/models/model.rb +0 -3
  31. data/test/dummy/app/views/layouts/application.html.erb +0 -12
  32. data/test/dummy/app/views/test/index.html.erb +0 -1
  33. data/test/dummy/config.ru +0 -4
  34. data/test/dummy/config/application.rb +0 -59
  35. data/test/dummy/config/boot.rb +0 -10
  36. data/test/dummy/config/database.yml +0 -25
  37. data/test/dummy/config/environment.rb +0 -5
  38. data/test/dummy/config/environments/development.rb +0 -37
  39. data/test/dummy/config/environments/production.rb +0 -67
  40. data/test/dummy/config/environments/test.rb +0 -37
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  42. data/test/dummy/config/initializers/inflections.rb +0 -15
  43. data/test/dummy/config/initializers/mime_types.rb +0 -5
  44. data/test/dummy/config/initializers/secret_token.rb +0 -7
  45. data/test/dummy/config/initializers/session_store.rb +0 -8
  46. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  47. data/test/dummy/config/locales/en.yml +0 -5
  48. data/test/dummy/config/routes.rb +0 -61
  49. data/test/dummy/db/development.sqlite3 +0 -0
  50. data/test/dummy/db/migrate/20120908215532_create_models.rb +0 -8
  51. data/test/dummy/db/schema.rb +0 -22
  52. data/test/dummy/db/test.sqlite3 +0 -0
  53. data/test/dummy/log/development.log +0 -3129
  54. data/test/dummy/log/test.log +0 -201719
  55. data/test/dummy/public/404.html +0 -26
  56. data/test/dummy/public/422.html +0 -26
  57. data/test/dummy/public/500.html +0 -25
  58. data/test/dummy/public/favicon.ico +0 -0
  59. data/test/dummy/script/rails +0 -6
  60. data/test/dummy/tmp/cache/assets/CBF/7A0/sprockets%2Fc9192594b6d1b927590d37ebad844808 +0 -0
  61. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  62. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  63. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  64. data/test/dummy/tmp/cache/assets/D50/930/sprockets%2F277654ad498bbc928b88364ffcbad129 +0 -0
  65. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  66. data/test/dummy/tmp/cache/assets/D9B/E00/sprockets%2Fb66a75bd10bef6da5f16f4fa9113926c +0 -0
  67. data/test/dummy/tmp/cache/assets/DAC/650/sprockets%2Ff8ec2e25f819797cb9a491d0af22ae9b +0 -0
  68. data/test/dummy/tmp/cache/assets/DB2/700/sprockets%2Fa4f4b12a5cbea015faede527e4a04307 +0 -0
  69. data/test/dummy/tmp/cache/assets/DD5/C50/sprockets%2Fcdcdad84697d0b186a1de99f1950e5ab +0 -0
  70. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  71. data/test/dummy/tmp/cache/assets/DEF/100/sprockets%2F8b9d88bfa8f8eed7910469ef2ab8a8c7 +0 -0
  72. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  73. data/test/dummy/tmp/cache/assets/E29/AA0/sprockets%2F6eaab4ab4dbae1b8b5a6f9286aa966d4 +0 -0
  74. data/test/helpers_empty_test.rb +0 -42
  75. data/test/helpers_first_test.rb +0 -43
  76. data/test/helpers_last_test.rb +0 -43
  77. data/test/helpers_middle_test.rb +0 -43
  78. data/test/test_helper.rb +0 -21
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,42 +0,0 @@
1
- require 'test_helper'
2
-
3
- class HelpersEmptyTest < ActionView::TestCase
4
- include RailsPagination::ActionView::Base
5
-
6
- setup do
7
- @pager = paginate(Model.page(1).per(2), navigation: 3, parameter: :page)
8
- end
9
-
10
- test "should not have multiple pages" do
11
- assert !@pager.has_multiple_pages?
12
- end
13
-
14
- test "should not have first page" do
15
- assert !@pager.has_first_page?
16
- end
17
-
18
- test "should not have previous page" do
19
- assert !@pager.has_previous_page?
20
- end
21
-
22
- test "should not have next page" do
23
- assert !@pager.has_next_page?
24
- end
25
-
26
- test "should not have last page" do
27
- assert !@pager.has_last_page?
28
- end
29
-
30
- test "should not have less pages" do
31
- assert !@pager.navigation.has_less_pages?
32
- end
33
-
34
- test "should start at 1 and end at 1" do
35
- assert_equal @pager.navigation.pages, 1..1
36
- end
37
-
38
- test "shuld not have more pages" do
39
- assert !@pager.navigation.has_more_pages?
40
- end
41
-
42
- end
@@ -1,43 +0,0 @@
1
- require 'test_helper'
2
-
3
- class HelpersFirstTest < ActionView::TestCase
4
- include RailsPagination::ActionView::Base
5
-
6
- setup do
7
- 10.times.each { |id| Model.create title: "Record #{id}" }
8
- @pager = paginate(Model.page(1).per(2), navigation: 3, parameter: :page)
9
- end
10
-
11
- test "should have multiple pages" do
12
- assert @pager.has_multiple_pages?
13
- end
14
-
15
- test "should not have first page" do
16
- assert !@pager.has_first_page?
17
- end
18
-
19
- test "should not have previous page" do
20
- assert !@pager.has_previous_page?
21
- end
22
-
23
- test "should have next page" do
24
- assert @pager.has_next_page?
25
- end
26
-
27
- test "should have last page" do
28
- assert @pager.has_last_page?
29
- end
30
-
31
- test "should not have less pages" do
32
- assert !@pager.navigation.has_less_pages?
33
- end
34
-
35
- test "should have start at 1 and end at 3" do
36
- assert_equal @pager.navigation.pages, 1..3
37
- end
38
-
39
- test "shuld have more pages" do
40
- assert @pager.navigation.has_more_pages?
41
- end
42
-
43
- end
@@ -1,43 +0,0 @@
1
- require 'test_helper'
2
-
3
- class HelpersLastTest < ActionView::TestCase
4
- include RailsPagination::ActionView::Base
5
-
6
- setup do
7
- 10.times.each { |id| Model.create title: "Record #{id}" }
8
- @pager = paginate(Model.page(5).per(2), navigation: 3, parameter: :page)
9
- end
10
-
11
- test "should have multiple pages" do
12
- assert @pager.has_multiple_pages?
13
- end
14
-
15
- test "should have first page" do
16
- assert @pager.has_first_page?
17
- end
18
-
19
- test "should have previous page" do
20
- assert @pager.has_previous_page?
21
- end
22
-
23
- test "should not have next page" do
24
- assert !@pager.has_next_page?
25
- end
26
-
27
- test "should not have last page" do
28
- assert !@pager.has_last_page?
29
- end
30
-
31
- test "should have less pages" do
32
- assert @pager.navigation.has_less_pages?
33
- end
34
-
35
- test "should start at 3 and end at 5" do
36
- assert_equal @pager.navigation.pages, 3..5
37
- end
38
-
39
- test "shuld not have more pages" do
40
- assert !@pager.navigation.has_more_pages?
41
- end
42
-
43
- end
@@ -1,43 +0,0 @@
1
- require 'test_helper'
2
-
3
- class HelpersMiddleTest < ActionView::TestCase
4
- include RailsPagination::ActionView::Base
5
-
6
- setup do
7
- 10.times.each { |id| Model.create title: "Record #{id}" }
8
- @pager = paginate(Model.page(3).per(2), navigation: 3, parameter: :page)
9
- end
10
-
11
- test "should have multiple pages" do
12
- assert @pager.has_multiple_pages?
13
- end
14
-
15
- test "should have first page" do
16
- assert @pager.has_first_page?
17
- end
18
-
19
- test "should have previous page" do
20
- assert @pager.has_previous_page?
21
- end
22
-
23
- test "should have next page" do
24
- assert @pager.has_next_page?
25
- end
26
-
27
- test "should have last page" do
28
- assert @pager.has_last_page?
29
- end
30
-
31
- test "should have less pages" do
32
- assert @pager.navigation.has_less_pages?
33
- end
34
-
35
- test "should start at 2 and end at 4" do
36
- assert_equal @pager.navigation.pages, 2..4
37
- end
38
-
39
- test "shuld have more pages" do
40
- assert @pager.navigation.has_more_pages?
41
- end
42
-
43
- end
@@ -1,21 +0,0 @@
1
- # Configure Rails Environment
2
- ENV['RAILS_ENV'] = 'test'
3
-
4
- require File.expand_path('../dummy/config/environment.rb', __FILE__)
5
- require 'rails/test_help'
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
-
12
- # Load fixtures from the engine
13
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
- ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__)
15
- end
16
-
17
- # Load database
18
- config = YAML::load(File.read(File.expand_path('../dummy/config/database.yml', __FILE__)))
19
- config['test']['adapter'] = 'jdbcsqlite3' if RUBY_PLATFORM == 'java'
20
- ActiveRecord::Base.establish_connection(config['test'])
21
- load(File.expand_path('../dummy/db/schema.rb', __FILE__))