philippines 0.0.1.pre.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,148 @@
1
+ National Capital Region:
2
+ designation: NCR
3
+ provinces:
4
+ - Metro Manila
5
+
6
+ Cordillera Administrative Region:
7
+ designation: CAR
8
+ provinces:
9
+ - Abra
10
+ - Apayao
11
+ - Benguet
12
+ - Ifugao
13
+ - Kalinga
14
+ - Mountain Province
15
+
16
+ Ilocos Region:
17
+ designation: Region I
18
+ provinces:
19
+ - Ilocos Norte
20
+ - Ilocos Sur
21
+ - La Union
22
+ - Pangasinan
23
+
24
+ Cagayan Valley:
25
+ designation: Region II
26
+ provinces:
27
+ - Batanes
28
+ - Cagayan
29
+ - Isabela
30
+ - Nueva Vizcaya
31
+ - Quirino
32
+
33
+ Central Luzon:
34
+ designation: Region III
35
+ provinces:
36
+ - Aurora
37
+ - Bataan
38
+ - Bulacan
39
+ - Nueva Ecija
40
+ - Pampanga
41
+ - Tarlac
42
+ - Zambales
43
+
44
+ CALABARZON:
45
+ designation: Region IV-A
46
+ provinces:
47
+ - Batangas
48
+ - Cavite
49
+ - Laguna
50
+ - Quezon
51
+ - Rizal
52
+
53
+ MIMAROPA:
54
+ designation: Region IV-B
55
+ provinces:
56
+ - Marinduque
57
+ - Occidental Mindoro
58
+ - Oriental Mindoro
59
+ - Palawan
60
+ - Romblon
61
+
62
+ Bicol Region:
63
+ designation: Region V
64
+ provinces:
65
+ - Albay
66
+ - Camarines Norte
67
+ - Camarines Sur
68
+ - Catanduanes
69
+ - Masbate
70
+ - Sorsogon
71
+
72
+ Western Visayas:
73
+ designation: Region VI
74
+ provinces:
75
+ - Aklan
76
+ - Antique
77
+ - Capiz
78
+ - Guimaras
79
+ - Iloilo
80
+ - Negros Occidental
81
+
82
+ Central Visayas:
83
+ designation: Region VII
84
+ provinces:
85
+ - Bohol
86
+ - Cebu
87
+ - Negros Oriental
88
+ - Siquijor
89
+
90
+ Eastern Visayas:
91
+ designation: Region VIII
92
+ provinces:
93
+ - Biliran
94
+ - Eastern Samar
95
+ - Leyte
96
+ - Northern Samar
97
+ - Samar
98
+ - Southern Leyte
99
+
100
+ Zamboanga Peninsula:
101
+ designation: Region IX
102
+ provinces:
103
+ - Zamboanga del Norte
104
+ - Zamboanga del Sur
105
+ - Zamboanga Sibugay
106
+
107
+ Northern Midnanao:
108
+ designation: Region X
109
+ provinces:
110
+ - Bukidnon
111
+ - Camiguin
112
+ - Lanao del Norte
113
+ - Misamis Occidental
114
+ - Misamis Oriental
115
+
116
+ Davao Region:
117
+ designation: Region XI
118
+ provinces:
119
+ - Compostela Valley
120
+ - Davao del Norte
121
+ - Davao del Sur
122
+ - Davao Oriental
123
+
124
+ SOCCSKSARGEN:
125
+ designation: Region XIII
126
+ provinces:
127
+ - Cotabato
128
+ - Sarangani
129
+ - South Cotabato
130
+ - Sultan Kudarat
131
+
132
+ Caraga Region:
133
+ designation: Region XIII
134
+ provinces:
135
+ - Agusan del Norte
136
+ - Agusan del Sur
137
+ - Dinagat Islands
138
+ - Surigao del Norte
139
+ - Surigao del Sur
140
+
141
+ Autonomous Region in Muslim Mindanao:
142
+ designation: ARMM
143
+ provinces:
144
+ - Basilan
145
+ - Lanao del Sur
146
+ - Maguindanao
147
+ - Sulu
148
+ - Tawi-Tawi
@@ -0,0 +1,3 @@
1
+ module Philippines
2
+ VERSION = "0.0.1.pre.1"
3
+ end
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'philippines/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "philippines"
8
+ gem.version = Philippines::VERSION
9
+ gem.authors = ["Bryan Bibat"]
10
+ gem.email = ["bry@bryanbibat.net"]
11
+ gem.description = %q{Provides data about the Philippines that you may need in your applications.}
12
+ gem.summary = %q{Philippine data}
13
+ gem.homepage = "https://github.com/"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.required_ruby_version = ">= 1.9.2"
21
+
22
+ gem.add_development_dependency "rake"
23
+ gem.add_development_dependency "rspec", "~> 2.13.0"
24
+
25
+ end
@@ -0,0 +1,40 @@
1
+ require "spec_helper"
2
+
3
+ describe Philippines do
4
+
5
+ context "constants" do
6
+ it { should have_constant(:REGIONS) }
7
+ it { should have_constant(:PROVINCES) }
8
+ it { should have_constant(:CITIES) }
9
+ it { should have_constant(:MUNICIPALITIES) }
10
+ end
11
+
12
+ context "::REGIONS" do
13
+ it "should be 17" do
14
+ Philippines::REGIONS.count.should == 17
15
+ end
16
+ end
17
+ context "::PROVINCES" do
18
+ it "should be 80 + 1 (Metro Manila)" do
19
+ Philippines::PROVINCES.count.should == 81
20
+ end
21
+ end
22
+ context "::CITIES" do
23
+ it "should be 143" do
24
+ Philippines::CITIES.count.should == 143
25
+ end
26
+ end
27
+ context "::MUNICIPALITIES" do
28
+ it "should be 1491" do
29
+ Philippines::MUNICIPALITIES.count.should == 1491
30
+ end
31
+ end
32
+
33
+ context "::REGION_DATA" do
34
+ let(:cities_from_region) { Philippines::REGION_DATA.map { |_, v| v["provinces"] }.flatten.sort }
35
+
36
+ it "provinces should be consistent with PROVINCES" do
37
+ cities_from_region.should == Philippines::PROVINCES
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,8 @@
1
+ $: << File.expand_path("../../lib", __FILE__)
2
+ require "philippines"
3
+
4
+ RSpec::Matchers.define :have_constant do |const|
5
+ match do |owner|
6
+ owner.const_defined?(const)
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: philippines
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre.1
5
+ prerelease: 6
6
+ platform: ruby
7
+ authors:
8
+ - Bryan Bibat
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.13.0
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.13.0
46
+ description: Provides data about the Philippines that you may need in your applications.
47
+ email:
48
+ - bry@bryanbibat.net
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - LICENSE.txt
56
+ - README.md
57
+ - Rakefile
58
+ - lib/philippines.rb
59
+ - lib/philippines/data/provinces_municipalities.yml
60
+ - lib/philippines/data/regions_provinces.yml
61
+ - lib/philippines/version.rb
62
+ - philippines.gemspec
63
+ - spec/philippines_spec.rb
64
+ - spec/spec_helper.rb
65
+ homepage: https://github.com/
66
+ licenses: []
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: 1.9.2
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>'
81
+ - !ruby/object:Gem::Version
82
+ version: 1.3.1
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 1.8.23
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: Philippine data
89
+ test_files:
90
+ - spec/philippines_spec.rb
91
+ - spec/spec_helper.rb