firmapi 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/firmapi.rb +1 -0
- data/lib/firmapi/company.rb +2 -0
- data/lib/firmapi/location.rb +13 -0
- data/lib/firmapi/version.rb +1 -1
- data/spec/cassettes/find_single_company_with_valid_siren.yml +6 -6
- data/spec/company_spec.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09e0301bde4f4e4e58252837bdb205e22d50cd0c
|
4
|
+
data.tar.gz: 8811b661e1e4167fde0de829a7626dc2e6a9c731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a315bb0ad5177744c3c1fbde0121790beae0e9bf8b55d3c16f554decf4d273d2196dca03d38858c952a0fcbe5f2c0b03f66d6dbe62b967c4101da8863b49d691
|
7
|
+
data.tar.gz: 45eb15999b6a77c672a3201ea366002821359edf0d481f77b7fa398bc50bb566eb4c671b82eb75ce38f0809645ac04a9495b6ebfb3ad36aa217ac222092c19f0
|
data/Gemfile.lock
CHANGED
data/lib/firmapi.rb
CHANGED
data/lib/firmapi/company.rb
CHANGED
@@ -17,7 +17,9 @@ module Firmapi
|
|
17
17
|
attribute :registration_date, Date
|
18
18
|
attribute :cessation_date, Date
|
19
19
|
attribute :website, String
|
20
|
+
attribute :phone, String
|
20
21
|
attribute :financial_activity, Array[FinancialYear]
|
22
|
+
attribute :location, Location
|
21
23
|
|
22
24
|
def self.find_by_siren!(siren)
|
23
25
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Firmapi
|
2
|
+
class Location
|
3
|
+
include Virtus.model
|
4
|
+
|
5
|
+
attribute :latitude, Float
|
6
|
+
attribute :longitude, Float
|
7
|
+
|
8
|
+
def ==(other_location)
|
9
|
+
self.latitude == other_location.latitude && self.longitude == other_location.longitude
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
data/lib/firmapi/version.rb
CHANGED
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- nginx/1.4.1 (Ubuntu)
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Tue, 17 Jun 2014 11:08:31 GMT
|
25
25
|
Content-Type:
|
26
26
|
- application/json; charset=utf-8
|
27
27
|
Transfer-Encoding:
|
@@ -35,20 +35,20 @@ http_interactions:
|
|
35
35
|
X-Content-Type-Options:
|
36
36
|
- nosniff
|
37
37
|
Etag:
|
38
|
-
- '"
|
38
|
+
- '"48143e943be730c99c2ba89ef0102582"'
|
39
39
|
Cache-Control:
|
40
40
|
- max-age=0, private, must-revalidate
|
41
41
|
Set-Cookie:
|
42
42
|
- request_method=GET; path=/
|
43
43
|
X-Request-Id:
|
44
|
-
-
|
44
|
+
- 129f2874-0900-41cb-a4a6-9283e3648b69
|
45
45
|
X-Runtime:
|
46
|
-
- '0.
|
46
|
+
- '0.055562'
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
49
|
string: '{"input":{"siren":"480470152"},"result":{"siren":"480470152","name":"Norauto
|
50
50
|
France","nic":"00012","commercial_name":null,"official_name":"NORAUTO FRANCE","naf_code":"4532Z","legal_form":"SAS","address":"511
|
51
|
-
589 R Des Seringats","postal_code":"59262","city":"Sainghin En Melantois","vat_number":"FR71480470152","number_of_establishments":230,"registration_date":"2005-01-20","cessation_date":null,"website":"http://centres.norauto.fr/110-norauto-leers?utm_source=google\u0026utm_medium=places\u0026utm_campaign=Norauto_20121219JC","financial_activity":[{"publication_year":2012,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2012-09-29"},{"publication_year":2011,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2011-09-29"},{"publication_year":2010,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2010-09-29"},{"publication_year":2009,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2009-09-29"}]}}'
|
51
|
+
589 R Des Seringats","postal_code":"59262","city":"Sainghin En Melantois","vat_number":"FR71480470152","number_of_establishments":230,"registration_date":"2005-01-20","cessation_date":null,"website":"http://centres.norauto.fr/110-norauto-leers?utm_source=google\u0026utm_medium=places\u0026utm_campaign=Norauto_20121219JC","location":{"latitude":"50.68216","longitude":"3.22235"},"financial_activity":[{"publication_year":2012,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2012-09-29"},{"publication_year":2011,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2011-09-29"},{"publication_year":2010,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2010-09-29"},{"publication_year":2009,"turnover":null,"income":null,"workforce_count":null,"publication_date":"2009-09-29"}]}}'
|
52
52
|
http_version:
|
53
|
-
recorded_at:
|
53
|
+
recorded_at: Tue, 17 Jun 2014 11:08:32 GMT
|
54
54
|
recorded_with: VCR 2.9.2
|
data/spec/company_spec.rb
CHANGED
@@ -28,7 +28,9 @@ describe Firmapi::Company do
|
|
28
28
|
it { expect(company.number_of_establishments).to eq(230) }
|
29
29
|
it { expect(company.registration_date).to eq(Date.new(2005, 1, 20)) }
|
30
30
|
it { expect(company.cessation_date).to be_nil }
|
31
|
+
it { expect(company.phone).to be_nil }
|
31
32
|
it { expect(company.website).to eq("http://centres.norauto.fr/110-norauto-leers?utm_source=google\u0026utm_medium=places\u0026utm_campaign=Norauto_20121219JC") }
|
33
|
+
it { expect(company.location).to eq(Firmapi::Location.new(latitude: 50.68216, longitude: 3.22235)) }
|
32
34
|
|
33
35
|
context 'financial_activity' do
|
34
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firmapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Etienne Depaulis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/firmapi/company.rb
|
158
158
|
- lib/firmapi/configuration.rb
|
159
159
|
- lib/firmapi/financial_year.rb
|
160
|
+
- lib/firmapi/location.rb
|
160
161
|
- lib/firmapi/version.rb
|
161
162
|
- spec/cassettes/find_companies_with_valid_siren.yml
|
162
163
|
- spec/cassettes/find_companies_with_valid_siren_next_page.yml
|
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
186
|
version: '0'
|
186
187
|
requirements: []
|
187
188
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.0
|
189
|
+
rubygems_version: 2.3.0
|
189
190
|
signing_key:
|
190
191
|
specification_version: 4
|
191
192
|
summary: Firmapi is a ruby client for www.firmapi.com JSON API
|