us_zipcode 0.1.1 → 0.1.2

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.travis.yml +0 -0
  4. data/Gemfile +0 -0
  5. data/MIT-LICENSE +0 -0
  6. data/README.textile +11 -11
  7. data/README.textile~ +10 -15
  8. data/Rakefile +0 -0
  9. data/features/step_definitions/common_steps.rb +0 -0
  10. data/features/step_definitions/rails_setup_steps.rb +0 -0
  11. data/features/step_definitions/rails_setup_steps.rb~ +0 -0
  12. data/features/support/env.rb +0 -0
  13. data/features/support/string.rb +0 -0
  14. data/features/zipcodes.feature +0 -0
  15. data/features/zipcodes.feature~ +0 -0
  16. data/lib/generators/us_zipcode/models_generator.rb +0 -0
  17. data/lib/generators/us_zipcode/models_generator.rb~ +0 -0
  18. data/lib/generators/us_zipcode/templates/county_model.rb +0 -0
  19. data/lib/generators/us_zipcode/templates/county_model.rb~ +0 -0
  20. data/lib/generators/us_zipcode/templates/migration.rb +0 -0
  21. data/lib/generators/us_zipcode/templates/migration.rb~ +0 -0
  22. data/lib/generators/us_zipcode/templates/state_model.rb +0 -0
  23. data/lib/generators/us_zipcode/templates/state_model.rb~ +0 -0
  24. data/lib/generators/us_zipcode/templates/zipcode_model.rb +0 -0
  25. data/lib/generators/us_zipcode/templates/zipcode_model.rb~ +0 -0
  26. data/lib/generators/us_zipcode/templates/zipcodes.rake +3 -3
  27. data/lib/generators/us_zipcode/templates/zipcodes.rake~ +0 -0
  28. data/lib/generators/us_zipcode/version.rb +1 -1
  29. data/lib/generators/us_zipcode/version.rb~ +1 -1
  30. data/lib/my_zipcode_gem.rb~ +0 -0
  31. data/lib/us_zipcode.rb +0 -0
  32. data/lib/us_zipcode.rb~ +0 -0
  33. data/rails3_2.gemfile +0 -0
  34. data/rails4_0.gemfile +0 -0
  35. data/rails4_1.gemfile +0 -0
  36. data/us_zipcode.gemspec +1 -0
  37. data/us_zipcode.gemspec~ +1 -1
  38. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53d43033c31d31ac68965cdead72e8773b697010
4
- data.tar.gz: bc506c4a298bfdfe6d98b87c1f55993e73056332
3
+ metadata.gz: 0d5b3db9d3124a738bceec1ff186d5655ba40d4a
4
+ data.tar.gz: 5ad8ef0c55e232e85dc906d24c7dda7ffca3dddc
5
5
  SHA512:
6
- metadata.gz: 7c091e5a454709020baa2025a9cc68e7112ce4c22e543f9986d28e7a54c21b5e1440ecb7f01c2e5f0246b9d71c972914517d2f17f1d00597e858650e67010e2c
7
- data.tar.gz: 66f68df2b60e9c270ddd2c1fa03a22d5e58f1c18efecb0a2853628683ae1a0fcd0a5d4206bf6bcd7e2f078f4be94551f4d9d18ea3d030108727c46df6915c7ce
6
+ metadata.gz: 36239e14e6966dfb3d9c366972cb702391ffb3f503953c770fd3590fa26ce36a7b785c350637131bdb4e4514777ae445575b061829dc5578f9fb21cfc235e58b
7
+ data.tar.gz: 0cc64e5c975e57ba05d69096b10882984797dea0af6d63310d55791ff350b8f580dce8f3ecc1a46fdd2bc6f88e7deaf7762962ee58664d4d627e1e667ee925db
data/.gitignore CHANGED
File without changes
File without changes
data/Gemfile CHANGED
File without changes
File without changes
@@ -11,7 +11,7 @@ bc. gem 'us_zipcode'
11
11
 
12
12
  Run:
13
13
 
14
- bc. rake bundle install
14
+ bc. bundle install
15
15
 
16
16
  Generate the models and populate the data:
17
17
 
@@ -52,7 +52,7 @@ On city selection, you can see the corresponding county with its zip code.
52
52
 
53
53
  Write the following code in your view:
54
54
 
