geography_helper 0.1.5 → 1.0.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0c01dc3093e1bedbe2847ba7e345cedf1dcf8a9288dab5539cf62c36f1c03a7c
4
+ data.tar.gz: 0b815832274c0d7da3c4ada9fc3f43650c1b482624bfdebeac6bacb7703ff805
5
+ SHA512:
6
+ metadata.gz: ca8165687c52fd1c5bcd30fce93df57bf34adc4ff461da4fa8fb9298ce203592291bd539f9796ebc797aa36a6d23bfa70ca7657542039c68ed98645148b931c6
7
+ data.tar.gz: 9b30311b1612ff646cd506178813c1e4757e4e082802c16ade6f02dd90a1f49c131a2ebbffbe2f60bc623fc5b8ed7bba72d75e1e35a4dcd40ecae2880d87a7a3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GeographyHelper
2
2
 
3
- One source of truth for countries both states and provinces. I built this because it is easy to get into the habit of putting an array of arrays of states and countries into `application.rb`. This gem also uses hashes instead of nested arrays, making it easier to call values from a key. This approach is more efficient than looping through an array of arrays to find a correct state or country value. It is also easier to understand, for example, calling `state['NY'] => 'New York'`.
3
+ GeographyHelper stores country, state and province data has Ruby hashes.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,21 +20,19 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- call `GeographyHelper::States.new.states` for a hash of nested states
24
-
25
- call `GeographyHelper::States.new.provinces` for a hash of nested provinces
23
+ ```ruby
24
+ GeographyHelper::States.new.states # hash of states
25
+ GeographyHelper::States.new.provinces # hash of provinces
26
+ GeographyHelper::Countries.new.countries # hash of countries
26
27
 
27
- call `GeographyHelper::Countries.new.countries` for a hash of countries
28
+ GeographyHelper::States.new.states['United States']['NY'] # => "New York"
29
+ ```
28
30
 
29
31
  ### The gem also provides two helper methods to render state/province and country dropdowns from a Rails select dropdown.
30
32
 
31
- * `country_options_for_select`
32
- - this method takes an optional selected argument, 'US'
33
- * `state_options_for_select()`
34
- - this method takes an optional selected argument, 'NY'
35
-
36
- ``` ruby example.html.erb
37
- <%= form.select :country, country_options_for_select('US'), {include_blank: true} %>
33
+ ```ruby
34
+ <%= form.select :country, country_options_for_select('US') %>
35
+ <%= form.select :state, state_options_for_select('NY') %>
38
36
  ```
39
37
 
40
38
  ## Development
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Eric Iacutone"]
10
10
  spec.email = ["eric.iacutone@gmail.com"]
11
11
 
12
- spec.summary = "Ruby hash state, province and country abbreviations."
12
+ spec.summary = "Provides country, state and province infomation in Ruby hashes."
13
13
  spec.homepage = "https://github.com/iacutone/geography_helper"
14
14
  spec.license = "MIT"
15
15
 
@@ -1,3 +1,3 @@
1
1
  module GeographyHelper
2
- VERSION = "0.1.5"
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geography_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
5
- prerelease:
4
+ version: 1.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Eric Iacutone
9
8
  autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2017-08-01 00:00:00.000000000 Z
11
+ date: 2018-06-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.10'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.10'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '10.0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '10.0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description:
@@ -66,9 +59,9 @@ executables: []
66
59
  extensions: []
67
60
  extra_rdoc_files: []
68
61
  files:
69
- - .gitignore
70
- - .rspec
71
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
72
65
  - Gemfile
73
66
  - LICENSE.txt
74
67
  - README.md
@@ -84,32 +77,25 @@ files:
84
77
  homepage: https://github.com/iacutone/geography_helper
85
78
  licenses:
86
79
  - MIT
80
+ metadata: {}
87
81
  post_install_message:
88
82
  rdoc_options: []
89
83
  require_paths:
90
84
  - lib
91
85
  required_ruby_version: !ruby/object:Gem::Requirement
92
- none: false
93
86
  requirements:
94
- - - '>='
87
+ - - ">="
95
88
  - !ruby/object:Gem::Version
96
89
  version: '0'
97
- segments:
98
- - 0
99
- hash: -2488431789737471129
100
90
  required_rubygems_version: !ruby/object:Gem::Requirement
101
- none: false
102
91
  requirements:
103
- - - '>='
92
+ - - ">="
104
93
  - !ruby/object:Gem::Version
105
94
  version: '0'
106
- segments:
107
- - 0
108
- hash: -2488431789737471129
109
95
  requirements: []
110
96
  rubyforge_project:
111
- rubygems_version: 1.8.25
97
+ rubygems_version: 2.7.6
112
98
  signing_key:
113
- specification_version: 3
114
- summary: Ruby hash state, province and country abbreviations.
99
+ specification_version: 4
100
+ summary: Provides country, state and province infomation in Ruby hashes.
115
101
  test_files: []