ajax_pagination 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/.gitignore +1 -1
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +30 -3
  4. data/Rakefile +10 -0
  5. data/ajax_pagination.gemspec +1 -1
  6. data/lib/ajax_pagination/version.rb +1 -1
  7. data/lib/generators/ajax_pagination/assets_generator.rb +37 -0
  8. data/spec/R30PORT +1 -0
  9. data/spec/ajax_pagination/integration/ajaxpaginate_spec.rb +85 -75
  10. data/spec/ajax_pagination/integration/rails30_spec.rb +35 -0
  11. data/spec/rails30_app/.gitignore +8 -0
  12. data/spec/rails30_app/Gemfile +28 -0
  13. data/spec/rails30_app/Gemfile.lock +96 -0
  14. data/spec/rails30_app/Rakefile +7 -0
  15. data/spec/rails30_app/app/controllers/application_controller.rb +13 -0
  16. data/spec/rails30_app/app/controllers/changelog_controller.rb +12 -0
  17. data/spec/rails30_app/app/controllers/pages_controller.rb +28 -0
  18. data/spec/rails30_app/app/controllers/sessions_controller.rb +9 -0
  19. data/spec/rails30_app/app/helpers/application_helper.rb +2 -0
  20. data/spec/rails30_app/app/helpers/posts_helper.rb +2 -0
  21. data/spec/rails30_app/app/mailers/.gitkeep +0 -0
  22. data/spec/rails30_app/app/models/.gitkeep +0 -0
  23. data/spec/rails30_app/app/models/changelog.rb +19 -0
  24. data/spec/rails30_app/app/views/changelog/_page.html.erb +10 -0
  25. data/spec/rails30_app/app/views/changelog/index.html.erb +3 -0
  26. data/spec/rails30_app/app/views/layouts/ajax.html.erb +8 -0
  27. data/spec/rails30_app/app/views/layouts/application.html.erb +49 -0
  28. data/spec/rails30_app/app/views/layouts/flash.html.erb +7 -0
  29. data/spec/rails30_app/app/views/pages/about.html.erb +4 -0
  30. data/spec/rails30_app/app/views/pages/readme.html.erb +4 -0
  31. data/spec/rails30_app/app/views/pages/warnings.html.erb +43 -0
  32. data/spec/rails30_app/app/views/pages/welcome.html.erb +6 -0
  33. data/spec/rails30_app/app/views/sessions/count.html.erb +7 -0
  34. data/spec/rails30_app/config.ru +4 -0
  35. data/spec/rails30_app/config/application.rb +53 -0
  36. data/spec/rails30_app/config/boot.rb +10 -0
  37. data/spec/rails30_app/config/database.yml +25 -0
  38. data/spec/rails30_app/config/environment.rb +6 -0
  39. data/spec/rails30_app/config/environments/development.rb +25 -0
  40. data/spec/rails30_app/config/environments/production.rb +43 -0
  41. data/spec/rails30_app/config/environments/test.rb +30 -0
  42. data/spec/rails30_app/config/initializers/ajax_pagination.rb +12 -0
  43. data/spec/rails30_app/config/initializers/backtrace_silencers.rb +7 -0
  44. data/spec/rails30_app/config/initializers/inflections.rb +15 -0
  45. data/spec/rails30_app/config/initializers/mime_types.rb +5 -0
  46. data/spec/rails30_app/config/initializers/secret_token.rb +7 -0
  47. data/spec/rails30_app/config/initializers/session_store.rb +8 -0
  48. data/spec/rails30_app/config/locales/en.yml +5 -0
  49. data/spec/rails30_app/config/routes.rb +71 -0
  50. data/spec/rails30_app/log/.gitkeep +0 -0
  51. data/spec/rails30_app/public/404.html +26 -0
  52. data/spec/rails30_app/public/422.html +26 -0
  53. data/spec/rails30_app/public/500.html +25 -0
  54. data/spec/rails30_app/public/favicon.ico +0 -0
  55. data/spec/rails30_app/public/images/ajax-loader.gif +0 -0
  56. data/spec/rails30_app/public/javascripts/ajax_pagination.js +380 -0
  57. data/spec/rails30_app/public/javascripts/history.js +4 -0
  58. data/spec/rails30_app/public/javascripts/history_adapter_jquery.js +77 -0
  59. data/spec/rails30_app/public/javascripts/history_core.js +1943 -0
  60. data/spec/rails30_app/public/javascripts/history_html4.js +621 -0
  61. data/spec/rails30_app/public/javascripts/jquery-ui.js +11767 -0
  62. data/spec/rails30_app/public/javascripts/jquery-ui.min.js +791 -0
  63. data/spec/rails30_app/public/javascripts/jquery.ba-bbq.js +18 -0
  64. data/spec/rails30_app/public/javascripts/jquery.js +9266 -0
  65. data/spec/rails30_app/public/javascripts/jquery.min.js +4 -0
  66. data/spec/rails30_app/public/javascripts/jquery.url.js +160 -0
  67. data/spec/rails30_app/public/javascripts/jquery_ujs.js +373 -0
  68. data/spec/rails30_app/public/javascripts/json2.js +487 -0
  69. data/spec/rails30_app/public/stylesheets/ajax_pagination.css +24 -0
  70. data/spec/rails30_app/public/stylesheets/application.css +12 -0
  71. data/spec/rails30_app/public/stylesheets/scaffold.css +56 -0
  72. data/spec/rails30_app/script/rails +6 -0
  73. data/spec/rails_app/Gemfile.lock +107 -0
  74. data/spec/spec_helper.rb +16 -1
  75. metadata +72 -10
  76. data/spec/rails_app/test/fixtures/posts.yml +0 -9
  77. data/spec/rails_app/test/functional/posts_controller_test.rb +0 -49
  78. data/spec/rails_app/test/unit/helpers/posts_helper_test.rb +0 -4
  79. data/spec/rails_app/test/unit/post_test.rb +0 -7
