fipe_api 0.3.1 → 0.3.2

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: fd6b1b6001408f2676c045cbe0924be8cf72b725
4
- data.tar.gz: daffad8b5e88daa3b001296f649859321ee4d893
3
+ metadata.gz: bc0afa96ed2602fb1beb733220426ff25f638b12
4
+ data.tar.gz: 66982e70174482e538d7eb23918e1654efb9139a
5
5
  SHA512:
6
- metadata.gz: ef2e5d438a4383d64cff3ed9699e5b72f04456972f3e534a093b0548bd6c32097ab1bb8011e97fef8d71757e4d0f219a22181eace7146ba7a2b75e1172a9ef42
7
- data.tar.gz: 8ec1b21584254165fcc544fa9be87fe4dc52f41848bf587cb9e0aa422e8844bd8bd3fe5f32decbbd1ce40443d24c3c310b69bef598859124fdfe0a97f230be6f
6
+ metadata.gz: ca9297efe8a21bf18224c137f11b401a9793130b74679456fdef27a4be0c3bb6603a606ac8875e209ba587e522f8780d2537f1a13d07decd14dd89859f8f4366
7
+ data.tar.gz: 6a37cfc07910664f493457fa5c1df58e33e53b67fefd3eb77e2e3a30a4a3df64743a741e098c75b43b1b0c1b9a999df526e199f62f2b3f9553eeb13da491a73e
data/README.md CHANGED
@@ -75,6 +75,12 @@ Once you have a vehicle and a given table, you can get all of the vehicle`s Bran
75
75
  brands = vehicle.get_brands(table) #If you don`t pass a table, it will use the latest table for the vehicle.
76
76
  ```
77
77
 
78
+ You can also filter the the array by name if you want to get an specific brand:
79
+
80
+ ```ruby
81
+ brand = vehicle.get_brands.find{|b| b.name == 'Ford' }
82
+ ```
83
+
78
84
  Now you can retrieve all Models for an specific brand. For the Ford brand we have as examples of models: Fiesta, Fusion, Taurus, etc. Use this syntax to get
79
85
  all models:
80
86
 
@@ -105,7 +111,7 @@ result.url #=> http://www.fipe.org.br/pt-br/indices/veiculos/carro/ford/7-2015/0
105
111
 
106
112
  ## Development
107
113
 
108
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
114
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. To run the tests, use `rake spec`.
109
115
 
110
116
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
111
117
 
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "fipe_api"
8
8
  spec.version = FipeApi::VERSION
9
9
  spec.authors = ["Caio Teixeira"]
10
- spec.email = ["caiofct@ifce.edu.br"]
10
+ spec.email = ["caiofct@gmail.com"]
11
11
 
12
12
  spec.summary = %q{A ruby client to consume Tabela Fipe api data - http://veiculos.fipe.org.br/}
13
13
  spec.description = %q{This application is a ruby client to the Tabela Fipe Api - http://veiculos.fipe.org.br/. It makes use of the excellent http gem to make http requests and nokogiri to parse the responses.}
@@ -1,12 +1,14 @@
1
1
  module FipeApi
2
2
  class Year < FipeApi::Base
3
3
  attr_accessor :id
4
+ attr_accessor :year
4
5
  attr_accessor :name
5
6
  attr_accessor :model
6
7
  attr_accessor :fuel
7
8
 
8
9
  def initialize(id, name, model)
9
10
  self.id = id.split("-")[0]
11
+ self.year = self.id == '32000' ? Date.current.year : self.id
10
12
  self.fuel = id.split("-")[1]
11
13
  self.name = name
12
14
  self.model = model
@@ -1,3 +1,3 @@
1
1
  module FipeApi
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fipe_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caio Teixeira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-26 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.9'
20
20
  type: :development
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: '1.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
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: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.3'
48
48
  type: :development
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: '3.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: byebug
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '5.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: '5.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.6'
76
76
  type: :runtime
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: '1.6'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: http
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '2.0'
90
90
  type: :runtime
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: '2.0'
97
97
  description: This application is a ruby client to the Tabela Fipe Api - http://veiculos.fipe.org.br/.
98
98
  It makes use of the excellent http gem to make http requests and nokogiri to parse
99
99
  the responses.
100
100
  email:
101
- - caiofct@ifce.edu.br
101
+ - caiofct@gmail.com
102
102
  executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - .gitignore
107
- - .rspec
108
- - .travis.yml
106
+ - ".gitignore"
107
+ - ".rspec"
108
+ - ".travis.yml"
109
109
  - CODE_OF_CONDUCT.md
110
110
  - Gemfile
111
111
  - LICENSE.txt
@@ -134,17 +134,17 @@ require_paths:
134
134
  - lib
135
135
  required_ruby_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - '>='
137
+ - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '2.0'
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '>='
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: 1.3.5
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.4.8
147
+ rubygems_version: 2.6.11
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: A ruby client to consume Tabela Fipe api data - http://veiculos.fipe.org.br/