public
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/technoweenie/will_paginate.git
Search Repo:
cleanup from newgem
mislav (author)
Sat Mar 01 19:27:34 -0800 2008
commit  b0f9476a68ee6d3d3fbf9f4d4e177766c71e3b58
tree    f0949047a55e711edd0e6102963bc9afb2244cda
parent  2ef59ad19b08be7087f9021527c782aa7e33ed6c
...
60
61
62
63
 
...
60
61
62
 
63
0
@@ -60,5 +60,5 @@
0
   end
0
 end
0
 
0
-WillPaginate.enable
0
+WillPaginate.enable if defined? ActiveRecord and defined? ActionView
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,15 +1 @@
0
-#!/usr/bin/env ruby
0
-APP_ROOT = File.join(File.dirname(__FILE__), '..')
0
-
0
-begin
0
- require 'rubigen'
0
-rescue LoadError
0
- require 'rubygems'
0
- require 'rubigen'
0
-end
0
-require 'rubigen/scripts/destroy'
0
-
0
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
0
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
0
-RubiGen::Scripts::Destroy.new.run(ARGV)
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,15 +1 @@
0
-#!/usr/bin/env ruby
0
-APP_ROOT = File.join(File.dirname(__FILE__), '..')
0
-
0
-begin
0
- require 'rubigen'
0
-rescue LoadError
0
- require 'rubygems'
0
- require 'rubigen'
0
-end
0
-require 'rubigen/scripts/generate'
0
-
0
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
0
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
0
-RubiGen::Scripts::Generate.new.run(ARGV)
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,75 +1 @@
0
-#!/usr/bin/env ruby
0
-
0
-require 'rubygems'
0
-begin
0
- require 'newgem'
0
-rescue LoadError
0
- puts "\n\nGenerating the website requires the newgem RubyGem"
0
- puts "Install: gem install newgem\n\n"
0
- exit(1)
0
-end
0
-require 'redcloth'
0
-require 'syntax/convertors/html'
0
-require 'erb'
0
-require File.dirname(__FILE__) + '/../lib/will_paginate/version.rb'
0
-
0
-version = WillPaginate::VERSION::STRING
0
-download = 'http://rubyforge.org/projects/will_paginate'
0
-
0
-class Fixnum
0
- def ordinal
0
- # teens
0
- return 'th' if (10..19).include?(self % 100)
0
- # others
0
- case self % 10
0
- when 1: return 'st'
0
- when 2: return 'nd'
0
- when 3: return 'rd'
0
- else return 'th'
0
- end
0
- end
0
-end
0
-
0
-class Time
0
- def pretty
0
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
0
- end
0
-end
0
-
0
-def convert_syntax(syntax, source)
0
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
0
-end
0
-
0
-if ARGV.length >= 1
0
- src, template = ARGV
0
- template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')
0
-
0
-else
0
- puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
0
- exit!
0
-end
0
-
0
-template = ERB.new(File.open(template).read)
0
-
0
-title = nil
0
-body = nil
0
-File.open(src) do |fsrc|
0
- title_text = fsrc.readline
0
- body_text = fsrc.read
0
- syntax_items = []
0
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
0
- ident = syntax_items.length
0
- element, syntax, source = $1, $2, $3
0
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
0
- "syntax-temp-#{ident}"
0
- }
0
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
0
- body = RedCloth.new(body_text).to_html
0
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
0
-end
0
-stat = File.stat(src)
0
-created = stat.ctime
0
-modified = stat.mtime
0
-
0
-$stdout << template.result(binding)
...
1
2
3
4
5
6
7
8
9
10
11
...
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,12 +1 @@
0
-<html>
0
- <head>
0
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
0
- <title>will_paginate</title>
0
-
0
- </head>
0
- <body id="body">
0
- <p>This page has not yet been created for RubyGem <code>will_paginate</code></p>
0
- <p>To the developer: To generate it, update website/index.txt and run the rake task <code>website</code> to generate this <code>index.html</code> file.</p>
0
- </body>
0
-</html>
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,39 +1 @@
0
-h1. will_paginate
0
-
0
-h1. &#x2192; 'will_paginate'
0
-
0
-
0
-h2. What
0
-
0
-
0
-h2. Installing
0
-
0
-<pre syntax="ruby">sudo gem install will_paginate</pre>
0
-
0
-h2. The basics
0
-
0
-
0
-h2. Demonstration of usage
0
-
0
-
0
-
0
-h2. Forum
0
-
0
-"http://groups.google.com/group/will_paginate":http://groups.google.com/group/will_paginate
0
-
0
-TODO - create Google Group - will_paginate
0
-
0
-h2. How to submit patches
0
-
0
-Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
0
-
0
-The trunk repository is <code>svn://rubyforge.org/var/svn/will_paginate/trunk</code> for anonymous access.
0
-
0
-h2. License
0
-
0
-This code is free to use under the terms of the MIT license.
0
-
0
-h2. Contact
0
-
0
-Comments are welcome. Send an email to "FIXME full name":mailto:FIXME email via the "forum":http://groups.google.com/group/will_paginate
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
55
56
57
58
59
60
61
62
63
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,139 +1 @@
0
-body {
0
- background-color: #E1D1F1;
0
- font-family: "Georgia", sans-serif;
0
- font-size: 16px;
0
- line-height: 1.6em;
0
- padding: 1.6em 0 0 0;
0
- color: #333;
0
-}
0
-h1, h2, h3, h4, h5, h6 {
0
- color: #444;
0
-}
0
-h1 {
0
- font-family: sans-serif;
0
- font-weight: normal;
0
- font-size: 4em;
0
- line-height: 0.8em;
0
- letter-spacing: -0.1ex;
0
- margin: 5px;
0
-}
0
-li {
0
- padding: 0;
0
- margin: 0;
0
- list-style-type: square;
0
-}
0
-a {
0
- color: #5E5AFF;
0
- background-color: #DAC;
0
- font-weight: normal;
0
- text-decoration: underline;
0
-}
0
-blockquote {
0
- font-size: 90%;
0
- font-style: italic;
0
- border-left: 1px solid #111;
0
- padding-left: 1em;
0
-}
0
-.caps {
0
- font-size: 80%;
0
-}
0
-
0
-#main {
0
- width: 45em;
0
- padding: 0;
0
- margin: 0 auto;
0
-}
0
-.coda {
0
- text-align: right;
0
- color: #77f;
0
- font-size: smaller;
0
-}
0
-
0
-table {
0
- font-size: 90%;
0
- line-height: 1.4em;
0
- color: #ff8;
0
- background-color: #111;
0
- padding: 2px 10px 2px 10px;
0
- border-style: dashed;
0
-}
0
-
0
-th {
0
- color: #fff;
0
-}
0
-
0
-td {
0
- padding: 2px 10px 2px 10px;
0
-}
0
-
0
-.success {
0
- color: #0CC52B;
0
-}
0
-
0
-.failed {
0
- color: #E90A1B;
0
-}
0
-
0
-.unknown {
0
- color: #995000;
0
-}
0
-pre, code {
0
- font-family: monospace;
0
- font-size: 90%;
0
- line-height: 1.4em;
0
- color: #ff8;
0
- background-color: #111;
0
- padding: 2px 10px 2px 10px;
0
-}
0
-.comment { color: #aaa; font-style: italic; }
0
-.keyword { color: #eff; font-weight: bold; }
0
-.punct { color: #eee; font-weight: bold; }
0
-.symbol { color: #0bb; }
0
-.string { color: #6b4; }
0
-.ident { color: #ff8; }
0
-.constant { color: #66f; }
0
-.regex { color: #ec6; }
0
-.number { color: #F99; }
0
-.expr { color: #227; }
0
-
0
-#version {
0
- float: right;
0
- text-align: right;
0
- font-family: sans-serif;
0
- font-weight: normal;
0
- background-color: #B3ABFF;
0
- color: #141331;
0
- padding: 15px 20px 10px 20px;
0
- margin: 0 auto;
0
- margin-top: 15px;
0
- border: 3px solid #141331;
0
-}
0
-
0
-#version .numbers {
0
- display: block;
0
- font-size: 4em;
0
- line-height: 0.8em;
0
- letter-spacing: -0.1ex;
0
- margin-bottom: 15px;
0
-}
0
-
0
-#version p {
0
- text-decoration: none;
0
- color: #141331;
0
- background-color: #B3ABFF;
0
- margin: 0;
0
- padding: 0;
0
-}
0
-
0
-#version a {
0
- text-decoration: none;
0
- color: #141331;
0
- background-color: #B3ABFF;
0
-}
0
-
0
-.clickable {
0
- cursor: pointer;
0
- cursor: hand;
0
-}
0
-
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,49 +1 @@
0
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
0
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
0
-<head>
0
- <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
0
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
0
- <title>
0
- <%= title %>
0
- </title>
0
- <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
0
-<style>
0
-
0
-</style>
0
- <script type="text/javascript">
0
- window.onload = function() {
0
- settings = {
0
- tl: { radius: 10 },
0
- tr: { radius: 10 },
0
- bl: { radius: 10 },
0
- br: { radius: 10 },
0
- antiAlias: true,
0
- autoPad: true,
0
- validTags: ["div"]
0
- }
0
- var versionBox = new curvyCorners(settings, document.getElementById("version"));
0
- versionBox.applyCornersToAll();
0
- }
0
- </script>
0
-</head>
0
-<body>
0
-<div id="main">
0
-
0
- <h1><%= title %></h1>
0
- <div id="version" class="clickable" onclick='document.location = "<%= download %>"; return false'>
0
- <p>Get Version</p>
0
- <a href="<%= download %>" class="numbers"><%= version %></a>
0
- </div>
0
- <%= body %>
0
- <p class="coda">
0
- <a href="FIXME email">FIXME full name</a>, <%= modified.pretty %><br>
0
- Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
0
- </p>
0
-</div>
0
-
0
-<!-- insert site tracking codes here, like Google Urchin -->
0
-
0
-</body>
0
-</html>

Comments

    No one has commented yet.