iron-web 1.1.2 → 1.1.3

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.
@@ -1,3 +1,7 @@
1
+ == 1.1.3 / 2014-06-09
2
+
3
+ * Fix minor bug when passing a symbol param key with an array of values, add spec coverage to same
4
+
1
5
  == 1.1.2 / 2013-03-13
2
6
 
3
7
  * Fix bug in Color#brightness where brightness values weren't normalized to 0.0-1.0 range
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.1.3
@@ -62,17 +62,18 @@ class Url
62
62
  unless params.empty?
63
63
  str += '?'
64
64
  str += params.collect do |k,v|
65
+ k = k.to_s
65
66
  if v.is_a?(Array)
66
67
  k = k.gsub('[]','')
67
68
  v.collect do |vs|
68
69
  val = vs.respond_to?(:to_param) ? vs.to_param : vs
69
70
  val = val.to_s
70
- CGI::escape(k.to_s) + '[]=' + CGI::escape(val)
71
+ CGI::escape(k) + '[]=' + CGI::escape(val)
71
72
  end
72
73
  else
73
74
  val = v.respond_to?(:to_param) ? v.to_param : v
74
75
  val = val.to_s
75
- CGI::escape(k.to_s) + '=' + CGI::escape(val)
76
+ CGI::escape(k) + '=' + CGI::escape(val)
76
77
  end
77
78
  end.flatten.join('&')
78
79
  end
@@ -82,6 +82,11 @@ describe Url do
82
82
  u.to_s.should == '/?b=2'
83
83
  end
84
84
 
85
+ it 'should expand arrays in params' do
86
+ u = Url.build('/foo', :bar => [1,2])
87
+ u.to_s.should == '/foo?bar[]=1&bar[]=2'
88
+ end
89
+
85
90
  it 'should support adding to the path' do
86
91
  u = Url.parse('/')
87
92
  u += 'main/site'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-20 00:00:00.000000000 Z
12
+ date: 2014-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron-extensions