@@ -0,0 +1,24 @@
1
+ .ajaxpagination-loadzone > .margin-top {
2
+ height: 50px;
3
+ max-height: 12.5%;
4
+ width: 100%;
5
+ }
6
+
7
+ .ajaxpagination-loader {
8
+ max-height: 87.5%;
9
+ }
10
+
11
+ .ajaxpagination-oldcontent {
12
+ opacity: 0.4;
13
+ }
14
+
15
+ .ajaxpagination-loadzone {
16
+ position: absolute;
17
+ left: 0;
18
+ top: 0;
19
+ width: 100%;
20
+ height: 100%;
21
+ text-align: center;
22
+ opacity: 0.9;
23
+ }
24
+
@@ -0,0 +1,12 @@
1
+ .menu ul li {
2
+ display: inline-block;
3
+ border: 1px solid black;
4
+ }
5
+ .menu ul li a {
6
+ padding-left: 30px;
7
+ padding-right: 30px;
8
+ }
9
+
10
+ #alert {
11
+ color: red;
12
+ }
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby1.8
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'
@@ -0,0 +1,107 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ ajax_pagination (0.5.1)
5
+ jquery-historyjs
6
+ jquery-rails (>= 1.0.17)
7
+ rails (>= 3.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionmailer (3.2.1)
13
+ actionpack (= 3.2.1)
14
+ mail (~> 2.4.0)
15
+ actionpack (3.2.1)
16
+ activemodel (= 3.2.1)
17
+ activesupport (= 3.2.1)
18
+ builder (~> 3.0.0)
19
+ erubis (~> 2.7.0)
20
+ journey (~> 1.0.1)
21
+ rack (~> 1.4.0)
22
+ rack-cache (~> 1.1)
23
+ rack-test (~> 0.6.1)
24
+ sprockets (~> 2.1.2)
25
+ activemodel (3.2.1)
26
+ activesupport (= 3.2.1)
27
+ builder (~> 3.0.0)
28
+ activerecord (3.2.1)
29
+ activemodel (= 3.2.1)
30
+ activesupport (= 3.2.1)
31
+ arel (~> 3.0.0)
32
+ tzinfo (~> 0.3.29)
33
+ activeresource (3.2.1)
34
+ activemodel (= 3.2.1)
35
+ activesupport (= 3.2.1)
36
+ activesupport (3.2.1)
37
+ i18n (~> 0.6)
38
+ multi_json (~> 1.0)
39
+ arel (3.0.2)
40
+ builder (3.0.0)
41
+ erubis (2.7.0)
42
+ hike (1.2.1)
43
+ i18n (0.6.0)
44
+ journey (1.0.3)
45
+ jquery-historyjs (0.2.2)
46
+ railties (>= 3.0)
47
+ thor (>= 0.14)
48
+ jquery-rails (2.0.1)
49
+ railties (>= 3.2.0, < 5.0)
50
+ thor (~> 0.14)
51
+ json (1.6.5)
52
+ mail (2.4.1)
53
+ i18n (>= 0.4.0)
54
+ mime-types (~> 1.16)
55
+ treetop (~> 1.4.8)
56
+ mime-types (1.17.2)
57
+ multi_json (1.1.0)
58
+ polyglot (0.3.3)
59
+ rack (1.4.1)
60
+ rack-cache (1.2)
61
+ rack (>= 0.4)
62
+ rack-ssl (1.3.2)
63
+ rack
64
+ rack-test (0.6.1)
65
+ rack (>= 1.0)
66
+ rails (3.2.1)
67
+ actionmailer (= 3.2.1)
68
+ actionpack (= 3.2.1)
69
+ activerecord (= 3.2.1)
70
+ activeresource (= 3.2.1)
71
+ activesupport (= 3.2.1)
72
+ bundler (~> 1.0)
73
+ railties (= 3.2.1)
74
+ railties (3.2.1)
75
+ actionpack (= 3.2.1)
76
+ activesupport (= 3.2.1)
77
+ rack-ssl (~> 1.3.2)
78
+ rake (>= 0.8.7)
79
+ rdoc (~> 3.4)
80
+ thor (~> 0.14.6)
81
+ rake (0.9.2.2)
82
+ rdoc (3.12)
83
+ json (~> 1.4)
84
+ sprockets (2.1.2)
85
+ hike (~> 1.2)
86
+ rack (~> 1.0)
87
+ tilt (~> 1.1, != 1.3.0)
88
+ sqlite3 (1.3.5)
89
+ thor (0.14.6)
90
+ tilt (1.3.3)
91
+ treetop (1.4.10)
92
+ polyglot
93
+ polyglot (>= 0.3.1)
94
+ tzinfo (0.3.32)
95
+ will_paginate (3.0.3)
96
+
97
+ PLATFORMS
98
+ ruby
99
+
100
+ DEPENDENCIES
101
+ ajax_pagination!
102
+ jquery-historyjs
103
+ jquery-rails
104
+ json
105
+ rails (= 3.2.1)
106
+ sqlite3
107
+ will_paginate
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  ENV["RAILS_ENV"] = "test"
2
2
 
3
3
  require File.expand_path("../rails_app/config/environment.rb", __FILE__)
4
- #require "rails_app/config/environment"
4
+
5
5
  require 'rspec/rails'
6
6
  require 'capybara/rspec'
7
7
  require 'capybara'
@@ -27,3 +27,18 @@ include Capybara::DSL
27
27
  SERVERPORT = IO.read(File.expand_path("../PORT",__FILE__)).strip # port number that we are using
28
28
  SERVERSLOWPORT = IO.read(File.expand_path("../SLOWPORT",__FILE__)).strip # a port with artificially slowed down loading
29
29
 
30
+ R30SERVERPORT = IO.read(File.expand_path("../R30PORT",__FILE__)).strip # port number for rails 3.0 app
31
+
32
+ module Retryable
33
+ # retry code n times
34
+ def retry_exceptions(n = 3)
35
+ i=0
36
+ begin
37
+ yield
38
+ rescue
39
+ retry if (i += 1) < n
40
+ raise # if not retrying then raise
41
+ end
42
+ end
43
+ end
44
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajax_pagination
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ronald Ping Man Chan
@@ -95,11 +95,11 @@ dependencies:
95
95
  requirements:
96
96
  - - ">="
97
97
  - !ruby/object:Gem::Version
98
- hash: 5
98
+ hash: 7
99
99
  segments:
100
100
  - 3
101
- - 1
102
- version: "3.1"
101
+ - 0
102
+ version: "3.0"
103
103
  type: :runtime
104
104
  version_requirements: *id006
105
105
  - !ruby/object:Gem::Dependency
@@ -161,9 +161,11 @@ files:
161
161
  - lib/assets/images/ajax-loader.gif
162
162
  - lib/assets/javascripts/ajax_pagination.js.erb
163
163
  - lib/assets/stylesheets/ajax_pagination.css
164
+ - lib/generators/ajax_pagination/assets_generator.rb
164
165
  - lib/generators/ajax_pagination/install_generator.rb
165
166
  - lib/generators/templates/ajax_pagination.rb
166
167
  - spec/PORT
168
+ - spec/R30PORT
167
169
  - spec/SLOWPORT
168
170
  - spec/ajax_pagination/controller_additions_spec.rb
169
171
  - spec/ajax_pagination/helper_additions_spec.rb
@@ -171,9 +173,73 @@ files:
171
173
  - spec/ajax_pagination/integration/disabled_spec.rb
172
174
  - spec/ajax_pagination/integration/nojavascript_spec.rb
173
175
  - spec/ajax_pagination/integration/paginate_spec.rb
176
+ - spec/ajax_pagination/integration/rails30_spec.rb
174
177
  - spec/ajax_pagination/integration/warnings_spec.rb
178
+ - spec/rails30_app/.gitignore
179
+ - spec/rails30_app/Gemfile
180
+ - spec/rails30_app/Gemfile.lock
181
+ - spec/rails30_app/Rakefile
182
+ - spec/rails30_app/app/controllers/application_controller.rb
183
+ - spec/rails30_app/app/controllers/changelog_controller.rb
184
+ - spec/rails30_app/app/controllers/pages_controller.rb
185
+ - spec/rails30_app/app/controllers/sessions_controller.rb
186
+ - spec/rails30_app/app/helpers/application_helper.rb
187
+ - spec/rails30_app/app/helpers/posts_helper.rb
188
+ - spec/rails30_app/app/mailers/.gitkeep
189
+ - spec/rails30_app/app/models/.gitkeep
190
+ - spec/rails30_app/app/models/changelog.rb
191
+ - spec/rails30_app/app/views/changelog/_page.html.erb
192
+ - spec/rails30_app/app/views/changelog/index.html.erb
193
+ - spec/rails30_app/app/views/layouts/ajax.html.erb
194
+ - spec/rails30_app/app/views/layouts/application.html.erb
195
+ - spec/rails30_app/app/views/layouts/flash.html.erb
196
+ - spec/rails30_app/app/views/pages/about.html.erb
197
+ - spec/rails30_app/app/views/pages/readme.html.erb
198
+ - spec/rails30_app/app/views/pages/warnings.html.erb
199
+ - spec/rails30_app/app/views/pages/welcome.html.erb
200
+ - spec/rails30_app/app/views/sessions/count.html.erb
201
+ - spec/rails30_app/config.ru
202
+ - spec/rails30_app/config/application.rb
203
+ - spec/rails30_app/config/boot.rb
204
+ - spec/rails30_app/config/database.yml
205
+ - spec/rails30_app/config/environment.rb
206
+ - spec/rails30_app/config/environments/development.rb
207
+ - spec/rails30_app/config/environments/production.rb
208
+ - spec/rails30_app/config/environments/test.rb
209
+ - spec/rails30_app/config/initializers/ajax_pagination.rb
210
+ - spec/rails30_app/config/initializers/backtrace_silencers.rb
211
+ - spec/rails30_app/config/initializers/inflections.rb
212
+ - spec/rails30_app/config/initializers/mime_types.rb
213
+ - spec/rails30_app/config/initializers/secret_token.rb
214
+ - spec/rails30_app/config/initializers/session_store.rb
215
+ - spec/rails30_app/config/locales/en.yml
216
+ - spec/rails30_app/config/routes.rb
217
+ - spec/rails30_app/log/.gitkeep
218
+ - spec/rails30_app/public/404.html
219
+ - spec/rails30_app/public/422.html
220
+ - spec/rails30_app/public/500.html
221
+ - spec/rails30_app/public/favicon.ico
222
+ - spec/rails30_app/public/images/ajax-loader.gif
223
+ - spec/rails30_app/public/javascripts/ajax_pagination.js
224
+ - spec/rails30_app/public/javascripts/history.js
225
+ - spec/rails30_app/public/javascripts/history_adapter_jquery.js
226
+ - spec/rails30_app/public/javascripts/history_core.js
227
+ - spec/rails30_app/public/javascripts/history_html4.js
228
+ - spec/rails30_app/public/javascripts/jquery-ui.js
229
+ - spec/rails30_app/public/javascripts/jquery-ui.min.js
230
+ - spec/rails30_app/public/javascripts/jquery.ba-bbq.js
231
+ - spec/rails30_app/public/javascripts/jquery.js
232
+ - spec/rails30_app/public/javascripts/jquery.min.js
233
+ - spec/rails30_app/public/javascripts/jquery.url.js
234
+ - spec/rails30_app/public/javascripts/jquery_ujs.js
235
+ - spec/rails30_app/public/javascripts/json2.js
236
+ - spec/rails30_app/public/stylesheets/ajax_pagination.css
237
+ - spec/rails30_app/public/stylesheets/application.css
238
+ - spec/rails30_app/public/stylesheets/scaffold.css
239
+ - spec/rails30_app/script/rails
175
240
  - spec/rails_app/.gitignore
176
241
  - spec/rails_app/Gemfile
242
+ - spec/rails_app/Gemfile.lock
177
243
  - spec/rails_app/README.rdoc
178
244
  - spec/rails_app/Rakefile
179
245
  - spec/rails_app/app/assets/images/myajax-loader.gif
@@ -237,10 +303,6 @@ files:
237
303
  - spec/rails_app/public/500.html
238
304
  - spec/rails_app/public/favicon.ico
239
305
  - spec/rails_app/script/rails
240
- - spec/rails_app/test/fixtures/posts.yml
241
- - spec/rails_app/test/functional/posts_controller_test.rb
242
- - spec/rails_app/test/unit/helpers/posts_helper_test.rb
243
- - spec/rails_app/test/unit/post_test.rb
244
306
  - spec/spec_helper.rb
245
307
  - vendor/assets/javascripts/jquery.ba-bbq.js
246
308
  - vendor/assets/javascripts/jquery.url.js
@@ -1,9 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- one:
4
- title: MyString
5
- content: MyText
6
-
7
- two:
8
- title: MyString
9
- content: MyText
@@ -1,49 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PostsControllerTest < ActionController::TestCase
4
- setup do
5
- @post = posts(:one)
6
- end
7
-
8
- test "should get index" do
9
- get :index
10
- assert_response :success
11
- assert_not_nil assigns(:posts)
12
- end
13
-
14
- test "should get new" do
15
- get :new
16
- assert_response :success
17
- end
18
-
19
- test "should create post" do
20
- assert_difference('Post.count') do
21
- post :create, :post => @post.attributes
22
- end
23
-
24
- assert_redirected_to post_path(assigns(:post))
25
- end
26
-
27
- test "should show post" do
28
- get :show, :id => @post
29
- assert_response :success
30
- end
31
-
32
- test "should get edit" do
33
- get :edit, :id => @post
34
- assert_response :success
35
- end
36
-
37
- test "should update post" do
38
- put :update, :id => @post, :post => @post.attributes
39
- assert_redirected_to post_path(assigns(:post))
40
- end
41
-
42
- test "should destroy post" do
43
- assert_difference('Post.count', -1) do
44
- delete :destroy, :id => @post
45
- end
46
-
47
- assert_redirected_to posts_path
48
- end
49
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PostsHelperTest < ActionView::TestCase
4
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PostTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end