public
Rubygem
Fork of mislav/will_paginate
Description: Most awesome pagination solution for Rails
Homepage: http://github.com/mislav/will_paginate/wikis
Clone URL: git://github.com/chriseppstein/will_paginate.git
Search Repo:
add gemspec file. change rake manifest to auto-update the gemspec. get rid 
of rubyforge release task
mislav (author)
Fri Apr 25 17:47:03 -0700 2008
commit  3334327b6a6ab8f46e29f88c59449f8ba4583833
tree    adf4c87635b3592aab48c2a0eace6f470fe887a1
parent  96166037a72a0c35fc6129f075c0c49c9fc21772
...
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0
@@ -1,3 +1,16 @@
0
+== 2.2.3, released 2008-04-26
0
+
0
+* will_paginate gem is no longer published on RubyForge, but on
0
+ gems.github.com:
0
+
0
+ gem sources -a http://gems.github.com/ (you only need to do this once)
0
+ gem install mislav-will_paginate
0
+
0
+* extract reusable pagination testing stuff into WillPaginate::View
0
+* rethink the page URL construction mechanizm to be more bulletproof when
0
+ combined with custom routing for page parameter
0
+* test that anchor parameter can be used in pagination links
0
+
0
 == 2.2.2, released 2008-04-21
0
 
0
 * Add support for page parameter in custom routes like "/foo/page/2"
...
11
12
13
14
15
 
 
16
17
18
19
20
21
22
23
24
...
20
21
22
23
 
24
25
 
 
 
 
 
26
27
28
 
 
 
29
30
31
32
33
34
35
36
 
37
38
39
40
 
 
41
42
43
44
 
 
45
46
47
48
49
50
51
 
52
53
54
...
57
58
59
60
 
61
62
63
64
65
66
67
68
...
65
66
67
68
69
70
71
 
 
 
 
72
73
74
75
76
77
78
 
 
 
79
 
80
81
82
83
84
 
85
86
87
88
89
90
91
92
93
94
 
 
 
 
 
95
96
97
 
 
98
99
100
...
131
132
133
134
135
 
 
...
11
12
13
 
 
14
15
16
17
18
19
20
21
22
23
24
...
20
21
22
 
23
24
 
25
26
27
28
29
30
 
 
31
32
33
34
 
 
 
 
 
 
 
35
36
37
 
 
38
39
40
41
 
 
42
43
44
45
46
47
48
49
 
50
51
52
53
...
56
57
58
 
59
60
61
62
63
64
65
66
67
...
64
65
66
 
 
 
 
67
68
69
70
71
72
73
 
 
 
 
74
75
76
77
78
79
80
81
82
 
83
84
85
86
87
88
 
 
 
 
 
89
90
91
92
93
94
 
 
95
96
97
98
99
...
130
131
132
 
 
133
134
0
@@ -11,8 +11,8 @@
0
 
0
 Some resources to get you started:
0
 
