sinatra-routing-helpers 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGJkM2E4Yzg3N2Y2ZDE2NmZhYjEyYzI2NjcxMGVkNWRmOTFmZDBmMw==
4
+ M2JhNDk3ZTUzODhhMzNhYThlOWUwMjMwMmE5NDUxNWM3NGU3ZWM1MA==
5
5
  data.tar.gz: !binary |-
6
- MmQzNmQ5MjQxNGYyYWNkNjBmNmFlZjU2ZGFlODIyMDBiN2RhYTM1ZQ==
6
+ MTBjNjU5M2FlNmFkMWY4MmFmM2U2NmZjNjBlMzFkZjBkMjIwMjQ2Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzZkOWEwNzgwZjM2NWNmYjExNDk2Y2Y3Yzc4MTc0ZTBkNzdjN2E5ZWRjYmIz
10
- M2E5YjBkMTIwNDBhYzM4MGQ4YjYwMzFmZGE0NDU2Y2E4ZGRlYWZiZDJkZDBk
11
- ZDgyNDc5NGZmZDgxYjA3NGFmODJhNDJlNGUyYzNiZTZjYmMyOWU=
9
+ MGUyZGM1MzE3OTc5ZDRhMzY4MWUyZjI4Yjg5YzFkNjJlZDliMzRhZDE4ODk4
10
+ MDJkMmVhMjZiNzM4MDUxNjRmZTcyMGI3YjdjZDUwMjk3NTk2MjJjNzU4OGQ0
11
+ MDhmMzQwYmFkNjkzNmI2ODcyMzIwMDRiYmVkN2U1NTM0YmI4Zjk=
12
12
  data.tar.gz: !binary |-
13
- MGY5NDQ3YzYzMzIyNzliZGY4Y2RjMmVjYjI3ZGJmZmFlMDE1MDU2MDUzNzA5
14
- Y2E3OTgwZWU0YjI1ZTdhOWZiYjMzNWEwODBlOGY2YjUyYTE4Y2VmMzBjODll
15
- MDdlZTM2YjQ4ZDljYTQ4NTc5NmNlNmY4ZGY0ZTRkMTYyOWFhYjA=
13
+ OTIwMWE0YzBlYWM1YjNmZTJkMGUxYjUwZjllYjJjOTU4MzlmYTQ3ZjgwY2Yz
14
+ MjY4YjY5NTY2ZmQzZjBlYzNjZjczYjU0ZjViNDdhM2JjODVhMjA1NTgyMzRk
15
+ MzM4ZjNmYWU4NTJkMjIzOWU1ZjYxODE3MWFmOTRlZDYyYjA0NDE=
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module RoutingHelpers
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -38,7 +38,14 @@ module Sinatra
38
38
 
39
39
  # quickly build a URL with params
40
40
  def url_with_params(headed_to, extra_params = {})
41
- headed_to + '?' + build_query(extra_params)
41
+ # pop off empty values to avoid cluttering the URL bar
42
+ cleaned_params = extra_params.reject { |key, value| value.nil? || value.empty? }
43
+
44
+ unless cleaned_params.empty?
45
+ headed_to + '?' + build_query(cleaned_params)
46
+ else
47
+ headed_to
48
+ end
42
49
  end
43
50
 
44
51
  def busted_url(headed_to)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-routing-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Lecklider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-09 00:00:00.000000000 Z
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.0.3
104
+ rubygems_version: 2.0.6
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Some simple helpers for routing and redirection.