play_store_info 1.0.1 → 1.0.2

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: 9bdf278a90892bf8f090036d1202d4bdc8c717eb
4
- data.tar.gz: 1ce7f35554e71d30d044ef8cd7e1ba6fe63ffd2d
3
+ metadata.gz: 152208b65283d55b94c25cc3e23ddf71b952804a
4
+ data.tar.gz: 3a66480fd96222bb32d6abbef4bae2e072a528b0
5
5
  SHA512:
6
- metadata.gz: 3c4fa2abfeffb2a3d16dac7c121b70af0c21ad20e258e0dda6d5b110d84d267c5495f5fd9ba580bec9e9b17d8d573484bbdc8bfea7aaf6fc62068e2a2edfd606
7
- data.tar.gz: 570ae485848a267a604ba92042eb7d285fcce26828c869ae550424c69ef9296c366a44844c2e135b9e618a8f8672cd9a2d26f29e8022c81e9a7f9a9813848694
6
+ metadata.gz: c8bc2abe739890be73c7b640caa4476b583b2721eca7d3da9492a806f98a065343bb1e3024a4d00eb505fb85e99f281ebc6e5f24071abdc39a583005448a9fbe
7
+ data.tar.gz: 48a08e58c34854af54a7ffebd27da09aacf2c71fc8d4b0e8e453a94514b6c2004ccafcb27c9d4400f2f4386906bce94a52ab81f68df1d657deed06db8d32085c
@@ -7,31 +7,33 @@ module PlayStoreInfo
7
7
  MIN_IDS_REGEXP_MATCHES = 2
8
8
  FIRST_ID_REGEXP_MATCH = 1
9
9
 
10
- def self.read(id, lang = 'en')
11
- parse(id, "https://play.google.com/store/apps/details?id=#{id}&hl=#{lang}")
12
- end
10
+ class << self
11
+ def read(id, lang = 'en')
12
+ parse(id, "https://play.google.com/store/apps/details?id=#{id}&hl=#{lang}")
13
+ end
13
14
 
14
- def self.read_url(url)
15
- id = url.match(/id=([[:alnum:]\.]+)[&]?/)
15
+ def read_url(url)
16
+ id = url.match(/id=([[:alnum:]\.]+)[&]?/)
16
17
 
17
- raise InvalidStoreLink unless google_store?(url) && id && id.length == MIN_IDS_REGEXP_MATCHES
18
+ raise InvalidStoreLink unless google_store?(url) && id && id.length == MIN_IDS_REGEXP_MATCHES
18
19
 
19
- parse(id[FIRST_ID_REGEXP_MATCH], url)
20
- end
20
+ parse(id[FIRST_ID_REGEXP_MATCH], url)
21
+ end
21
22
 
22
- private
23
+ private
23
24
 
24
- def parse(id, url)
25
- inspector ||= MetaInspector.new(url)
25
+ def parse(id, url)
26
+ inspector ||= MetaInspector.new(url)
26
27
 
27
- raise AppNotFound unless inspector.response.status == 200
28
+ raise AppNotFound unless inspector.response.status == 200
28
29
 
29
- AppParser.new(id, inspector.parsed)
30
- rescue Faraday::ConnectionFailed, Faraday::SSLError, Errno::ETIMEDOUT
31
- raise ConnectionError
32
- end
30
+ AppParser.new(id, inspector.parsed)
31
+ rescue Faraday::ConnectionFailed, Faraday::SSLError, Errno::ETIMEDOUT
32
+ raise ConnectionError
33
+ end
33
34
 
34
- def google_store?(url)
35
- url.match(%r{\Ahttps://play.google.com})
35
+ def google_store?(url)
36
+ url.match(%r{\Ahttps://play.google.com})
37
+ end
36
38
  end
37
39
  end
@@ -1,3 +1,3 @@
1
1
  module PlayStoreInfo
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: play_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
  - Hugo Sequeira