app_store_info 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3bfb3d43c7d1df8e366db41631fcc90214ba915
4
- data.tar.gz: aad0c320fa85e9cecf1776148eda7d485f1640ce
3
+ metadata.gz: bb2950431c398803bbe3a5101fb2e812d908f763
4
+ data.tar.gz: f3f92aa3830de415f225c41a3d3f7bbc6e0150de
5
5
  SHA512:
6
- metadata.gz: eae80894d1038f07e72c7ab571dd8354dc9ff9898bae7642b9f20651362d6608dee85bf9e5e49829b3aff9fcb83de54178f70feaa045b37bfe5acc2f927d882d
7
- data.tar.gz: 6337e77bbbbe75b743b7384e7370c9c4a8be5e9cc2e29d7ac2d37210ec09943da04bda215c86f13ea08d80f52995f9e25751b6ec2015111bd93d25309c74f2d1
6
+ metadata.gz: c13a26b2667be052fa3eaeb70d68e458f5a9047f0852ff1eb7080bbab5d286a6dd05ad3657710055bcb7d1227138af785689f1264d985e7908a989b7fd33dc8f
7
+ data.tar.gz: e9092d12073c8752cd71905bb6e3de1e95cb7cbb21e6034fa9fca7e2e0cfcda65189655fda9113fee6f454a77a0bcfcaf0bae3d84fc1858cde233bf9492ccf31
data/.rubocop.yml CHANGED
@@ -8,3 +8,12 @@ Style/Documentation:
8
8
 
9
9
  Style/NumericLiterals:
10
10
  Enabled: false
11
+
12
+ Style/FrozenStringLiteralComment:
13
+ Enabled: false
14
+
15
+ RSpec/MultipleExpectations:
16
+ Enabled: false
17
+
18
+ RSpec/ExampleLength:
19
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.3.3
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
3
  - 2.2.2
4
+ - 2.3.0
5
+ - 2.3.3
6
6
  before_install: gem install bundler -v 1.10.6
@@ -19,7 +19,7 @@ module AppStoreInfo
19
19
  response = Faraday.get(url)
20
20
 
21
21
  unless response.status == 200 && response.body
22
- fail ConnectionError, "Cound't connect to app store API"
22
+ raise ConnectionError, "Cound't connect to app store API"
23
23
  end
24
24
 
25
25
  parse_json(response.body)
@@ -30,13 +30,13 @@ module AppStoreInfo
30
30
  def parse_json(body)
31
31
  json = JSON.parse(body)
32
32
 
33
- fail EntryNotFound, 'No results' unless json.key?('results')
33
+ raise EntryNotFound, 'No results' unless json.key?('results')
34
34
 
35
35
  json = json['results'].first
36
36
 
37
37
  # If the JSON exists and it's a mobile app (to avoid OS X apps)
38
38
  unless json && json['supportedDevices']
39
- fail EntryNotFound, "App not found or unavailable on '#{@region}' region"
39
+ raise EntryNotFound, "App not found or unavailable on '#{@region}' region"
40
40
  end
41
41
 
42
42
  json
@@ -34,7 +34,7 @@ module AppStoreInfo
34
34
  def store_icon_url
35
35
  return unless @artwork
36
36
 
37
- @artwork.match(/\.(png|jpg|gif)\z/) ? @artwork : nil
37
+ @artwork =~ /\.(png|jpg|gif)\z/ ? @artwork : nil
38
38
  end
39
39
 
40
40
  private
@@ -26,32 +26,34 @@ module AppStoreInfo
26
26
  'BG' => 'Bulgaria', 'BH' => 'Bahrain', 'BJ' => 'Benin', 'BM' => 'Bermuda',
27
27
  'BN' => 'Brunei Darussalam', 'BO' => 'Bolivia', 'BR' => 'Brazil', 'BS' => 'Bahamas',
28
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',
29
+ 'CG' => 'Republic Of Congo', 'CH' => 'Switzerland', 'CL' => 'Chile', 'CM' => 'Cameroon',
30
+ 'CN' => 'China', 'CO' => 'Colombia', 'CR' => 'Costa Rica', 'CV' => 'Cape Verde',
31
+ 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'DE' => 'Germany', 'DK' => 'Denmark',
32
+ 'DM' => 'Dominica', 'DO' => 'Dominican Republic', 'DZ' => 'Algeria', 'EC' => 'Ecuador',
33
+ 'EE' => 'Estonia', 'EG' => 'Egypt', 'ES' => 'Spain', 'ET' => 'Ethiopia', 'FI' => 'Finland',
34
+ 'FJ' => 'Fiji', 'FM' => 'Federated States Of Micronesia', 'FR' => 'France',
35
+ 'GB' => 'United Kingdom', 'GD' => 'Grenada', 'GH' => 'Ghana', 'GM' => 'Gambia',
36
+ 'GR' => 'Greece', 'GT' => 'Guatemala', 'GW' => 'Guinea-Bissau', 'GY' => 'Guyana',
37
+ 'HK' => 'Hong Kong', 'HN' => 'Honduras', 'HR' => 'Croatia', 'HU' => 'Hungary',
38
+ 'ID' => 'Indonesia', 'IE' => 'Ireland', 'IL' => 'Israel', 'IN' => 'India', 'IS' => 'Iceland',
39
+ 'IT' => 'Italy', 'JM' => 'Jamaica',
39
40
  'JO' => 'Jordan', 'JP' => 'Japan', 'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia',
