open311 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gemtest ADDED
File without changes
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .DS_Store
4
4
  .bundle
5
5
  .yardoc
6
+ Gemfile.lock
6
7
  coverage/*
7
8
  doc/*
8
9
  log/*
data/Gemfile CHANGED
@@ -2,3 +2,15 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify the gem's dependencies in open311.gemspec
4
4
  gemspec
5
+
6
+ group :development do
7
+
8
+ platform :mri_18 do
9
+ gem 'ruby-debug'
10
+ end
11
+
12
+ platform :mri_19 do
13
+ gem 'ruby-debug19'
14
+ end
15
+
16
+ end
data/README.mkd CHANGED
@@ -42,6 +42,17 @@ Usage Examples
42
42
 
43
43
  # Get a service_request_id using a token after a post_service_request
44
44
  Open311.request_id('12345')
45
+
46
+ # Get service requests with certain parameters (service_code, start_date, end_date, status)
47
+ Open311.service_requests("status" => "opened")
48
+ Open311.service_requests({"status" => "opened", "service_code"=>"broken-streetlight-report", "start_date" => "2010-03-12T03:19:52Z", "end_date" => "2010-03-14T03:19:52Z"})
49
+
50
+ # Use Time.now
51
+ require 'time'
52
+ Open311.service_requests({"start_date" => (Time.now - 86400).xmlschema, "end_date" => Time.now.xmlschema}) // last 24 hours
53
+
54
+ # Get multiple service requests by ids, comma separated
55
+ Open311.service_requests({"service_request_id" => "101000119824,101000119823"})
45
56
 
46
57
  Contributing
47
58
  ------------
data/Rakefile CHANGED
@@ -4,6 +4,7 @@ Bundler::GemHelper.install_tasks
4
4
  require 'rspec/core/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
 
7
+ task :test => :spec
7
8
  task :default => :spec
8
9
 
9
10
  namespace :doc do
@@ -28,6 +28,7 @@ module Faraday
28
28
 
29
29
  def initialize(app)
30
30
  super
31
+ @parser = nil
31
32
  end
32
33
 
33
34
  private
data/lib/open311.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require File.expand_path('../open311/configuration', __FILE__)
2
2
  require File.expand_path('../open311/client', __FILE__)
3
- require File.expand_path('../open311/service_request', __FILE__)
4
3
 
5
4
  module Open311
6
5
  extend Configuration
@@ -13,7 +13,9 @@ module Open311
13
13
  def service_list(options={})
14
14
  options.merge!(:jurisdiction_id => jurisdiction)
15
15
  response = get('services', options)
16
- format.to_s.downcase == 'xml' ? response['services']['service'] : response
16
+ unpack_if_xml(response) do
17
+ response['services']['service']
18
+ end
17
19
  end
18
20
 
19
21
  # @format :xml
@@ -27,7 +29,9 @@ module Open311
27
29
  def service_definition(id, options={})
28
30
  options.merge!(:jurisdiction_id => jurisdiction)
29
31
  response = get("services/#{id}", options)
30
- format.to_s.downcase == 'xml' ? response['service_definition'] : response
32
+ unpack_if_xml(response) do
33
+ response['service_definition']
34
+ end
31
35
  end
32
36
 
33
37
  # @format :xml
@@ -39,12 +43,10 @@ module Open311
39
43
  def service_requests(options={})
40
44
  options.merge!(:jurisdiction_id => jurisdiction)
41
45
  response = get("requests", options)
42
- if format.to_s.downcase == 'xml'
46
+ unpack_if_xml(response) do
43
47
  response.service_requests.request.map do |request|
44
- ServiceRequest.new(request)
48
+ response['service_requests']['request']
45
49
  end
46
- else
47
- response
48
50
  end
49
51
  end
50
52
 
@@ -57,7 +59,9 @@ module Open311
57
59
  def post_service_request(options={})
58
60
  options.merge!(:jurisdiction_id => jurisdiction, :api_key => api_key)
59
61
  response = post("requests", options)
60
- format.to_s.downcase == 'xml' ? response['service_requests']['request'] : response
62
+ unpack_if_xml(response) do
63
+ response['service_requests']['request']
64
+ end
61
65
  end
62
66
 
63
67
  # @format :xml
@@ -70,7 +74,9 @@ module Open311
70
74
  def get_service_request(id, options={})
71
75
  options.merge!(:jurisdiction_id => jurisdiction)
72
76
  response = get("requests/#{id}", options)
73
- format.to_s.downcase == 'xml' ? ServiceRequest.new(response.service_requests.request.first) : response
77
+ unpack_if_xml(response) do
78
+ response['service_requests']['request']
79
+ end
74
80
  end
75
81
 
76
82
  # @format :xml
@@ -80,10 +86,22 @@ module Open311
80
86
  # @return Array
81
87
  # @see http://wiki.open311.org/GeoReport_v2#GET_request_id_from_a_token
82
88
  # Open311.request_id
83
- def request_id(token_id, options = {})
89
+ def request_id_from_token(token_id, options = {})
84
90
  options.merge!(:jurisdiction_id => jurisdiction)
85
91
  response = get("tokens/#{token_id}", options)
86
- format.to_s.downcase == 'xml' ? ServiceRequest.new(response.service_requests.request) : response
92
+ unpack_if_xml(response) do
93
+ response['service_requests']['request']
94
+ end
95
+ end
96
+
97
+ private
98
+
99
+ def unpack_if_xml(response)
100
+ if format.to_s.downcase == 'xml'
101
+ yield
102
+ else
103
+ response
104
+ end
87
105
  end
88
106
  end
89
107
  end
@@ -3,15 +3,25 @@ require File.expand_path('../version', __FILE__)
3
3
 
4
4
  module Open311
5
5
  module Configuration
6
- VALID_OPTIONS_KEYS = [:adapter, :api_key, :endpoint, :format, :jurisdiction, :proxy, :user_agent].freeze
7
- VALID_FORMATS = [:json, :xml].freeze
8
-
9
- DEFAULT_ADAPTER = Faraday.default_adapter.freeze
10
- DEFAULT_API_KEY = nil.freeze
11
- DEFAULT_ENDPOINT = nil.freeze
12
- DEFAULT_FORMAT = :xml.freeze
13
- DEFAULT_JURISDICTION = nil.freeze
14
- DEFAULT_PROXY = nil.freeze
6
+ VALID_OPTIONS_KEYS = [
7
+ :adapter,
8
+ :api_key,
9
+ :endpoint,
10
+ :format,
11
+ :jurisdiction,
12
+ :proxy,
13
+ :user_agent].freeze
14
+
15
+ VALID_FORMATS = [
16
+ :json,
17
+ :xml].freeze
18
+
19
+ DEFAULT_ADAPTER = Faraday.default_adapter
20
+ DEFAULT_API_KEY = nil
21
+ DEFAULT_ENDPOINT = nil
22
+ DEFAULT_FORMAT = :xml
23
+ DEFAULT_JURISDICTION = nil
24
+ DEFAULT_PROXY = nil
15
25
  DEFAULT_USER_AGENT = "Open311 Ruby Gem #{Open311::VERSION}".freeze
16
26
 
17
27
  attr_accessor *VALID_OPTIONS_KEYS
@@ -1,3 +1,3 @@
1
1
  module Open311
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/open311.gemspec CHANGED
@@ -1,36 +1,36 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path("../lib/open311/version", __FILE__)
2
+ require File.expand_path('../lib/open311/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
- s.add_development_dependency("bundler", "~> 1.0")
6
- s.add_development_dependency("json", "~> 1.4")
7
- s.add_development_dependency("maruku", "~> 0.6")
8
- s.add_development_dependency("nokogiri", "~> 1.4")
9
- s.add_development_dependency("rake", "~> 0.8")
10
- s.add_development_dependency("rspec", "~> 2.1")
11
- s.add_development_dependency("simplecov", "~> 0.3")
12
- s.add_development_dependency("webmock", "~> 1.5")
13
- s.add_development_dependency("yard", "~> 0.6")
14
- s.add_development_dependency("ZenTest", "~> 4.4")
15
- s.add_runtime_dependency("hashie", "~> 0.4.0")
16
- s.add_runtime_dependency("faraday", "~> 0.5.3")
17
- s.add_runtime_dependency("faraday_middleware", "~> 0.3.0")
18
- s.add_runtime_dependency("multi_json", "~> 0.0.5")
19
- s.add_runtime_dependency("multi_xml", "~> 0.2.0")
5
+ s.add_development_dependency('bundler', '~> 1.0')
6
+ s.add_development_dependency('json', '~> 1.4')
7
+ s.add_development_dependency('maruku', '~> 0.6')
8
+ s.add_development_dependency('nokogiri', '~> 1.4')
9
+ s.add_development_dependency('rake', '~> 0.8')
10
+ s.add_development_dependency('rspec', '~> 2.4')
11
+ s.add_development_dependency('simplecov', '~> 0.3')
12
+ s.add_development_dependency('webmock', '~> 1.5')
13
+ s.add_development_dependency('yard', '~> 0.6')
14
+ s.add_development_dependency('ZenTest', '~> 4.4')
15
+ s.add_runtime_dependency('hashie', '~> 1.0.0')
16
+ s.add_runtime_dependency('faraday', '~> 0.5.4')
17
+ s.add_runtime_dependency('faraday_middleware', '~> 0.3.1')
18
+ s.add_runtime_dependency('multi_json', '~> 0.0.5')
19
+ s.add_runtime_dependency('multi_xml', '~> 0.2.0')
20
20
  s.authors = ["Dan Melton", "Erik Michaels-Ober"]
21
21
  s.description = %q{A Ruby wrapper for the Open311 API v2.}
22
22
  s.post_install_message =<<eos
23
23
  Using this gem in your project or organization? Add it to the apps wiki!
24
24
  https://github.com/cfalabs/open311/wiki/apps
25
25
  eos
26
- s.email = ["dan@codeforamerica.org"]
26
+ s.email = ['dan@codeforamerica.org', 'erik@codeforamerica.org']
27
27
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
28
28
  s.files = `git ls-files`.split("\n")
29
- s.homepage = "http://rubygems.org/gems/open311"
30
- s.name = "open311"
29
+ s.homepage = 'http://rubygems.org/gems/open311'
30
+ s.name = 'open311'
31
31
  s.platform = Gem::Platform::RUBY
32
- s.require_paths = ["lib"]
33
- s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
32
+ s.require_paths = ['lib']
33
+ s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
34
34
  s.summary = s.description
35
35
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
36
36
  s.version = Open311::VERSION
data/spec/open311_spec.rb CHANGED
@@ -9,19 +9,19 @@ describe Open311, ".service_list" do
9
9
  config.jurisdiction = 'dc.gov'
10
10
  end
11
11
  stub_request(:get, 'http://api.dc.org/open311/v2_dev/services.xml').
12
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
12
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
13
13
  to_return(:body => fixture('services.xml'), :headers => {'Content-Type' => 'text/xml; charset=utf-8'})
14
14
  end
15
15
 
16
16
  it "should request the correct resource" do
17
- Open311.service_list(:lat => '38.888486', :long => '-77.020179')
17
+ Open311.service_list
18
18
  a_request(:get, 'http://api.dc.org/open311/v2_dev/services.xml').
19
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
19
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
20
20
  should have_been_made
21
21
  end
22
22
 
23
23
  it "should return the correct results" do
24
- services = Open311.service_list(:lat => '38.888486', :long => '-77.020179')
24
+ services = Open311.service_list
25
25
  services.should be_an Array
26
26
  services.first.service_code.should == '001'
27
27
  end
@@ -34,19 +34,19 @@ describe Open311, ".service_definition" do
34
34
  config.jurisdiction = 'dc.gov'
35
35
  end
36
36
  stub_request(:get, 'http://blasius.ws:3003/open311/services/033.xml').
37
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
37
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
38
38
  to_return(:body => fixture('service_definition.xml'), :headers => {'Content-Type' => 'text/xml; charset=utf-8'})
39
39
  end
40
40
 
41
41
  it "should request the correct resource" do
42
- Open311.service_definition('033', :lat => '38.888486', :long => '-77.020179')
42
+ Open311.service_definition('033')
43
43
  a_request(:get, 'http://blasius.ws:3003/open311/services/033.xml').
44
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
44
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
45
45
  should have_been_made
46
46
  end
47
47
 
48
48
  it "should return the correct results" do
49
- service_def = Open311.service_definition('033', :lat => '38.888486', :long => '-77.020179')
49
+ service_def = Open311.service_definition('033')
50
50
  service_def.should be_an Hash
51
51
  service_def.service_code.should == "DMV66"
52
52
  end
@@ -59,22 +59,21 @@ describe Open311, ".service_requests" do
59
59
  config.jurisdiction = 'dc.gov'
60
60
  end
61
61
  stub_request(:get, 'http://blasius.ws:3003/open311/requests.xml').
62
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
62
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
63
63
  to_return(:body => fixture('service_requests.xml'), :headers => {'Content-Type' => 'text/xml; charset=utf-8'})
64
64
  end
65
65
 
66
66
  it "should request the correct resource" do
67
- Open311.service_requests(:lat => '38.888486', :long => '-77.020179')
67
+ Open311.service_requests
68
68
  a_request(:get, 'http://blasius.ws:3003/open311/requests.xml').
69
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
69
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
70
70
  should have_been_made
71
71
  end
72
72
 
73
73
  it "should return the correct results" do
74
- service_requests = Open311.service_requests(:lat => '38.888486', :long => '-77.020179')
75
- service_requests.should be_an Array
76
- service_requests.length.should == 2
77
- service_requests.first.id.should == 638344
74
+ services = Open311.service_requests
75
+ services.should be_an Array
76
+ services.first.first.service_request_id.should == '638344'
78
77
  end
79
78
  end
80
79
 
@@ -85,20 +84,21 @@ describe Open311, ".get_service_request" do
85
84
  config.jurisdiction = 'dc.gov'
86
85
  end
87
86
  stub_request(:get, 'http://blasius.ws:3003/open311/requests/638344.xml').
88
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
87
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
89
88
  to_return(:body => fixture('service_requests.xml'), :headers => {'Content-Type' => 'text/xml; charset=utf-8'})
90
89
  end
91
90
 
92
91
  it "should request the correct resource" do
93
- Open311.get_service_request('638344', :lat => '38.888486', :long => '-77.020179')
92
+ Open311.get_service_request(638344)
94
93
  a_request(:get, 'http://blasius.ws:3003/open311/requests/638344.xml').
95
- with(:query => {:jurisdiction_id => 'dc.gov', :lat => '38.888486', :long => '-77.020179'}).
94
+ with(:query => {:jurisdiction_id => 'dc.gov'}).
96
95
  should have_been_made
97
96
  end
98
97
 
99
98
  it "should return the correct results" do
100
- service_request = Open311.get_service_request(638344, :lat => '38.888486', :long => '-77.020179')
101
- service_request.id.should == 638344
99
+ service_request = Open311.get_service_request(638344)
100
+ service_request.should be_an Array
101
+ service_request.first.service_request_id.should == '638344'
102
102
  end
103
103
  end
104
104
 
@@ -115,7 +115,7 @@ describe Open311, ".post_service_request" do
115
115
  :address_string => '1234 5th street',
116
116
  :email => 'smit222@sfgov.edu',
117
117
  :device_id => 'tt222111',
118
- :account_id => '123456',
118
+ :account_id => '12345',
119
119
  :first_name => 'john',
120
120
  :last_name => 'smith',
121
121
  :phone => '111111111',
@@ -135,7 +135,7 @@ describe Open311, ".post_service_request" do
135
135
  end
136
136
  end
137
137
 
138
- describe Open311, ".request_id" do
138
+ describe Open311, ".request_id_from_token" do
139
139
 
140
140
  before do
141
141
  Open311.configure do |config|
@@ -148,16 +148,16 @@ describe Open311, ".request_id" do
148
148
  end
149
149
 
150
150
  it "should request the correct resource" do
151
- Open311.request_id(12345)
151
+ Open311.request_id_from_token(12345)
152
152
  a_request(:get, 'http://open311.sfgov.org/dev/v2/tokens/12345.xml').
153
153
  with(:query => {:jurisdiction_id => 'sfgov.org'}).
154
154
  should have_been_made
155
155
  end
156
156
 
157
157
  it "should return the correct result" do
158
- service_request = Open311.request_id(12345)
159
- service_request.id.should == 638344
160
- service_request.token.should == 12345
158
+ service_request = Open311.request_id_from_token(12345)
159
+ service_request.service_request_id.should == '638344'
160
+ service_request.token.should == '12345'
161
161
  end
162
162
 
163
163
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open311
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 25
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 0
9
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Dan Melton
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-11-18 00:00:00 -08:00
19
+ date: 2011-02-03 00:00:00 -05:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -26,6 +27,7 @@ dependencies:
26
27
  requirements:
27
28
  - - ~>
28
29
  - !ruby/object:Gem::Version
30
+ hash: 15
29
31
  segments:
30
32
  - 1
31
33
  - 0
@@ -40,6 +42,7 @@ dependencies:
40
42
  requirements:
41
43
  - - ~>
42
44
  - !ruby/object:Gem::Version
45
+ hash: 7
43
46
  segments:
44
47
  - 1
45
48
  - 4
@@ -54,6 +57,7 @@ dependencies:
54
57
  requirements:
55
58
  - - ~>
56
59
  - !ruby/object:Gem::Version
60
+ hash: 7
57
61
  segments:
58
62
  - 0
59
63
  - 6
@@ -68,6 +72,7 @@ dependencies:
68
72
  requirements:
69
73
  - - ~>
70
74
  - !ruby/object:Gem::Version
75
+ hash: 7
71
76
  segments:
72
77
  - 1
73
78
  - 4
@@ -82,6 +87,7 @@ dependencies:
82
87
  requirements:
83
88
  - - ~>
84
89
  - !ruby/object:Gem::Version
90
+ hash: 27
85
91
  segments:
86
92
  - 0
87
93
  - 8
@@ -96,10 +102,11 @@ dependencies:
96
102
  requirements:
97
103
  - - ~>
98
104
  - !ruby/object:Gem::Version
105
+ hash: 11
99
106
  segments:
100
107
  - 2
101
- - 1
102
- version: "2.1"
108
+ - 4
109
+ version: "2.4"
103
110
  type: :development
104
111
  version_requirements: *id006
105
112
  - !ruby/object:Gem::Dependency
@@ -110,6 +117,7 @@ dependencies:
110
117
  requirements:
111
118
  - - ~>
112
119
  - !ruby/object:Gem::Version
120
+ hash: 13
113
121
  segments:
114
122
  - 0
115
123
  - 3
@@ -124,6 +132,7 @@ dependencies:
124
132
  requirements:
125
133
  - - ~>
126
134
  - !ruby/object:Gem::Version
135
+ hash: 5
127
136
  segments:
128
137
  - 1
129
138
  - 5
@@ -138,6 +147,7 @@ dependencies:
138
147
  requirements:
139
148
  - - ~>
140
149
  - !ruby/object:Gem::Version
150
+ hash: 7
141
151
  segments:
142
152
  - 0
143
153
  - 6
@@ -152,6 +162,7 @@ dependencies:
152
162
  requirements:
153
163
  - - ~>
154
164
  - !ruby/object:Gem::Version
165
+ hash: 19
155
166
  segments:
156
167
  - 4
157
168
  - 4
@@ -166,11 +177,12 @@ dependencies:
166
177
  requirements:
167
178
  - - ~>
168
179
  - !ruby/object:Gem::Version
180
+ hash: 23
169
181
  segments:
182
+ - 1
170
183
  - 0
171
- - 4
172
184
  - 0
173
- version: 0.4.0
185
+ version: 1.0.0
174
186
  type: :runtime
175
187
  version_requirements: *id011
176
188
  - !ruby/object:Gem::Dependency
@@ -181,11 +193,12 @@ dependencies:
181
193
  requirements:
182
194
  - - ~>
183
195
  - !ruby/object:Gem::Version
196
+ hash: 3
184
197
  segments:
185
198
  - 0
186
199
  - 5
187
- - 3
188
- version: 0.5.3
200
+ - 4
201
+ version: 0.5.4
189
202
  type: :runtime
190
203
  version_requirements: *id012
191
204
  - !ruby/object:Gem::Dependency
@@ -196,11 +209,12 @@ dependencies:
196
209
  requirements:
197
210
  - - ~>
198
211
  - !ruby/object:Gem::Version
212
+ hash: 17
199
213
  segments:
200
214
  - 0
201
215
  - 3
202
- - 0
203
- version: 0.3.0
216
+ - 1
217
+ version: 0.3.1
204
218
  type: :runtime
205
219
  version_requirements: *id013
206
220
  - !ruby/object:Gem::Dependency
@@ -211,6 +225,7 @@ dependencies:
211
225
  requirements:
212
226
  - - ~>
213
227
  - !ruby/object:Gem::Version
228
+ hash: 21
214
229
  segments:
215
230
  - 0
216
231
  - 0
@@ -226,6 +241,7 @@ dependencies:
226
241
  requirements:
227
242
  - - ~>
228
243
  - !ruby/object:Gem::Version
244
+ hash: 23
229
245
  segments:
230
246
  - 0
231
247
  - 2
@@ -236,6 +252,7 @@ dependencies:
236
252
  description: A Ruby wrapper for the Open311 API v2.
237
253
  email:
238
254
  - dan@codeforamerica.org
255
+ - erik@codeforamerica.org
239
256
  executables: []
240
257
 
241
258
  extensions: []
@@ -243,15 +260,14 @@ extensions: []
243
260
  extra_rdoc_files: []
244
261
 
245
262
  files:
263
+ - .gemtest
246
264
  - .gitignore
247
265
  - .rspec
248
266
  - .yardopts
249
267
  - Gemfile
250
- - Gemfile.lock
251
268
  - LICENSE.mkd
252
269
  - README.mkd
253
270
  - Rakefile
254
- - autotest/discover.rb
255
271
  - lib/faraday/multipart.rb
256
272
  - lib/faraday/raise_error.rb
257
273
  - lib/open311.rb
@@ -260,7 +276,6 @@ files:
260
276
  - lib/open311/client/request.rb
261
277
  - lib/open311/client/service.rb
262
278
  - lib/open311/configuration.rb
263
- - lib/open311/service_request.rb
264
279
  - lib/open311/version.rb
265
280
  - open311.gemspec
266
281
  - spec/fixtures/403.xml
@@ -289,6 +304,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
289
304
  requirements:
290
305
  - - ">="
291
306
  - !ruby/object:Gem::Version
307
+ hash: 3
292
308
  segments:
293
309
  - 0
294
310
  version: "0"
@@ -297,6 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
313
  requirements:
298
314
  - - ">="
299
315
  - !ruby/object:Gem::Version
316
+ hash: 23
300
317
  segments:
301
318
  - 1
302
319
  - 3
@@ -305,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
322
  requirements: []
306
323
 
307
324
  rubyforge_project:
308
- rubygems_version: 1.3.7
325
+ rubygems_version: 1.5.0
309
326
  signing_key:
310
327
  specification_version: 3
311
328
  summary: A Ruby wrapper for the Open311 API v2.
data/Gemfile.lock DELETED
@@ -1,75 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- open311 (0.1.0)
5
- faraday (~> 0.5.3)
6
- faraday_middleware (~> 0.3.0)
7
- hashie (~> 0.4.0)
8
- multi_json (~> 0.0.5)
9
- multi_xml (~> 0.2.0)
10
-
11
- GEM
12
- remote: http://rubygems.org/
13
- specs:
14
- ZenTest (4.4.0)
15
- addressable (2.2.2)
16
- crack (0.1.8)
17
- diff-lcs (1.1.2)
18
- faraday (0.5.3)
19
- addressable (~> 2.2.2)
20
- multipart-post (~> 1.0.1)
21
- rack (>= 1.1.0, < 2)
22
- faraday_middleware (0.3.0)
23
- faraday (~> 0.5.3)
24
- hashie (0.4.0)
25
- json (1.4.6)
26
- json (1.4.6-java)
27
- maruku (0.6.0)
28
- syntax (>= 1.0.0)
29
- multi_json (0.0.5)
30
- multi_xml (0.2.0)
31
- multipart-post (1.0.1)
32
- nokogiri (1.4.4)
33
- nokogiri (1.4.4-java)
34
- weakling (>= 0.0.3)
35
- rack (1.2.1)
36
- rake (0.8.7)
37
- rspec (2.1.0)
38
- rspec-core (~> 2.1.0)
39
- rspec-expectations (~> 2.1.0)
40
- rspec-mocks (~> 2.1.0)
41
- rspec-core (2.1.0)
42
- rspec-expectations (2.1.0)
43
- diff-lcs (~> 1.1.2)
44
- rspec-mocks (2.1.0)
45
- simplecov (0.3.7)
46
- simplecov-html (>= 0.3.7)
47
- simplecov-html (0.3.9)
48
- syntax (1.0.0)
49
- weakling (0.0.4-java)
50
- webmock (1.6.1)
51
- addressable (>= 2.2.2)
52
- crack (>= 0.1.7)
53
- yard (0.6.2)
54
-
55
- PLATFORMS
56
- java
57
- ruby
58
-
59
- DEPENDENCIES
60
- ZenTest (~> 4.4)
61
- bundler (~> 1.0)
62
- faraday (~> 0.5.3)
63
- faraday_middleware (~> 0.3.0)
64
- hashie (~> 0.4.0)
65
- json (~> 1.4)
66
- maruku (~> 0.6)
67
- multi_json (~> 0.0.5)
68
- multi_xml (~> 0.2.0)
69
- nokogiri (~> 1.4)
70
- open311!
71
- rake (~> 0.8)
72
- rspec (~> 2.1)
73
- simplecov (~> 0.3)
74
- webmock (~> 1.5)
75
- yard (~> 0.6)
data/autotest/discover.rb DELETED
@@ -1 +0,0 @@
1
- Autotest.add_discovery { "rspec2" }
@@ -1,17 +0,0 @@
1
- module Open311
2
- class ServiceRequest
3
- attr_reader :token, :id
4
-
5
- def initialize(hash)
6
- @hash = hash
7
- @id = hash.service_request_id.to_i
8
- @token = hash.token.to_i
9
- end
10
-
11
- # Delegate to the hash
12
- def self.method_missing(method, *args, &block)
13
- return super unless @hash.has_key?(method)
14
- @hash[method]
15
- end
16
- end
17
- end