55
- <%= select_tag "state",options_from_collection_for_select(State.all, "id", "name") %>
55
+ bc. <%= select_tag "state",options_from_collection_for_select(State.all, "id", "name") %>
56
56
  <div id ="city"></div>
57
57
  <div id ="county"></div>
58
58
  <script>
@@ -69,11 +69,11 @@ Write the following code in your view:
69
69
 
70
70
  Create mycontroller & paste the following code:
71
71
 
72
- def get_cities_by_state
72
+ bc. def get_cities_by_state
73
73
  @cities = Zipcode.group(:city).where(state_id: params[:state_id])
74
74
  end
75
75
 
76
- def get_county_and_zip_by_city
76
+ bc. def get_county_and_zip_by_city
77
77
  @zipcodes = Zipcode.find_by_city(params[:city])
78
78
  end
79
79
 
@@ -81,10 +81,10 @@ Create the following two js.erb files in app/views/mycontroller/
81
81
 
82
82
  1.get_cities_by_state.js.erb & paste the following code:
83
83
 
84
- $("#city").html('<%= escape_javascript(select_tag "city", options_from_collection_for_select(@cities, :id, :city)) %>');
84
+ bc. $("#city").html('<%= escape_javascript(select_tag "city", options_from_collection_for_select(@cities, :id, :city)) %>');
85
85
  $("#city").on("change", function(){
86
86
  $.ajax({
87
- url: "/home/get_county_and_zip_by_city",
87
+ url: "/mycontroller/get_county_and_zip_by_city",
88
88
  dataType: "script",
89
89
  method: "get",
90
90
  data: {city: $("#city select option:selected"). text()}
@@ -93,14 +93,14 @@ $("#city").on("change", function(){
93
93
 
94
94
  2.get_county_and_zip_by_city.js.erb
95
95
 
96
- $("#county").html('<%= escape_javascript(select_tag "county", options_from_collection_for_select(@zipcodes, :id, :county_and_zip)) %>');
96
+ bc. $("#county").html('<%= escape_javascript(select_tag "county", options_from_collection_for_select(@zipcodes, :id, :county_and_zip)) %>');
97
97
 
98
98
  In the last update your routes:
99
99
 
100
- scope '/mycontroller' do
101
- get 'get_cities_by_state' => 'mycontroller#get_cities_by_state'
102
- get 'get_county_and_zip_by_city' => 'mycontroller#get_county_and_zip_by_city'
103
- end
100
+ bc. scope '/mycontroller' do
101
+ get 'get_cities_by_state' => 'mycontroller#get_cities_by_state'
102
+ get 'get_county_and_zip_by_city' => 'mycontroller#get_county_and_zip_by_city'
103
+ end
104
104
 
105
105
 
106
106
 
@@ -52,7 +52,7 @@ On city selection, you can see the corresponding county with its zip code.
52
52
 
53
53
  Write the following code in your view:
54
54
 
55
- <%= select_tag "state",options_from_collection_for_select(State.all, "id", "name") %>
55
+ bc. <%= select_tag "state",options_from_collection_for_select(State.all, "id", "name") %>
56
56
  <div id ="city"></div>
57
57
  <div id ="county"></div>
58
58
  <script>
@@ -69,11 +69,11 @@ Write the following code in your view:
69
69
 
70
70
  Create mycontroller & paste the following code:
71
71
 
72
- def get_cities_by_state
72
+ bc. def get_cities_by_state
73
73
  @cities = Zipcode.group(:city).where(state_id: params[:state_id])
74
74
  end
75
75
 
76
- def get_county_and_zip_by_city
76
+ bc. def get_county_and_zip_by_city
77
77
  @zipcodes = Zipcode.find_by_city(params[:city])
78
78
  end
79
79
 
@@ -81,10 +81,10 @@ Create the following two js.erb files in app/views/mycontroller/
81
81
 
82
82
  1.get_cities_by_state.js.erb & paste the following code:
83
83
 
84
- $("#city").html('<%= escape_javascript(select_tag "city", options_from_collection_for_select(@cities, :id, :city)) %>');
84
+ bc. $("#city").html('<%= escape_javascript(select_tag "city", options_from_collection_for_select(@cities, :id, :city)) %>');
85
85
  $("#city").on("change", function(){
86
86
  $.ajax({
87
- url: "/home/get_county_and_zip_by_city",
87
+ url: "/mycontroller/get_county_and_zip_by_city",
88
88
  dataType: "script",
89
89
  method: "get",
90
90
  data: {city: $("#city select option:selected"). text()}
@@ -93,14 +93,14 @@ $("#city").on("change", function(){
93
93
 
94
94
  2.get_county_and_zip_by_city.js.erb
95
95
 
96
- $("#county").html('<%= escape_javascript(select_tag "county", options_from_collection_for_select(@zipcodes, :id, :county_and_zip)) %>');
96
+ bc. $("#county").html('<%= escape_javascript(select_tag "county", options_from_collection_for_select(@zipcodes, :id, :county_and_zip)) %>');
97
97
 
98
98
  In the last update your routes:
99
99
 
100
- scope '/mycontroller' do
101
- get 'get_cities_by_state' => 'mycontroller#get_cities_by_state'
102
- get 'get_county_and_zip_by_city' => 'mycontroller#get_county_and_zip_by_city'
103
- end
100
+ bc. scope '/mycontroller' do
101
+ get 'get_cities_by_state' => 'mycontroller#get_cities_by_state'
102
+ get 'get_county_and_zip_by_city' => 'mycontroller#get_county_and_zip_by_city'
103
+ end
104
104
 
105
105
 
106
106
 
@@ -177,8 +177,3 @@ That's about it.
177
177
 
178
178
  Let me know if there are any errors. I cut and pasted the code above from a working application, but there may be some gotchas that I missed.
179
179
 
180
- h2. LOG
181
-
182
- h3. 05/03/2011:
183
-
184
- Initial Release
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@ namespace :zipcodes do
5
5
  desc "Update states table"
6
6
  task :update_states => :environment do
7
7
  puts ">>> Begin update of states table..."
8
- url = "https://github.com/midwire/free_zipcode_data/raw/master/all_us_states.csv"
8
+ url = "https://github.com/ChakreshwarSharma/us_zipcode_data/raw/master/all_us_states.csv"
9
9
  data = open(url)
10
10
  file = nil
11
11
  if data.is_a? StringIO
@@ -28,7 +28,7 @@ namespace :zipcodes do
28
28
  desc "Update counties table"
29
29
  task :update_counties => :update_states do
30
30
  puts ">>> Begin update of counties table..."
31
- url = "https://github.com/midwire/free_zipcode_data/raw/master/all_us_counties.csv"
31
+ url = "https://github.com/ChakreshwarSharma/us_zipcode_data/raw/master/all_us_counties.csv"
32
32
  data = open(url)
33
33
  file = nil
34
34
  if data.is_a? StringIO
@@ -53,7 +53,7 @@ namespace :zipcodes do
53
53
  desc "Update zipcodes table"
54
54
  task :update_zipcodes => :update_counties do
55
55
  puts ">>> Begin update of zipcodes table..."
56
- url = "https://github.com/midwire/free_zipcode_data/raw/master/all_us_zipcodes.csv"
56
+ url = "https://github.com/ChakreshwarSharma/us_zipcode_data/raw/master/all_us_zipcodes.csv"
57
57
  data = open(url)
58
58
  file = nil
59
59
  if data.is_a? StringIO
@@ -1,3 +1,3 @@
1
1
  module UsZipcode
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module UsZipcode
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.1"
3
3
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Chakreshwar"]
10
10
  s.email = ["chakreshwar.sharma@yahoo.com"]
11
+ s.homepage = "https://github.com/ChakreshwarSharma/us_zipcode"
11
12
  s.summary = %q{A Ruby gem to handle all things zipcode.}
12
13
  s.description = %q{A Ruby gem for looking up and manipulating US postal codes and geocodes.}
13
14
  s.licenses = ['MIT']
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "generators/my_zipcode_gem/version"
3
+ require "generators/us_zipcode/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "us_zipcode"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: us_zipcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chakreshwar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-22 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -81,7 +81,7 @@ files:
81
81
  - rails4_1.gemfile
82
82
  - us_zipcode.gemspec
83
83
  - us_zipcode.gemspec~
84
- homepage:
84
+ homepage: https://github.com/ChakreshwarSharma/us_zipcode
85
85
  licenses:
86
86
  - MIT
87
87
  metadata: {}