0
-* Your mind reels with questions? Join our Google
0
- group[http://groups.google.com/group/will_paginate].
0
+* Your mind reels with questions? Join our
0
+ {Google group}[http://groups.google.com/group/will_paginate].
0
 * The will_paginate project page: http://github.com/mislav/will_paginate
0
 * How to report bugs: http://github.com/mislav/will_paginate/wikis/report-bugs
0
 * Ryan Bates made an awesome screencast[http://railscasts.com/episodes/51],
0
0
0
0
0
0
0
@@ -20,35 +20,34 @@
0
 
0
 == Installation
0
 
0
-Previously, the plugin was available on the following SVN location:
0
+The recommended way is that you get the gem:
0
 
0
- svn://errtheblog.com/svn/plugins/will_paginate
0
+ # add GitHub to your local list of gem sources:
0
+ gem sources -a http://gems.github.com/
0
+
0
+ # install the gem:
0
+ gem install mislav-will_paginate
0
 
0
-In February 2008, it moved to GitHub to be tracked with git version control.
0
-The SVN repo continued to have updates for some time, but now it doesn't.
0
+After that you don't need the will_paginate <i>plugin</i> in your Rails
0
+application anymore. Just add a simple require to the end of
0
+"config/environment.rb":
0
 
0
-You should switch to using the gem:
0
-
0
- gem install will_paginate
0
-
0
-After that, you can remove the plugin from your application and add
0
-a simple require to the end of config/environment.rb:
0
-
0
+ gem 'mislav-will_paginate', '~> 2.2'
0
   require 'will_paginate'
0
 
0
-That's it, just remember to install the gem on all machines that
0
-you are deploying to.
0
+That's it. Remember to install the gem on <b>all</b> machines that you are
0
+deploying to.
0
 
0
 <i>There are extensive
0
-installation[http://github.com/mislav/will_paginate/wikis/installation]
0
-instructions on the wiki[http://github.com/mislav/will_paginate/wikis].</i>
0
+{installation instructions}[http://github.com/mislav/will_paginate/wikis/installation]
0
+on {the wiki}[http://github.com/mislav/will_paginate/wikis].</i>
0
 
0
 
0
 == Example usage
0
 
0
 Use a paginate finder in the controller:
0
 
0
- @posts = Post.paginate_by_board_id @board.id, :page => params[:page], :order => 'updated_at DESC'
0
+ @posts = Post.paginate_by_board_id @board.id, :page => params[:page], :order => 'updated_at DESC'
0
 
0
 Yeah, +paginate+ works just like +find+ -- it just doesn't fetch all the
0
 records. Don't forget to tell it which page you want, or it will complain!
0
@@ -57,7 +56,7 @@
0
 Render the posts in your view like you would normally do. When you need to render
0
 pagination, just stick this in:
0
 
0
- <%= will_paginate @posts %>
0
+ <%= will_paginate @posts %>
0
 
0
 You're done. (Copy and paste the example fancy CSS styles from the bottom.) You
0
 can find the option list at WillPaginate::ViewHelpers.
0
0
0
0
0
0
@@ -65,36 +64,36 @@
0
 How does it know how much items to fetch per page? It asks your model by calling
0
 its <tt>per_page</tt> class method. You can define it like this:
0
 
0
- class Post < ActiveRecord::Base
0
- cattr_reader :per_page
0
- @@per_page = 50
0
- end
0
+ class Post < ActiveRecord::Base
0
+ cattr_reader :per_page
0
+ @@per_page = 50
0
+ end
0
 
0
 ... or like this:
0
 
0
- class Post < ActiveRecord::Base
0
- def self.per_page
0
- 50
0
- end
0
+ class Post < ActiveRecord::Base
0
+ def self.per_page
0
+ 50
0
     end
0
+ end
0
 
0
 ... or don't worry about it at all. WillPaginate defines it to be <b>30</b> by default.
0
 But you can always specify the count explicitly when calling +paginate+:
0
 
0
- @posts = Post.paginate :page => params[:page], :per_page => 50
0
+ @posts = Post.paginate :page => params[:page], :per_page => 50
0
 
0
 The +paginate+ finder wraps the original finder and returns your resultset that now has
0
 some new properties. You can use the collection as you would with any ActiveRecord
0
 resultset. WillPaginate view helpers also need that object to be able to render pagination:
0
 
0
- <ol>
0
- <% for post in @posts -%>
0
- <li>Render `post` in some nice way.</li>
0
- <% end -%>
0
- </ol>
0
+ <ol>
0
+ <% for post in @posts -%>
0
+ <li>Render `post` in some nice way.</li>
0
+ <% end -%>
0
+ </ol>
0
 
0
- <p>Now let's render us some pagination!</p>
0
- <%= will_paginate @posts %>
0
+ <p>Now let's render us some pagination!</p>
0
+ <%= will_paginate @posts %>
0
 
0
 More detailed documentation:
0
 
0
@@ -131,6 +130,6 @@
0
 * Pagination on Yahoo Design Pattern Library:
0
   http://developer.yahoo.com/ypatterns/parent.php?pattern=pagination
0
 
0
-Want to discuss, request features, ask questions? Join the Google group:
0
-http://groups.google.com/group/will_paginate
0
+Want to discuss, request features, ask questions? Join the
0
+{Google group}[http://groups.google.com/group/will_paginate].
...
73
74
75
76
 
 
 
77
78
79
80
...
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
 
 
 
 
 
 
 
 
 
115
116
117
...
73
74
75
 
76
77
78
79
80
81
82
...
83
84
85
 
 
 
 
 
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
88
89
90
91
92
93
94
95
96
97
98
0
@@ -73,7 +73,9 @@
0
 end
0
 
0
 task :manifest do
0
- list = Dir['**/*']
0
+ list = Dir['**/*'].sort
0
+ spec_file = Dir['*.gemspec'].first
0
+ list -= [spec_file]
0
   
0
   File.read('.gitignore').each_line do |glob|
0
     glob = glob.chomp.sub(/^\//, '')
0
0
@@ -81,37 +83,16 @@
0
     list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
0
     puts "excluding #{glob}"
0
   end
0
-
0
- File.open('.manifest', 'w') do |file|
0
- file.write list.sort.join("\n")
0
- end
0
-end
0
 
0
-desc 'Package and upload the release to rubyforge.'
0
-task :release do
0
- require 'yaml'
0
- require 'rubyforge'
0
-
0
- meta = YAML::load open('.gemified')
0
- version = meta[:version]
0
-
0
- v = ENV['VERSION'] or abort "Must supply VERSION=x.y.z"
0
- abort "Version doesn't match #{version}" if v != version
0
-
0
- gem = "#{meta[:name]}-#{version}.gem"
0
- project = meta[:rubyforge_project]
0
-
0
- rf = RubyForge.new
0
- puts "Logging in to RubyForge"
0
- rf.login
0
-
0
- c = rf.userconfig
0
- c['release_notes'] = meta[:summary]
0
- c['release_changes'] = File.read('CHANGELOG').split(/^== .+\n/)[1].strip
0
- c['preformatted'] = true
0
-
0
- puts "Releasing #{meta[:name]} #{version}"
0
- rf.add_release project, project, version, gem
0
+ spec = File.read spec_file
0
+ spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
0
+ assignment = $1
0
+ bunch = $2 ? list.grep(/^test\//) : list
0
+ '%s%%w(%s)' % [assignment, bunch.join(' ')]
0
+ end
0
+
0
+ File.open(spec_file, 'w') {|f| f << spec }
0
+ File.open('.manifest', 'w') {|f| f << list.join("\n") }
0
 end
0
 
0
 task :examples do
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -1 +1,22 @@
0
+Gem::Specification.new do |s|
0
+ s.name = 'will_paginate'
0
+ s.version = '2.2.3'
0
+ s.date = '2008-04-26'
0
+
0
+ s.summary = "Most awesome pagination solution for Rails"
0
+ s.description = "The will_paginate library provides a simple, yet powerful and extensible API for ActiveRecord pagination and rendering of pagination links in ActionView templates."
0
+
0
+ s.authors = ['Mislav Marohnić', 'PJ Hyett']
0
+ s.email = 'mislav.marohnic@gmail.com'
0
+ s.homepage = 'http://github.com/mislav/will_paginate/wikis'
0
+
0
+ s.has_rdoc = true
0
+ s.rdoc_options = ['--main', 'README.rdoc']
0
+ s.rdoc_options << '--inline-source' << '--charset=UTF-8'
0
+ s.extra_rdoc_files = ['README.rdoc', 'LICENSE', 'CHANGELOG']
0
+ # s.add_dependency 'actionpack', ['>= 1.13.6']
0
+
0
+ s.files = %w(CHANGELOG LICENSE README.rdoc Rakefile examples examples/apple-circle.gif examples/index.haml examples/index.html examples/pagination.css examples/pagination.sass init.rb lib lib/will_paginate lib/will_paginate.rb lib/will_paginate/array.rb lib/will_paginate/collection.rb lib/will_paginate/core_ext.rb lib/will_paginate/finder.rb lib/will_paginate/named_scope.rb lib/will_paginate/named_scope_patch.rb lib/will_paginate/version.rb lib/will_paginate/view_helpers.rb test test/boot.rb test/collection_test.rb test/console test/database.yml test/finder_test.rb test/fixtures test/fixtures/admin.rb test/fixtures/developer.rb test/fixtures/developers_projects.yml test/fixtures/project.rb test/fixtures/projects.yml test/fixtures/replies.yml test/fixtures/reply.rb test/fixtures/schema.rb test/fixtures/topic.rb test/fixtures/topics.yml test/fixtures/user.rb test/fixtures/users.yml test/helper.rb test/lib test/lib/activerecord_test_case.rb test/lib/activerecord_test_connector.rb test/lib/load_fixtures.rb test/lib/view_test_process.rb test/view_test.rb)
0
+ s.test_files = %w(test/boot.rb test/collection_test.rb test/console test/database.yml test/finder_test.rb test/fixtures test/fixtures/admin.rb test/fixtures/developer.rb test/fixtures/developers_projects.yml test/fixtures/project.rb test/fixtures/projects.yml test/fixtures/replies.yml test/fixtures/reply.rb test/fixtures/schema.rb test/fixtures/topic.rb test/fixtures/topics.yml test/fixtures/user.rb test/fixtures/users.yml test/helper.rb test/lib test/lib/activerecord_test_case.rb test/lib/activerecord_test_connector.rb test/lib/load_fixtures.rb test/lib/view_test_process.rb test/view_test.rb)
0
+end

Comments

    No one has commented yet.