bipbop 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +11 -11
  3. data/Gemfile.lock +14 -14
  4. data/VERSION +1 -1
  5. data/bipbop.gemspec +12 -12
  6. data/lib/bipbop.rb +6 -5
  7. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a8ec406ba88e0c7415e8bcfead6064cc52f0d1b
4
- data.tar.gz: 2ede692611125adc0278418d1e6b6e9d2517b878
3
+ metadata.gz: 52a35984ef6b9ea848449270dd4b23edc1001aaa
4
+ data.tar.gz: 70fceb3a8c371f5ee9ff5e8e05b9b1a9eab7006c
5
5
  SHA512:
6
- metadata.gz: 985c745f71f61b0a4e63be3bac5620546a57853226eb78bdb5151552c54a96564cac91f846ebdec81c1ac200b29f678c48f9adf85b8c06a1f880a796ec0db210
7
- data.tar.gz: a3ab64458455c2f0d8469eba64b069ea109cf7e43d9b7e691a13aeffaa9e7f662e59a6bb18b75451bdf8631ee305dd266129ad8d5d612f27d11b2f0c92bb1657
6
+ metadata.gz: b19b9fb740591c86f4df3de8f0dd807515b42ea12b2964fca871e4e8d4f3d7510da023a60890102ce9fa6244b07bd5d4a59a1991fb89cdf5b71d40a8835a6570
7
+ data.tar.gz: eba30d15e0e7c7b59a4f3f1183aa05b32a07db53ff63bb8088ae4b8f97cf45dd799bed06dae237a412e19b92f11449557f03ca254408f2916d383e8cd0508012
data/Gemfile CHANGED
@@ -1,21 +1,21 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
- # gem "activesupport", ">= 2.3.5"
4
+ # gem 'activesupport', '>= 2.3.5'
5
5
 
6
6
  gem 'httparty', '0.13.1'
7
7
 
8
8
  # Add dependencies to develop your gem here.
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
- gem "rspec", "2.8.0"
12
- gem "rdoc", "3.12.2"
13
- gem "bundler", "1.6.2"
14
- gem "jeweler", "2.0.1"
15
- gem "simplecov", "0.9.1"
16
- gem "vcr", "2.9.3"
17
- gem "webmock", "1.19.0"
18
- gem "dotenv", "0.11.1"
11
+ gem 'rspec', '2.8.0'
12
+ gem 'rdoc', '3.12.2'
13
+ gem 'bundler', '1.8.3'
14
+ gem 'jeweler', '2.0.1'
15
+ gem 'simplecov', '0.9.1'
16
+ gem 'vcr', '2.9.3'
17
+ gem 'webmock', '1.20.0'
18
+ gem 'dotenv', '0.11.1'
19
19
  gem 'codeclimate-test-reporter', '0.4.0', group: :test, require: nil
20
- gem 'coveralls', '0.7.0', require: false
20
+ gem 'coveralls', '0.7.11', require: false
21
21
  end
@@ -5,12 +5,12 @@ GEM
5
5
  builder (3.2.2)
6
6
  codeclimate-test-reporter (0.4.0)
7
7
  simplecov (>= 0.7.1, < 1.0.0)
8
- coveralls (0.7.0)
9
- multi_json (~> 1.3)
10
- rest-client
11
- simplecov (>= 0.7)
12
- term-ansicolor
13
- thor
8
+ coveralls (0.7.11)
9
+ multi_json (~> 1.10)
10
+ rest-client (>= 1.6.8, < 2)
11
+ simplecov (~> 0.9.1)
12
+ term-ansicolor (~> 1.3)
13
+ thor (~> 0.19.1)
14
14
  crack (0.4.2)
15
15
  safe_yaml (~> 1.0.0)
16
16
  descendants_tracker (0.0.4)
@@ -47,12 +47,12 @@ GEM
47
47
  rdoc
48
48
  json (1.8.1)
49
49
  jwt (1.0.0)
50
- mime-types (2.3)
50
+ mime-types (2.4.3)
51
51
  mini_portile (0.6.0)