40
41
  'KN' => 'St. Kitts and Nevis', 'KR' => 'Republic Of Korea', 'KW' => 'Kuwait',
41
42
  'KY' => 'Cayman Islands', 'KZ' => 'Kazakhstan', 'LA' => "Lao People's Democratic Republic",
42
43
  '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',
44
+ 'LS' => 'Lesotho', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'LV' => 'Latvia',
45
+ 'MD' => 'Republic Of Moldova', 'MG' => 'Madagascar', 'MK' => 'Macedonia', 'ML' => 'Mali',
46
+ 'MN' => 'Mongolia', 'MO' => 'Macau', 'MR' => 'Mauritania', 'MS' => 'Montserrat',
47
+ 'MT' => 'Malta', 'MU' => 'Mauritius', 'MW' => 'Malawi', 'MX' => 'Mexico', 'MY' => 'Malaysia',
47
48
  'MZ' => 'Mozambique', 'NA' => 'Namibia', 'NE' => 'Niger', 'NG' => 'Nigeria',
48
49
  'NI' => 'Nicaragua', 'NL' => 'Netherlands', 'NO' => 'Norway', 'NP' => 'Nepal',
49
50
  'NZ' => 'New Zealand', 'OM' => 'Oman', 'PA' => 'Panama', 'PE' => 'Peru',
50
51
  'PG' => 'Papua New Guinea', 'PH' => 'Philippines', 'PK' => 'Pakistan', 'PL' => 'Poland',
51
52
  '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',
53
+ 'RU' => 'Russia', 'RW' => 'Rwanda', 'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands',
54
+ 'SC' => 'Seychelles', 'SE' => 'Sweden', 'SG' => 'Singapore',
55
+ 'SI' => 'Slovenia', 'SK' => 'Slovakia', 'SL' => 'Sierra Leone',
56
+ 'SN' => 'Senegal', 'SR' => 'Suriname', 'SS' => 'South Sudan',
55
57
  'ST' => 'Sao Tome and Principe', 'SV' => 'El Salvador', 'SZ' => 'Swaziland',
56
58
  'TC' => 'Turks and Caicos', 'TD' => 'Chad', 'TH' => 'Thailand', 'TJ' => 'Tajikistan',
57
59
  'TM' => 'Turkmenistan', 'TN' => 'Tunisia', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago',
@@ -59,7 +61,7 @@ module AppStoreInfo
59
61
  'US' => 'United States', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan',
60
62
  'VC' => 'St. Vincent and The Grenadines', 'VE' => 'Venezuela',
61
63
  'VG' => 'British Virgin Islands', 'VN' => 'Vietnam', 'YE' => 'Yemen',
62
- 'ZA' => 'South Africa', 'ZW' => 'Zimbabwe'
64
+ 'ZA' => 'South Africa', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe'
63
65
  }.freeze
64
66
 
65
67
  REGIONS = {
@@ -69,8 +71,8 @@ module AppStoreInfo
69
71
  ),
70
72
 
71
73
  'Africa, Middle East, and India' => %w(
72
- DZ AO AM AZ BH BJ BW BF CV TD CG EG GM GH GW IN IL JO KE KW LB LR MG MW ML MR MU MZ NA NE
73
- NG OM QA SA SN SC SL ZA SZ ST TZ TN UG AE YE ZW
74
+ DZ AO AM AZ BH BJ BW BF CM CV TD CG EG ET GM GH GW IN IL JO KE KW LB LS LR MG MW ML MR MU
75
+ MZ NA NE NG OM QA RW SA SN SC SS SL ZA SZ ST TZ TN UG AE YE ZM ZW
74
76
  ),
75
77
 
76
78
  'Latin America and the Caribbean' => %w(
@@ -84,7 +86,7 @@ module AppStoreInfo
84
86
  ),
85
87
 
86
88
  'The United States and Canada' => %w(CA US)
87
- }
89
+ }.freeze
88
90
 
89
91
  # Find a territory by code.
90
92
  #
@@ -1,3 +1,3 @@
1
1
  module AppStoreInfo
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'.freeze
3
3
  end
@@ -5,7 +5,7 @@ require 'app_store_info/regions'
5
5
  require 'app_store_info/genres'
6
6
 
7
7
  module AppStoreInfo
8
- DEFAULT_REGION = 'us'
8
+ DEFAULT_REGION = 'us'.freeze
9
9
 
10
10
  def self.read(id, region = DEFAULT_REGION)
11
11
  # The region can be wrong because of the multiple app store formats (and our way of getting) it
@@ -20,7 +20,7 @@ module AppStoreInfo
20
20
  def self.read_url(url)
21
21
  match = url.match(%r{\Ahttps://itunes.apple.com/(\w+)/.+/?id=?([\d]+)})
22
22
 
23
- fail InvalidURLError, 'Invalid App Store URL' unless match
23
+ raise InvalidURLError, 'Invalid App Store URL' unless match
24
24
 
25
25
  region = match.captures.first
26
26
  id = match.captures.last
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.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -182,9 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.4.5.1
185
+ rubygems_version: 2.5.2
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: App Store parser
189
189
  test_files: []
190
- has_rdoc: