intelipost 0.0.2 → 0.0.3

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: 4c193215181b741e2bf5f458233728acf3e08342
4
- data.tar.gz: 13241a8a94899805bca60720d5b09ec06523a28e
3
+ metadata.gz: f25b204e3cf8bfb468eeafcba50a04f188c243f1
4
+ data.tar.gz: b1349e5f37a08e0c6c3fb31385ee5ab8036c6a4e
5
5
  SHA512:
6
- metadata.gz: 856e00cddf24e9d51264dcb74a5a5059c2e3046d6e17c55d79a336d378211bd37451631be0229015a52428ea2b44edb57e96e306923ee8ca6965503d74044539
7
- data.tar.gz: b04e81f87b0f341a62028d9f1637e1a2185f27ccaa2b58a739080914736af3234630f868dd69664a1781304162a1f1317e7414503325e8f70b7e451d8660ede6
6
+ metadata.gz: ecd0064e1f33834f600f3580b99d3b6309b761d99bbc02a1d67134207fea23a07223f097bf871713aaefd6bf8998f50275074967c5c94e7a276d495401952ac7
7
+ data.tar.gz: 3ad76c9ac138e6f3a658899cd3717d8fa4f786e3875b02e305a524aa11a159e24f34c932fcce27cd86aecf4297a8ac9fd3c4d2e1613d70aff4da2556c7799c50
data/README.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # intelipost
2
2
  Gem for the Intelipost API
3
3
 
4
+ ### Usage:
5
+
6
+ ````ruby
7
+ require 'intelipost'
8
+
9
+ client = Intelipost::Client.new api_key: <your api key>
10
+ address = client.cep.address_complete '05307000'
11
+ # => #<Hashie::Mash content=#<Hashie::Mash bairro="Vila Ribeiro de Barros" city="São Paulo" ibge="3550308" neighborhood="Vila Ribeiro de Barros" state="São Paulo" state_short="SP" street="R Maj Paladino"> messages=[] status="OK" time="0.6 ms">
12
+ address.content.street
13
+ # => "R Maj Paladino"
14
+ ````
15
+
16
+ ### Development:
17
+
4
18
  For testing, create a `.env` file with the following content:
5
19
  ````bash
6
20
  INTELIPOST_API_KEY=<YOUR API KEY>
data/Rakefile CHANGED
@@ -8,4 +8,8 @@ task :coverage do
8
8
  Rake::Task["spec"].execute
9
9
  end
10
10
 
11
+ task :console do
12
+ sh "irb -rubygems -r intelipost"
13
+ end
14
+
11
15
  task :default => :spec
data/intelipost.gemspec CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "faraday", "~> 0.9.1"
22
22
  spec.add_dependency "faraday_middleware", "~> 0.9.1"
23
23
  spec.add_dependency "hashie", "~> 3.4.1"
24
- spec.add_dependency "dotenv", "~> 2.0.1"
25
24
 
26
25
  spec.add_development_dependency "bundler", "~> 1.9.4"
27
26
  spec.add_development_dependency "rake", "~> 10.4.2"
@@ -29,4 +28,5 @@ Gem::Specification.new do |spec|
29
28
  spec.add_development_dependency "vcr", "~> 2.9.3"
30
29
  spec.add_development_dependency "webmock", "~> 1.21"
31
30
  spec.add_development_dependency "simplecov", "~> 0.10"
31
+ spec.add_development_dependency "dotenv", "~> 2.0.1"
32
32
  end
data/lib/intelipost.rb CHANGED
@@ -1,6 +1,7 @@
1
+ require "uri"
2
+ require "hashie"
1
3
  require "faraday"
2
4
  require "faraday_middleware"
3
- require "hashie"
4
5
  require "intelipost/version"
5
6
  require "intelipost/fluent_interface"
6
7
  require "intelipost/client"
@@ -22,6 +22,7 @@ module Intelipost
22
22
  Faraday.new(url: @uri.to_s) do |conn|
23
23
  conn.request :json
24
24
 
25
+ conn.response :mashify
25
26
  conn.response :json
26
27
 
27
28
  conn.headers['api_key'] = api_key
@@ -1,3 +1,3 @@
1
1
  module Intelipost
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -33,8 +33,8 @@ describe Intelipost::Client, :vcr do
33
33
  end
34
34
 
35
35
  describe '#cep' do
36
- it 'returns an correct response' do
37
- expect(subject.cep.address_complete('04661100')).to include('content')
36
+ it 'returns a Hashie::Mash' do
37
+ expect(subject.cep.address_complete('04661100').class).to be Hashie::Mash
38
38
  end
39
39
  end
40
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intelipost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Sampaio
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.4.1
55
- - !ruby/object:Gem::Dependency
56
- name: dotenv
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 2.0.1
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 2.0.1
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: bundler
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +136,20 @@ dependencies:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
138
  version: '0.10'
139
+ - !ruby/object:Gem::Dependency
140
+ name: dotenv
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 2.0.1
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 2.0.1
153
153
  description: Gem to access the REST API of Intelipost
154
154
  email:
155
155
  - eduardo@sampa.io