br_zip_code 0.0.6 → 0.1.0

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: e0bfe5bc89a935484da4dcab7e8b82f9c73b15dd
4
- data.tar.gz: 01131fb790124159a2859d04ccdb790e653aed92
3
+ metadata.gz: 0322ea58af9aa1d93cc62b4b69f5597af7c5af0f
4
+ data.tar.gz: 721c7c5507b7a82de8553125c9a0c712c1c28779
5
5
  SHA512:
6
- metadata.gz: 90816196855c42964db969de5e423ee3946a6c145ccf688038c3e3145f6ce75b052db4d21abd387f26442996721092863b4e85d581c06809995bdca76e31192f
7
- data.tar.gz: 22587569df5ee48b397458f3e9addeb18c0754bee15934f4c4f9eb91494c51af04b438a174e426fb783996f29f67118dba6c509d707b8f1570ad70220fd0f4ef
6
+ metadata.gz: 6464b28bdec2576e3e4506f56548787ff98aadd6713f1e3738ce45675023c793295acf41c190c985b69747a76963cc2cc8b24786b1a66cb5ffe33dbae47c2ab4
7
+ data.tar.gz: 822e8eedb679d8edbc65f613c4b6b7741887c19e04cc364305efc1eb6e905340eb1aec88c6767fdb4823fe8bc06c871ba5ee796a70f752db5d49b84ba8107cd1
@@ -0,0 +1,4 @@
1
+ module BrZipCode
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,25 @@
1
+ require_dependency "new_relic_ping/application_controller"
2
+
3
+ module BrZipCode
4
+ class ZipCodeController < ApplicationController
5
+ def show
6
+ zip_code = params[:zip_code] || params[:id]
7
+
8
+ zip_info = BrZipCode.get_address zip_code
9
+
10
+ if zip_info[:error].present?
11
+ respond_to do |format|
12
+ format.json do
13
+ render json: { success: false, message: zip_info[:error] }
14
+ end
15
+ end
16
+ else
17
+ respond_to do |format|
18
+ format.json do
19
+ render json: { success: true, zip_info: zip_info }
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ BrZipCode::Engine.routes.draw do
2
+ get 'zip_code/:id' => 'zip_code#show'
3
+ end
data/lib/br_zip_code.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'br_zip_code/engine'
2
+ require 'br_zip_code/version'
1
3
  require 'httparty'
2
4
 
3
5
  module BrZipCode
@@ -0,0 +1,5 @@
1
+ module BrZipCode
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace BrZipCode
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module BrZipCode
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,57 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_zip_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Schvartz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 3.2.14
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: 3.2.14
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: httparty
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - ~>
17
+ - - "~>"
32
18
  - !ruby/object:Gem::Version
33
19
  version: 0.12.0
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ~>
24
+ - - "~>"
39
25
  - !ruby/object:Gem::Version
40
26
  version: 0.12.0
41
- - !ruby/object:Gem::Dependency
42
- name: sqlite3
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
27
  description: Gem that lets user find a brazilian address with the given zip_code.
56
28
  email:
57
29
  - ari.shh@gmail.com
@@ -61,7 +33,11 @@ extra_rdoc_files: []
61
33
  files:
62
34
  - MIT-LICENSE
63
35
  - Rakefile
36
+ - app/controllers/br_zip_code/application_controller.rb
37
+ - app/controllers/br_zip_code/zip_code_controller.rb
38
+ - config/routes.rb
64
39
  - lib/br_zip_code.rb
40
+ - lib/br_zip_code/engine.rb
65
41
  - lib/br_zip_code/version.rb
66
42
  - lib/tasks/br_zip_code_tasks.rake
67
43
  - test/br_zip_code_test.rb
@@ -106,12 +82,12 @@ require_paths:
106
82
  - lib
107
83
  required_ruby_version: !ruby/object:Gem::Requirement
108
84
  requirements:
109
- - - '>='
85
+ - - ">="
110
86
  - !ruby/object:Gem::Version
111
87
  version: '0'
112
88
  required_rubygems_version: !ruby/object:Gem::Requirement
113
89
  requirements:
114
- - - '>='
90
+ - - ">="
115
91
  - !ruby/object:Gem::Version
116
92
  version: '0'
117
93
  requirements: []
@@ -119,38 +95,38 @@ rubyforge_project:
119
95
  rubygems_version: 2.2.2
120
96
  signing_key:
121
97
  specification_version: 4
122
- summary: Need to do tests.
98
+ summary: BR Zip Code - 0.1.0
123
99
  test_files:
124
100
  - test/test_helper.rb
125
- - test/dummy/public/404.html
126
- - test/dummy/public/favicon.ico
127
- - test/dummy/public/500.html
128
- - test/dummy/public/422.html
129
- - test/dummy/config/locales/en.yml
130
- - test/dummy/config/application.rb
131
- - test/dummy/config/database.yml
132
- - test/dummy/config/environment.rb
133
- - test/dummy/config/environments/development.rb
134
- - test/dummy/config/environments/production.rb
135
- - test/dummy/config/environments/test.rb
136
- - test/dummy/config/boot.rb
137
- - test/dummy/config/routes.rb
138
- - test/dummy/config/initializers/inflections.rb
139
101
  - test/dummy/config/initializers/filter_parameter_logging.rb
140
- - test/dummy/config/initializers/wrap_parameters.rb
141
- - test/dummy/config/initializers/mime_types.rb
142
- - test/dummy/config/initializers/session_store.rb
143
102
  - test/dummy/config/initializers/backtrace_silencers.rb
103
+ - test/dummy/config/initializers/inflections.rb
104
+ - test/dummy/config/initializers/session_store.rb
144
105
  - test/dummy/config/initializers/secret_token.rb
106
+ - test/dummy/config/initializers/mime_types.rb
107
+ - test/dummy/config/initializers/wrap_parameters.rb
108
+ - test/dummy/config/routes.rb
109
+ - test/dummy/config/boot.rb
110
+ - test/dummy/config/application.rb
111
+ - test/dummy/config/environments/test.rb
112
+ - test/dummy/config/environments/development.rb
113
+ - test/dummy/config/environments/production.rb
114
+ - test/dummy/config/database.yml
115
+ - test/dummy/config/locales/en.yml
116
+ - test/dummy/config/environment.rb
117
+ - test/dummy/public/500.html
118
+ - test/dummy/public/favicon.ico
119
+ - test/dummy/public/404.html
120
+ - test/dummy/public/422.html
145
121
  - test/dummy/README.rdoc
146
- - test/dummy/bin/rails
147
- - test/dummy/bin/rake
148
- - test/dummy/bin/bundle
149
- - test/dummy/app/helpers/application_helper.rb
150
- - test/dummy/app/views/layouts/application.html.erb
151
- - test/dummy/app/controllers/application_controller.rb
152
122
  - test/dummy/app/assets/javascripts/application.js
153
123
  - test/dummy/app/assets/stylesheets/application.css
154
- - test/dummy/config.ru
124
+ - test/dummy/app/views/layouts/application.html.erb
125
+ - test/dummy/app/helpers/application_helper.rb
126
+ - test/dummy/app/controllers/application_controller.rb
155
127
  - test/dummy/Rakefile
128
+ - test/dummy/config.ru
129
+ - test/dummy/bin/rake
130
+ - test/dummy/bin/rails
131
+ - test/dummy/bin/bundle
156
132
  - test/br_zip_code_test.rb