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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b0050fc08b2d1862909ccab9dfddee394a735c0
4
- data.tar.gz: 90546fd08bdb5673ffd93e3f53ae445d9474b5a4
3
+ metadata.gz: b1ea8adfcfb1b6a0b26d37f147a35b87afb10721
4
+ data.tar.gz: 9a9a1fb4c6dd168719479f430363132b3eaa1990
5
5
  SHA512:
6
- metadata.gz: 89163dd9da0430aaff1e4f000aec73ce8891c337a3f50d184a8d00ddc66c0074acc37f12a5bd9d4709a706d7fdccf3527c88045ba927baeca0a3be28d4b9ae63
7
- data.tar.gz: 112b10887926332f345c7bfc7150ac1cf13d104d3e7ea63621198e161931665ce498999ef05cdb971322bb9b4157291b83dbeba80c0496ad9d1e2f7603c80a20
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
- REGIONS = {
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', 'BN' => 'Brunei',
12
- 'BO' => 'Bolivia', 'BR' => 'Brazil', 'BS' => 'Bahamas', 'BT' => 'Bhutan', 'BW' => 'Botswana',
13
- 'BY' => 'Belarus', 'BZ' => 'Belize', 'CA' => 'Canada', 'CG' => 'Republic Of Congo',
14
- 'CH' => 'Switzerland', 'CL' => 'Chile', 'CN' => 'China', 'CO' => 'Colombia',
15
- 'CR' => 'Costa Rica', 'CV' => 'Cape Verde', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic',
16
- 'DE' => 'Germany', 'DK' => 'Denmark', 'DM' => 'Dominica', 'DO' => 'Dominican Republic',
17
- 'DZ' => 'Algeria', 'EC' => 'Ecuador', 'EE' => 'Estonia', 'EG' => 'Egypt',
18
- 'ES' => 'Spain', 'FI' => 'Finland', 'FJ' => 'Fiji', 'FM' => 'Federated States Of Micronesia',
19
- 'FR' => 'France', 'GB' => 'United Kingdom', 'GD' => 'Grenada', 'GH' => 'Ghana',
20
- 'GM' => 'Gambia', 'GR' => 'Greece', 'GT' => 'Guatemala', 'GW' => 'Guinea-Bissau',
21
- 'GY' => 'Guyana', 'HK' => 'Hong Kong', 'HN' => 'Honduras', 'HR' => 'Croatia',
22
- 'HU' => 'Hungary', 'ID' => 'Indonesia', 'IE' => 'Ireland', 'IL' => 'Israel', 'IN' => 'India',
23
- 'IS' => 'Iceland', 'IT' => 'Italy', 'JM' => 'Jamaica', 'JO' => 'Jordan', 'JP' => 'Japan',
24
- 'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia', 'KN' => 'St. Kitts and Nevis',
25
- 'KR' => 'Republic Of Korea', 'KW' => 'Kuwait', 'KY' => 'Cayman Islands',
26
- 'KZ' => 'Kazakstan', 'LA' => "Lao People's Democratic Republic", 'LB' => 'Lebanon',
27
- 'LC' => 'St. Lucia', 'LK' => 'Sri Lanka', 'LR' => 'Liberia', 'LT' => 'Lithuania',
28
- 'LU' => 'Luxembourg', 'LV' => 'Latvia', 'MD' => 'Republic Of Moldova', 'MG' => 'Madagascar',
29
- 'MK' => 'Macedonia', 'ML' => 'Mali', 'MN' => 'Mongolia', 'MO' => 'Macau',
30
- 'MR' => 'Mauritania', 'MS' => 'Montserrat', 'MT' => 'Malta', 'MU' => 'Mauritius',
31
- 'MW' => 'Malawi', 'MX' => 'Mexico', 'MY' => 'Malaysia', 'MZ' => 'Mozambique',
32
- 'NA' => 'Namibia', 'NE' => 'Niger', 'NG' => 'Nigeria', 'NI' => 'Nicaragua',
33
- 'NL' => 'Netherlands', 'NO' => 'Norway', 'NP' => 'Nepal', 'NZ' => 'New Zealand',
34
- 'OM' => 'Oman', 'PA' => 'Panama', 'PE' => 'Peru', 'PG' => 'Papua New Guinea',
35
- 'PH' => 'Philippines', 'PK' => 'Pakistan', 'PL' => 'Poland', 'PT' => 'Portugal',
36
- 'PW' => 'Palau', 'PY' => 'Paraguay', 'QA' => 'Qatar', 'RO' => 'Romania', 'RU' => 'Russia',
37
- 'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands', 'SC' => 'Seychelles', 'SE' => 'Sweden',
38
- 'SG' => 'Singapore', 'SI' => 'Slovenia', 'SK' => 'Slovakia', 'SL' => 'Sierra Leone',
39
- 'SN' => 'Senegal', 'SR' => 'Suriname', 'ST' => 'Sao Tome and Principe',
40
- 'SV' => 'El Salvador', 'SZ' => 'Swaziland', 'TC' => 'Turks and Caicos',
41
- 'TD' => 'Chad', 'TH' => 'Thailand', 'TJ' => 'Tajikistan', 'TM' => 'Turkmenistan',
42
- 'TN' => 'Tunisia', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago', 'TW' => 'Taiwan',
43
- 'TZ' => 'Tanzania', 'UA' => 'Ukraine', 'UG' => 'Uganda', 'US' => 'United States',
44
- 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan', 'VC' => 'St. Vincent and The Grenadines',
45
- 'VE' => 'Venezuela', 'VG' => 'British Virgin Islands',
46
- 'VN' => 'Vietnam', 'YE' => 'Yemen', 'ZA' => 'South Africa', 'ZW' => 'Zimbabwe'
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
- def self.find(region)
50
- list[region.upcase]
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.list
54
- REGIONS
95
+ def self.territory_list
96
+ TERRITORIES
55
97
  end
56
98
  end
57
99
  end
@@ -1,3 +1,3 @@
1
1
  module AppStoreInfo
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  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.1
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-09 00:00:00.000000000 Z
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: