will_paginate-foundation 0.1 → 0.2
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.
- checksums.yaml +15 -0
- data/README.markdown +25 -0
- data/example/app.rb +30 -0
- data/lib/foundation_pagination/sinatra.rb +10 -0
- data/lib/foundation_pagination/version.rb +1 -1
- data/lib/will_paginate/foundation.rb +4 -0
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDg3MjgxYTMxYjNiOTgwMTMwN2I0YThmZjFmNzZiY2RmODgwNWUwNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzliYTZmNDI4M2VjMTc2YWQ5Yjg2MDQwM2Q2MmJjOWMxYTQ1NTZiZg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTM3YzMwMjk0NWY4ZWZiZjdlNDlhZGJiYjllZDVhMDU3MWViOTM0OGM5MmQ4
|
10
|
+
ZmUzODRlMWM1NDQyYzFmY2ViNTQzZGQwOWM3NTg0OTllOTc4MmNjZGIyMjEw
|
11
|
+
ZTRkNTYyZTQzMTk5NjQwZGM5MDM3ODAwZjkyYzU2N2I1ZjlkOTk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NzVjZDcxOTQwZGYwNGM2ZGNkODE5Yjc4YTE5YTljODJkMGVkZDliNWNjOTNi
|
14
|
+
MThkMjk3MzIxOWZmMTg1NjA5MDlmZjg4OTI3ODNlZDgzNTgwNTMyZjMyZjY1
|
15
|
+
OTU2Mzg0NTUzNmQwOTA0NmNjMTBjNTk4NjY4YzhiNjkyMjY4Yzc=
|
data/README.markdown
CHANGED
@@ -19,3 +19,28 @@ This gem integrates the [Foundation](http://foundation.zurb.com) [pagination com
|
|
19
19
|
```ruby
|
20
20
|
<%= will_paginate @collection, renderer: FoundationPagination::Rails %>
|
21
21
|
```
|
22
|
+
|
23
|
+
### Sinatra
|
24
|
+
|
25
|
+
1. Load the Foundation CSS in your template.
|
26
|
+
2. `require "will_paginate-foundation"` in your Sinatra app.
|
27
|
+
3. In your view, use the `renderer: FoundationPagination::Sinatra` option with the `will_paginate` helper, for example:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
<%= will_paginate @collection, renderer: FoundationPagination::Sinatra %>
|
31
|
+
```
|
32
|
+
|
33
|
+
|
34
|
+
Contributing
|
35
|
+
------------
|
36
|
+
|
37
|
+
1. Fork it.
|
38
|
+
2. Create a branch (`git checkout -b my_markup`)
|
39
|
+
3. Commit your changes (`git commit -am "Cool new feature"`)
|
40
|
+
4. Push to the branch (`git push origin my_markup`)
|
41
|
+
5. Open a [Pull Request][1]
|
42
|
+
6. Enjoy a refreshing 'Insert Favorite Beverage' and wait
|
43
|
+
|
44
|
+
License
|
45
|
+
------------
|
46
|
+
The MIT License (MIT)
|
data/example/app.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "sinatra"
|
2
|
+
require "will_paginate-foundation"
|
3
|
+
require "will_paginate/collection"
|
4
|
+
|
5
|
+
$template = <<EOHTML
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>will_paginate-foundation Example App</title>
|
9
|
+
<link href="http://cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css" rel="stylesheet">
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<%= will_paginate @collection, renderer: FoundationPagination::Sinatra %>
|
13
|
+
</body>
|
14
|
+
</html>
|
15
|
+
EOHTML
|
16
|
+
|
17
|
+
def build_collection
|
18
|
+
page = if params[:page].to_i > 0
|
19
|
+
params[:page].to_i
|
20
|
+
else
|
21
|
+
1
|
22
|
+
end
|
23
|
+
|
24
|
+
@collection = WillPaginate::Collection.new page, 10, 100000
|
25
|
+
end
|
26
|
+
|
27
|
+
get "/" do
|
28
|
+
build_collection
|
29
|
+
erb $template
|
30
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "will_paginate/view_helpers/sinatra"
|
2
|
+
require "foundation_pagination/foundation_renderer"
|
3
|
+
|
4
|
+
module FoundationPagination
|
5
|
+
# A custom renderer class for WillPaginate that produces markup suitable for use with Twitter Bootstrap.
|
6
|
+
class Sinatra < WillPaginate::Sinatra::LinkRenderer
|
7
|
+
include FoundationRenderer
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate-foundation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
5
|
-
prerelease:
|
4
|
+
version: '0.2'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Adrian Rangel
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: will_paginate
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -40,8 +37,10 @@ files:
|
|
40
37
|
- MIT-LICENSE
|
41
38
|
- README.markdown
|
42
39
|
- Rakefile
|
40
|
+
- example/app.rb
|
43
41
|
- lib/foundation_pagination/action_view.rb
|
44
42
|
- lib/foundation_pagination/foundation_renderer.rb
|
43
|
+
- lib/foundation_pagination/sinatra.rb
|
45
44
|
- lib/foundation_pagination/version.rb
|
46
45
|
- lib/will_paginate-foundation.rb
|
47
46
|
- lib/will_paginate/foundation.rb
|
@@ -50,26 +49,25 @@ files:
|
|
50
49
|
homepage: https://github.com/acrogenesis/will_paginate-foundation
|
51
50
|
licenses:
|
52
51
|
- MIT
|
52
|
+
metadata: {}
|
53
53
|
post_install_message:
|
54
54
|
rdoc_options: []
|
55
55
|
require_paths:
|
56
56
|
- lib
|
57
57
|
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
58
|
requirements:
|
60
59
|
- - ! '>='
|
61
60
|
- !ruby/object:Gem::Version
|
62
61
|
version: '0'
|
63
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
63
|
requirements:
|
66
64
|
- - ! '>='
|
67
65
|
- !ruby/object:Gem::Version
|
68
66
|
version: '0'
|
69
67
|
requirements: []
|
70
68
|
rubyforge_project: will_paginate-foundation
|
71
|
-
rubygems_version: 1.
|
69
|
+
rubygems_version: 2.1.5
|
72
70
|
signing_key:
|
73
|
-
specification_version:
|
71
|
+
specification_version: 4
|
74
72
|
summary: Integrates the Foundation pagination component with will_paginate
|
75
73
|
test_files: []
|