52
52
  multi_json (1.10.1)
53
53
  multi_xml (0.5.5)
54
54
  multipart-post (2.0.0)
55
- netrc (0.7.7)
55
+ netrc (0.10.3)
56
56
  nokogiri (1.6.3.1)
57
57
  mini_portile (= 0.6.0)
58
58
  oauth2 (1.0.0)
@@ -65,7 +65,7 @@ GEM
65
65
  rake (10.3.2)
66
66
  rdoc (3.12.2)
67
67
  json (~> 1.4)
68
- rest-client (1.7.2)
68
+ rest-client (1.7.3)
69
69
  mime-types (>= 1.16, < 3.0)
70
70
  netrc (~> 0.7)
71
71
  rspec (2.8.0)
@@ -86,9 +86,9 @@ GEM
86
86
  tins (~> 1.0)
87
87
  thor (0.19.1)
88
88
  thread_safe (0.3.4)
89
- tins (1.3.3)
89
+ tins (1.3.4)
90
90
  vcr (2.9.3)
91
- webmock (1.19.0)
91
+ webmock (1.20.0)
92
92
  addressable (>= 2.3.6)
93
93
  crack (>= 0.3.2)
94
94
 
@@ -96,9 +96,9 @@ PLATFORMS
96
96
  ruby
97
97
 
98
98
  DEPENDENCIES
99
- bundler (= 1.6.2)
99
+ bundler (= 1.8.3)
100
100
  codeclimate-test-reporter (= 0.4.0)
101
- coveralls (= 0.7.0)
101
+ coveralls (= 0.7.11)
102
102
  dotenv (= 0.11.1)
103
103
  httparty (= 0.13.1)
104
104
  jeweler (= 2.0.1)
@@ -106,4 +106,4 @@ DEPENDENCIES
106
106
  rspec (= 2.8.0)
107
107
  simplecov (= 0.9.1)
108
108
  vcr (= 2.9.3)
109
- webmock (= 1.19.0)
109
+ webmock (= 1.20.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bipbop 0.5.0 ruby lib
5
+ # stub: bipbop 0.5.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bipbop"
9
- s.version = "0.5.0"
9
+ s.version = "0.5.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Rafael Lima"]
14
- s.date = "2014-10-03"
14
+ s.date = "2015-02-27"
15
15
  s.description = "bipbop is the best service for consulting brazilian data. See http://bipbop.com.br/ for more information. "
16
16
  s.email = "contato@rafael.adm.br"
