firmapi 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08b93139c36bc91b8b40a9afeab73add50e54085
4
- data.tar.gz: 06ec6c20964bbe15df7e896402153986a245f79d
3
+ metadata.gz: 09e0301bde4f4e4e58252837bdb205e22d50cd0c
4
+ data.tar.gz: 8811b661e1e4167fde0de829a7626dc2e6a9c731
5
5
  SHA512:
6
- metadata.gz: 750139078fe186b3a022dabe4250772fc7e1cf7cc2e1cabf62206a18f216889ba773d492f190981671c860d5cec4306a22220da6c466b3bd8d8094ca919e58c3
7
- data.tar.gz: 178fd2b97bc873c6fe527b2afb0317170c50779de87df6ea367a0a392b83ce3d95d8bfb5b643cad7aa6084b9ee3c072916dc75a59dee5d138a8b0742a50ab6c3
6
+ metadata.gz: a315bb0ad5177744c3c1fbde0121790beae0e9bf8b55d3c16f554decf4d273d2196dca03d38858c952a0fcbe5f2c0b03f66d6dbe62b967c4101da8863b49d691
7
+ data.tar.gz: 45eb15999b6a77c672a3201ea366002821359edf0d481f77b7fa398bc50bb566eb4c671b82eb75ce38f0809645ac04a9495b6ebfb3ad36aa217ac222092c19f0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- firmapi (0.1.3)
4
+ firmapi (0.1.4)
5
5
  faraday (~> 0.9)
6
6
  faraday_middleware (~> 0.9)
7
7
  virtus (~> 1.0)
@@ -8,6 +8,7 @@ module Firmapi
8
8
  require 'firmapi/api'
9
9
  require 'firmapi/configuration'
10
10
  require 'firmapi/financial_year'
11
+ require 'firmapi/location'
11
12
  require 'firmapi/companies'
12
13
  require 'firmapi/company'
13
14
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Firmapi
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -21,7 +21,7 @@ http_interactions:
21
21
  Server:
22
22
  - nginx/1.4.1 (Ubuntu)
23
23
  Date:
24
- - Fri, 06 Jun 2014 12:43:33 GMT
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
- - '"ef8fa7287179f2c5bbd81ec627358a0b"'
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
- - d77bcb08-828e-4f56-8dbb-eb5fc2644a5d
44
+ - 129f2874-0900-41cb-a4a6-9283e3648b69
45
45
  X-Runtime:
46
- - '0.042333'
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: Fri, 06 Jun 2014 12:43:33 GMT
53
+ recorded_at: Tue, 17 Jun 2014 11:08:32 GMT
54
54
  recorded_with: VCR 2.9.2
@@ -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.3
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 00:00:00.000000000 Z
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.14
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