leaf 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/leaf/version.rb +1 -1
- data/lib/leaf/view_helpers/sinatra.rb +4 -4
- metadata +4 -4
data/lib/leaf/version.rb
CHANGED
@@ -7,11 +7,11 @@ Leaf::ViewHelpers::LinkRenderer.class_eval do
|
|
7
7
|
def url(page)
|
8
8
|
url = @template.request.url
|
9
9
|
if page == 1
|
10
|
-
# strip out page param and trailing ? if
|
11
|
-
url.gsub(/page=[0-9]+/, '').gsub(/\?$/, '')
|
10
|
+
# strip out page param and trailing ? and & if they exists
|
11
|
+
url.gsub(/(\?|\&)page=[0-9]+/, '').gsub(/\?$/, '').gsub(/\&$/, '')
|
12
12
|
else
|
13
|
-
if url =~ /page=[0-9]+/
|
14
|
-
url.gsub(/page=[0-9]+/, "page=#{page}")
|
13
|
+
if url =~ /(\?|\&)page=[0-9]+/
|
14
|
+
url.gsub(/page=[0-9]+/, "page=#{page}").gsub(/\&+/, '&')
|
15
15
|
else
|
16
16
|
(url =~ /\?/) ? url + "&page=#{page}" : url + "?page=#{page}"
|
17
17
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Peter Hellberg
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-30 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|