17
17
  s.extra_rdoc_files = [
@@ -57,39 +57,39 @@ Gem::Specification.new do |s|
57
57
  s.add_runtime_dependency(%q<httparty>, ["= 0.13.1"])
58
58
  s.add_development_dependency(%q<rspec>, ["= 2.8.0"])
59
59
  s.add_development_dependency(%q<rdoc>, ["= 3.12.2"])
60
- s.add_development_dependency(%q<bundler>, ["= 1.6.2"])
60
+ s.add_development_dependency(%q<bundler>, ["= 1.8.3"])
61
61
  s.add_development_dependency(%q<jeweler>, ["= 2.0.1"])
62
62
  s.add_development_dependency(%q<simplecov>, ["= 0.9.1"])
63
63
  s.add_development_dependency(%q<vcr>, ["= 2.9.3"])
64
- s.add_development_dependency(%q<webmock>, ["= 1.19.0"])
64
+ s.add_development_dependency(%q<webmock>, ["= 1.20.0"])
65
65
  s.add_development_dependency(%q<dotenv>, ["= 0.11.1"])
66
66
  s.add_development_dependency(%q<codeclimate-test-reporter>, ["= 0.4.0"])
67
- s.add_development_dependency(%q<coveralls>, ["= 0.7.0"])
67
+ s.add_development_dependency(%q<coveralls>, ["= 0.7.11"])
68
68
  else
69
69
  s.add_dependency(%q<httparty>, ["= 0.13.1"])
70
70
  s.add_dependency(%q<rspec>, ["= 2.8.0"])
71
71
  s.add_dependency(%q<rdoc>, ["= 3.12.2"])
72
- s.add_dependency(%q<bundler>, ["= 1.6.2"])
72
+ s.add_dependency(%q<bundler>, ["= 1.8.3"])
73
73
  s.add_dependency(%q<jeweler>, ["= 2.0.1"])
74
74
  s.add_dependency(%q<simplecov>, ["= 0.9.1"])
75
75
  s.add_dependency(%q<vcr>, ["= 2.9.3"])
76
- s.add_dependency(%q<webmock>, ["= 1.19.0"])
76
+ s.add_dependency(%q<webmock>, ["= 1.20.0"])
77
77
  s.add_dependency(%q<dotenv>, ["= 0.11.1"])
78
78
  s.add_dependency(%q<codeclimate-test-reporter>, ["= 0.4.0"])
79
- s.add_dependency(%q<coveralls>, ["= 0.7.0"])
79
+ s.add_dependency(%q<coveralls>, ["= 0.7.11"])
80
80
  end
81
81
  else
82
82
  s.add_dependency(%q<httparty>, ["= 0.13.1"])
83
83
  s.add_dependency(%q<rspec>, ["= 2.8.0"])
84
84
  s.add_dependency(%q<rdoc>, ["= 3.12.2"])
85
- s.add_dependency(%q<bundler>, ["= 1.6.2"])
85
+ s.add_dependency(%q<bundler>, ["= 1.8.3"])
86
86
  s.add_dependency(%q<jeweler>, ["= 2.0.1"])
87
87
  s.add_dependency(%q<simplecov>, ["= 0.9.1"])
88
88
  s.add_dependency(%q<vcr>, ["= 2.9.3"])
89
- s.add_dependency(%q<webmock>, ["= 1.19.0"])
89
+ s.add_dependency(%q<webmock>, ["= 1.20.0"])
90
90
  s.add_dependency(%q<dotenv>, ["= 0.11.1"])
91
91
  s.add_dependency(%q<codeclimate-test-reporter>, ["= 0.4.0"])
92
- s.add_dependency(%q<coveralls>, ["= 0.7.0"])
92
+ s.add_dependency(%q<coveralls>, ["= 0.7.11"])
93
93
  end
94
94
  end
95
95
 
@@ -22,13 +22,11 @@ class Bipbop
22
22
  end
23
23
 
24
24
  def social(params)
25
- response = request(:social, :consulta, params)
26
- response.merge('gender' => response['name'].attributes['gender']) rescue response
25
+ request(:social, :consulta, params)
27
26
  end
28
27
 
29
28
  def perfileconomico(params)
30
- response = request(:ecommerce, :perfileconomico, params)
31
- response.merge('gender' => response['name'].attributes['gender']) rescue response
29
+ request(:ecommerce, :perfileconomico, params)
32
30
  end
33
31
 
34
32
  private
@@ -43,7 +41,10 @@ class Bipbop
43
41
 
44
42
  def request(database, table, params)
45
43
  @response = self.class.get("/", query(irql(database, table, params)))
46
- (@response.code == 200) ? @response["IRQL"]['body'] : nil
44
+ if @response.code == 200
45
+ body = @response["IRQL"]['body']
46
+ body.merge('gender' => body['name'].attributes['gender']) rescue body
47
+ end
47
48
  end
48
49
 
49
50
  def query(q)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bipbop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Lima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-03 00:00:00.000000000 Z
11
+ date: 2015-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.6.2
61
+ version: 1.8.3
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
- version: 1.6.2
68
+ version: 1.8.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.19.0
117
+ version: 1.20.0
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
- version: 1.19.0
124
+ version: 1.20.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: dotenv
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 0.7.0
159
+ version: 0.7.11
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 0.7.0
166
+ version: 0.7.11
167
167
  description: 'bipbop is the best service for consulting brazilian data. See http://bipbop.com.br/
168
168
  for more information. '
169
169
  email: contato@rafael.adm.br