atdis 0.3.4 → 0.3.5
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 +4 -4
- data/lib/atdis/feed.rb +6 -1
- data/lib/atdis/version.rb +1 -1
- data/spec/atdis/feed_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 528ead212dae0aa7f87f76ff92e6f7f5451aee40
|
4
|
+
data.tar.gz: bd34d58c632307942e6e5ab6ddcb4f553c1dd358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60592858c156171e9da739fa9204cdf406580f835a33a7ccd7fe0081bcc46484b1add1f37493c93bfee31ed18a5f72f36287e7f5a2b23b9c13df93242a6d90a0
|
7
|
+
data.tar.gz: 38da539b1d5d8bc0c959d9a335156b04c81d719fdd366bebeb8fbd6a49f23e957c6fb13ee99a0dc80eea20b73cecfc735ed06450c4d61f2eac09a048bcb158ad
|
data/lib/atdis/feed.rb
CHANGED
@@ -80,13 +80,18 @@ module ATDIS
|
|
80
80
|
options
|
81
81
|
end
|
82
82
|
|
83
|
+
# Escape but leave commas unchanged (which are valid in query strings)
|
84
|
+
def self.escape(v)
|
85
|
+
CGI::escape(v.to_s).gsub('%2C',',')
|
86
|
+
end
|
87
|
+
|
83
88
|
# Turn an options hash of the form {foo: "bar", hello: "sir"} into a query
|
84
89
|
# string of the form "foo=bar&hello=sir"
|
85
90
|
def self.options_to_query(options)
|
86
91
|
if options.empty?
|
87
92
|
nil
|
88
93
|
else
|
89
|
-
options.sort{|a,b| a.first.to_s <=> b.first.to_s}.map{|k,v| "#{k}=#{v}"}.join("&")
|
94
|
+
options.sort{|a,b| a.first.to_s <=> b.first.to_s}.map{|k,v| "#{k}=#{escape(v)}"}.join("&")
|
90
95
|
end
|
91
96
|
end
|
92
97
|
end
|
data/lib/atdis/version.rb
CHANGED
data/spec/atdis/feed_spec.rb
CHANGED
@@ -51,6 +51,12 @@ describe ATDIS::Feed do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
describe "search by suburb" do
|
55
|
+
it do
|
56
|
+
feed.applications_url(suburb: ["willow tree", "foo", "bar"]).should == "http://www.council.nsw.gov.au/atdis/1.0/applications.json?suburb=willow+tree,foo,bar"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
54
60
|
it "jump straight to the second page" do
|
55
61
|
feed.applications_url(page: 2).should == "http://www.council.nsw.gov.au/atdis/1.0/applications.json?page=2"
|
56
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atdis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Landauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|