govkit-ca 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e88d9a36dfcf9ce1825f8a204c801d2c3c902ee
4
- data.tar.gz: 527b1088c8bffbd00458b6e7855c3e365994fbb6
3
+ metadata.gz: e58a517d9f96338f427bcfbb1c44708a0c884465
4
+ data.tar.gz: e627c42f76ebcb8c7f4f67dc5f4111d321dbfc92
5
5
  SHA512:
6
- metadata.gz: 3cb1d44087529a014496717a00a38435f66aa1db7e02dddc7ecfb3a78d958e2f0f754a449a33329d73123690ed7178d99faf9ea19e4d630dc46c95e08a4f0596
7
- data.tar.gz: 9a46ef38c43306f7c733dd8eb105d4e6b03c39a3db644c4b205e26820a3f0e6a60928e87feeb4abd7f6dbc93f4a69402bb1b04fe89e28f19af7e21ce89b3c859
6
+ metadata.gz: b12f06c40c84cc8306d3cedffefb28b2282e7b275d1fe032d409a30f94130d9e260d264172e12d9d07664d8b23e8c076df909b67542d9d0e71c44bdb90edc2bd
7
+ data.tar.gz: 145f7062965b4e230b84b5d001aa4950e9871d113deedc280aeef6c8a71f096973da26e91d1fc3889cde2ad5bfef035430ff7b921dbd1a58e58f258911513d6f
@@ -3,6 +3,11 @@ module GovKit
3
3
  # A Ruby wrapper for the Represent API.
4
4
  # @see http://represent.opennorth.ca/api/
5
5
  class Represent
6
+ # @param [Faraday::Connection] connection a Faraday connection
7
+ def initialize(connection = nil)
8
+ @client = connection || Faraday
9
+ end
10
+
6
11
  # Get boundary sets.
7
12
  #
8
13
  # @param [Hash] opts optional arguments
@@ -92,7 +97,7 @@ module GovKit
92
97
  def request(parts, opts)
93
98
  begin
94
99
  url = "http://represent.opennorth.ca/#{parts.compact.join('/')}/"
95
- response = Faraday.get(url, opts)
100
+ response = @client.get(url, opts)
96
101
  case response.status
97
102
  when 200
98
103
  JSON.parse(response.body)
@@ -1,5 +1,5 @@
1
1
  module GovKit
2
2
  module CA
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -6,6 +6,14 @@ describe GovKit::CA::Represent do
6
6
  GovKit::CA::Represent.new
7
7
  end
8
8
 
9
+ it 'should accept a custom connection' do
10
+ connection = Faraday.new do |connection|
11
+ connection.request :url_encoded
12
+ connection.adapter Faraday.default_adapter
13
+ end
14
+ expect{GovKit::CA::Represent.new(connection)}.to_not raise_error
15
+ end
16
+
9
17
  it 'should return boundary sets' do
10
18
  response = api.boundary_sets
11
19
  response.should be_a(Hash)
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govkit-ca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Open North
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-05 00:00:00.000000000 Z
11
+ date: 2014-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.10.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.5.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.5.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.6.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.6.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: coveralls
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: mime-types
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '1.16'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.16'
125
125
  description: GovKit-CA lets you quickly get encapsulated Ruby objects for Canadian
@@ -130,9 +130,9 @@ executables: []
130
130
  extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
- - .gitignore
134
- - .travis.yml
135
- - .yardopts
133
+ - ".gitignore"
134
+ - ".travis.yml"
135
+ - ".yardopts"
136
136
  - Gemfile
137
137
  - LICENSE
138
138
  - README.md
@@ -180,17 +180,17 @@ require_paths:
180
180
  - lib
181
181
  required_ruby_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - '>='
183
+ - - ">="
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  requirements:
188
- - - '>='
188
+ - - ">="
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
192
  rubyforge_project: govkit-ca
193
- rubygems_version: 2.0.8
193
+ rubygems_version: 2.2.2
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Easy access to Canadian civic data around the web