leaf 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module Leaf
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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 it exists
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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
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-29 00:00:00 +02:00
18
+ date: 2010-06-30 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency