app_store_info 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/app_store_info/regions.rb +83 -41
- data/lib/app_store_info/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1ea8adfcfb1b6a0b26d37f147a35b87afb10721
|
4
|
+
data.tar.gz: 9a9a1fb4c6dd168719479f430363132b3eaa1990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c6e23852d18e59c86eae8b57126b2921a96c134b5397814d342d45fc316ee5f4cee8e898460440bf3ae1fde61b18f961b03073a6d9edd8f2cf41a3db319405b
|
7
|
+
data.tar.gz: 5f4fc8fc2f826c627c5b451d142c4a8be3fac27b1e679f767121f23a0d74cf96a1622ebf6edcae549f3b99440a0f60dc1f90c71befa39f5d80bf4cc04e657cf4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/rikas/app_store_info.svg)](https://travis-ci.org/rikas/app_store_info)
|
1
|
+
[![Build Status](https://travis-ci.org/rikas/app_store_info.svg)](https://travis-ci.org/rikas/app_store_info) [![Dependency Status](https://gemnasium.com/rikas/app_store_info.svg)](https://gemnasium.com/rikas/app_store_info)
|
2
2
|
|
3
3
|
# AppStoreInfo
|
4
4
|
|
@@ -1,57 +1,99 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
module AppStoreInfo
|
3
|
+
# Regions maps the App Store regions in different format.
|
4
|
+
#
|
5
|
+
# AppStoreInfo::Regions.full_list will return a list of countries in the following format:
|
6
|
+
# [{"Europe"=>
|
7
|
+
# [{:code=>"AL", :name=>"Albania"},
|
8
|
+
# {:code=>"AT", :name=>"Austria"},
|
9
|
+
# {:code=>"BY", :name=>"Belarus"},...
|
10
|
+
#
|
11
|
+
# AppStoreInfo::Regions::territory_list is a list of countries available on App Store:
|
12
|
+
#
|
13
|
+
# {"AE"=>"United Arab Emirates",
|
14
|
+
# "AG"=>"Antigua and Barbuda",
|
15
|
+
# "AI"=>"Anguilla",
|
16
|
+
# "AL"=>"Albania",
|
17
|
+
# "AM"=>"Armenia",...
|
3
18
|
class Regions
|
4
19
|
# All the available regions (taken from https://developer.apple.com/library/ios/documentation/
|
5
20
|
# LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/AppStoreTerritories.html
|
6
|
-
|
21
|
+
TERRITORIES = {
|
7
22
|
'AE' => 'United Arab Emirates',
|
8
23
|
'AG' => 'Antigua and Barbuda', 'AI' => 'Anguilla', 'AL' => 'Albania', 'AM' => 'Armenia',
|
9
24
|
'AO' => 'Angola', 'AR' => 'Argentina', 'AT' => 'Austria', 'AU' => 'Australia',
|
10
25
|
'AZ' => 'Azerbaijan', 'BB' => 'Barbados', 'BE' => 'Belgium', 'BF' => 'Burkina Faso',
|
11
|
-
'BG' => 'Bulgaria', 'BH' => 'Bahrain', 'BJ' => 'Benin', 'BM' => 'Bermuda',
|
12
|
-
'
|
13
|
-
'
|
14
|
-
'
|
15
|
-
'CR' => 'Costa Rica', 'CV' => 'Cape Verde', 'CY' => 'Cyprus',
|
16
|
-
'
|
17
|
-
'
|
18
|
-
'
|
19
|
-
'
|
20
|
-
'
|
21
|
-
'
|
22
|
-
'
|
23
|
-
'
|
24
|
-
'
|
25
|
-
'
|
26
|
-
'KZ' => '
|
27
|
-
'
|
28
|
-
'LU' => 'Luxembourg', 'LV' => 'Latvia', 'MD' => 'Republic Of Moldova',
|
29
|
-
'
|
30
|
-
'
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
'
|
35
|
-
'
|
36
|
-
'
|
37
|
-
'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands', 'SC' => 'Seychelles',
|
38
|
-
'
|
39
|
-
'
|
40
|
-
'
|
41
|
-
'
|
42
|
-
'TN' => 'Tunisia', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago',
|
43
|
-
'
|
44
|
-
'
|
45
|
-
'
|
46
|
-
'
|
26
|
+
'BG' => 'Bulgaria', 'BH' => 'Bahrain', 'BJ' => 'Benin', 'BM' => 'Bermuda',
|
27
|
+
'BN' => 'Brunei Darussalam', 'BO' => 'Bolivia', 'BR' => 'Brazil', 'BS' => 'Bahamas',
|
28
|
+
'BT' => 'Bhutan', 'BW' => 'Botswana', 'BY' => 'Belarus', 'BZ' => 'Belize', 'CA' => 'Canada',
|
29
|
+
'CG' => 'Republic Of Congo', 'CH' => 'Switzerland', 'CL' => 'Chile', 'CN' => 'China',
|
30
|
+
'CO' => 'Colombia', 'CR' => 'Costa Rica', 'CV' => 'Cape Verde', 'CY' => 'Cyprus',
|
31
|
+
'CZ' => 'Czech Republic', 'DE' => 'Germany', 'DK' => 'Denmark', 'DM' => 'Dominica',
|
32
|
+
'DO' => 'Dominican Republic', 'DZ' => 'Algeria', 'EC' => 'Ecuador', 'EE' => 'Estonia',
|
33
|
+
'EG' => 'Egypt', 'ES' => 'Spain', 'FI' => 'Finland', 'FJ' => 'Fiji',
|
34
|
+
'FM' => 'Federated States Of Micronesia', 'FR' => 'France', 'GB' => 'United Kingdom',
|
35
|
+
'GD' => 'Grenada', 'GH' => 'Ghana', 'GM' => 'Gambia', 'GR' => 'Greece', 'GT' => 'Guatemala',
|
36
|
+
'GW' => 'Guinea-Bissau', 'GY' => 'Guyana', 'HK' => 'Hong Kong', 'HN' => 'Honduras',
|
37
|
+
'HR' => 'Croatia', 'HU' => 'Hungary', 'ID' => 'Indonesia', 'IE' => 'Ireland',
|
38
|
+
'IL' => 'Israel', 'IN' => 'India', 'IS' => 'Iceland', 'IT' => 'Italy', 'JM' => 'Jamaica',
|
39
|
+
'JO' => 'Jordan', 'JP' => 'Japan', 'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia',
|
40
|
+
'KN' => 'St. Kitts and Nevis', 'KR' => 'Republic Of Korea', 'KW' => 'Kuwait',
|
41
|
+
'KY' => 'Cayman Islands', 'KZ' => 'Kazakhstan', 'LA' => "Lao People's Democratic Republic",
|
42
|
+
'LB' => 'Lebanon', 'LC' => 'Santa Lucia', 'LK' => 'Sri Lanka', 'LR' => 'Liberia',
|
43
|
+
'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'LV' => 'Latvia', 'MD' => 'Republic Of Moldova',
|
44
|
+
'MG' => 'Madagascar', 'MK' => 'Macedonia', 'ML' => 'Mali', 'MN' => 'Mongolia',
|
45
|
+
'MO' => 'Macau', 'MR' => 'Mauritania', 'MS' => 'Montserrat', 'MT' => 'Malta',
|
46
|
+
'MU' => 'Mauritius', 'MW' => 'Malawi', 'MX' => 'Mexico', 'MY' => 'Malaysia',
|
47
|
+
'MZ' => 'Mozambique', 'NA' => 'Namibia', 'NE' => 'Niger', 'NG' => 'Nigeria',
|
48
|
+
'NI' => 'Nicaragua', 'NL' => 'Netherlands', 'NO' => 'Norway', 'NP' => 'Nepal',
|
49
|
+
'NZ' => 'New Zealand', 'OM' => 'Oman', 'PA' => 'Panama', 'PE' => 'Peru',
|
50
|
+
'PG' => 'Papua New Guinea', 'PH' => 'Philippines', 'PK' => 'Pakistan', 'PL' => 'Poland',
|
51
|
+
'PT' => 'Portugal', 'PW' => 'Palau', 'PY' => 'Paraguay', 'QA' => 'Qatar', 'RO' => 'Romania',
|
52
|
+
'RU' => 'Russia', 'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands', 'SC' => 'Seychelles',
|
53
|
+
'SE' => 'Sweden', 'SG' => 'Singapore', 'SI' => 'Slovenia', 'SK' => 'Slovakia',
|
54
|
+
'SL' => 'Sierra Leone', 'SN' => 'Senegal', 'SR' => 'Suriname',
|
55
|
+
'ST' => 'Sao Tome and Principe', 'SV' => 'El Salvador', 'SZ' => 'Swaziland',
|
56
|
+
'TC' => 'Turks and Caicos', 'TD' => 'Chad', 'TH' => 'Thailand', 'TJ' => 'Tajikistan',
|
57
|
+
'TM' => 'Turkmenistan', 'TN' => 'Tunisia', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago',
|
58
|
+
'TW' => 'Taiwan', 'TZ' => 'Tanzania', 'UA' => 'Ukraine', 'UG' => 'Uganda',
|
59
|
+
'US' => 'United States', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan',
|
60
|
+
'VC' => 'St. Vincent and The Grenadines', 'VE' => 'Venezuela',
|
61
|
+
'VG' => 'British Virgin Islands', 'VN' => 'Vietnam', 'YE' => 'Yemen',
|
62
|
+
'ZA' => 'South Africa', 'ZW' => 'Zimbabwe'
|
47
63
|
}.freeze
|
48
64
|
|
49
|
-
|
50
|
-
|
65
|
+
REGIONS = {
|
66
|
+
'Europe' => %w(AL AT BY BE BG HR CY CZ DK EE FI FR DE GR HU IS IE IT LV LT LU MK MT MD NL NO
|
67
|
+
PL PT RO RU SK SI ES SE CH TR UA GB),
|
68
|
+
|
69
|
+
'Africa, Middle East, and India' => %w(DZ AO AM AZ BH BJ BW BF CV TD CG EG GM GH GW IN IL JO
|
70
|
+
KE KW LB LR MG MW ML MR MU MZ NA NE NG OM QA SA SN SC SL ZA SZ ST TZ TN UG AE YE ZW),
|
71
|
+
|
72
|
+
'Latin America and the Caribbean' => %w(AI AG AR BS BB BZ BM BO BR KY CL CO CR DM DO EC SV GD
|
73
|
+
GT GY HN JM MX MS NI PA PY PE LC KN VC SR TT TC UY VE VG),
|
74
|
+
|
75
|
+
'Asia Pacific' => %w(AU BT BN KH CN FJ HK ID JP KZ KR KG LA MO MY FM MN NP NZ PK PW PG PH SG
|
76
|
+
SB LK TW TJ TH TM UZ VN),
|
77
|
+
|
78
|
+
'The United States and Canada' => %w(CA US)
|
79
|
+
}
|
80
|
+
|
81
|
+
# Find a territory by code.
|
82
|
+
#
|
83
|
+
# AppStoreInfo::Regions.find('PT')
|
84
|
+
# # => "Portugal"
|
85
|
+
def self.find(code)
|
86
|
+
territory_list[code.upcase]
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.full_list
|
90
|
+
REGIONS.map do |region|
|
91
|
+
{ region.first => region.last.map { |code| { code: code, name: TERRITORIES[code] } } }
|
92
|
+
end
|
51
93
|
end
|
52
94
|
|
53
|
-
def self.
|
54
|
-
|
95
|
+
def self.territory_list
|
96
|
+
TERRITORIES
|
55
97
|
end
|
56
98
|
end
|
57
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_store_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Otero
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -187,3 +187,4 @@ signing_key:
|
|
187
187
|
specification_version: 4
|
188
188
|
summary: App Store parser
|
189
189
|
test_files: []
|
190
|
+
has_rdoc:
|