luzvimin 1.0.0 → 1.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7e92e502d80caba093164a6ffa5b62a76753b540
4
+ data.tar.gz: 9864da34e2ab09dc9f52106962e2ecd832dced32
5
+ SHA512:
6
+ metadata.gz: 55d217e34f5af808d8b948d3b86d76d6290d6f0d7e7768220c0406ca602248563454e620af0b112dca577d2e28e5154d926352791bd0726c1de52be35ab80dae
7
+ data.tar.gz: 7ddd69ca17e6e04d29a6b94f0d7392a77ce8e696ef8d9ba60089d361ee3204b88a3091ccf221fcaef3570d37a4c266b6cd3fef71eddd170731a89dd79a3260b3
data/README.md CHANGED
@@ -22,9 +22,9 @@ To list all regions:
22
22
 
23
23
  Luzvimin.regions
24
24
 
25
- To create a select tag for all regions:
25
+ To create options for a select tag for all regions:
26
26
 
27
- Luzvimin.select_regions
27
+ Luzvimin.regions_options_for_select
28
28
 
29
29
  To get details about a region:
30
30
 
@@ -36,9 +36,9 @@ To get a region's provinces:
36
36
 
37
37
  region.provinces
38
38
 
39
- To create a select tag for all region's provinces:
39
+ To create options for select tag for a region's provinces:
40
40
 
41
- region.select_provinces
41
+ region.provinces_options_for_select
42
42
 
43
43
  ## Contributing
44
44
 
@@ -3,9 +3,9 @@ require 'luzvimin/version'
3
3
 
4
4
  module Luzvimin
5
5
  PHILIPPINES = YAML.load_file(File.join(File.dirname(__FILE__), 'data', 'regions.yml')) || {}
6
- REGIONS = PHILIPPINES.map { |k, v| [k, v] }.sort_by{ |k, v| v['position'] }
6
+ REGIONS = PHILIPPINES.map { |k, v| [k, v] }.sort_by{ |k, v| v['position'] }
7
7
  METHODS = ['code', 'name', 'position', 'id']
8
-
8
+
9
9
  attr_reader :data
10
10
 
11
11
  class Region
@@ -21,13 +21,18 @@ module Luzvimin
21
21
  end
22
22
 
23
23
  def provinces
24
- provinces = YAML.load_file(File.join(File.dirname(__FILE__), 'data/provinces', "#{self.id}.yml")) || {}
25
- provinces.map { |k, v| [k, v] }.sort_by{ |k, v| v['position'] }
26
- end
24
+ provinces = begin
25
+ YAML.load_file(File.join(File.dirname(__FILE__), 'data/provinces', "#{self.id}.yml")) || {}
26
+ rescue => e
27
+ {}
28
+ end
29
+
30
+ provinces.map { |k, v| [k, v] }.sort_by{ |k, v| v['position'] }
31
+ end
27
32
 
28
33
  def provinces_options_for_select
29
34
  provinces.map {|s| [s[1]['name'],s[0]]}
30
- end
35
+ end
31
36
  end
32
37
 
33
38
  class << self
@@ -36,7 +41,7 @@ module Luzvimin
36
41
  end
37
42
 
38
43
  def regions
39
- REGIONS
44
+ REGIONS
40
45
  end
41
46
 
42
47
  def regions_options_for_select
@@ -1,3 +1,3 @@
1
1
  module Luzvimin
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luzvimin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Karren Javier
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-23 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '2.6'
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: '2.6'
30
27
  description: Philippine geography gem listing all regions and provinces
@@ -34,7 +31,7 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
- - .gitignore
34
+ - ".gitignore"
38
35
  - Gemfile
39
36
  - LICENSE.txt
40
37
  - README.md
@@ -64,29 +61,27 @@ files:
64
61
  - spec/luzvimin_spec.rb
65
62
  homepage: http://kjavier.github.com/luzvimin
66
63
  licenses: []
64
+ metadata: {}
67
65
  post_install_message:
68
66
  rdoc_options: []
69
67
  require_paths:
70
68
  - lib
71
69
  required_ruby_version: !ruby/object:Gem::Requirement
72
- none: false
73
70
  requirements:
74
- - - ! '>='
71
+ - - ">="
75
72
  - !ruby/object:Gem::Version
76
73
  version: '0'
77
74
  required_rubygems_version: !ruby/object:Gem::Requirement
78
- none: false
79
75
  requirements:
80
- - - ! '>='
76
+ - - ">="
81
77
  - !ruby/object:Gem::Version
82
78
  version: '0'
83
79
  requirements: []
84
80
  rubyforge_project:
85
- rubygems_version: 1.8.24
81
+ rubygems_version: 2.2.2
86
82
  signing_key:
87
- specification_version: 3
83
+ specification_version: 4
88
84
  summary: Philippine geography gem listing all regions and provinces
89
85
  test_files:
90
86
  - spec/luzvimin_region_spec.rb
91
87
  - spec/luzvimin_spec.rb
92
- has_rdoc: