cdg-services 0.0.4 → 0.0.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -2
- data/lib/cdg/services.rb +4 -7
- data/lib/cdg/services/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f672635ee41894121d9d4f6997fef12df4e10682
|
4
|
+
data.tar.gz: 925b4aacf45db6aa8e4542c936dee121625ccbd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85c1c5ff5e774f28c9468a270fed4e1b4d0a9ebe0e9790eb204801058107edff95a55352416190aa002e35fd940a88ad73ba206d2fc64d2547507d1e8510b476
|
7
|
+
data.tar.gz: a851c2e53f9207a811161d5fd132132bbf65407945a9268c5d03fa4e59069a725afc29f81f91c8630f108e81b3985f84a16ea956c7908f331b7624114646af7d
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.0.5] - 2018-03-30
|
10
|
+
### Fixed
|
11
|
+
- Fit new Google Play store web page HTML structure for android apps
|
12
|
+
|
9
13
|
## [0.0.4] - 2017-07-15
|
10
14
|
### Fixed
|
11
15
|
- Remove require "pry" in service file
|
data/README.md
CHANGED
@@ -30,15 +30,20 @@ Or install it yourself as:
|
|
30
30
|
|
31
31
|
Get the latest app version of any iOS app; `app_id` is the id of the app in the form of numerics, eg. `12345678`.
|
32
32
|
```ruby
|
33
|
-
CDG::Services.get_ios_version(app_id: app_id)
|
33
|
+
CDG::Services.get_ios_version(app_id: app_id) # returns `1.1.5`
|
34
34
|
```
|
35
|
+
|
36
|
+
Use `Gem::Version.new(app_store_version) > Gem::Version.new(app_version)` to compare versions
|
37
|
+
|
35
38
|
#### CDG::Services.get_android_version
|
36
39
|
|
37
40
|
Get the latest app version of any Android app; `app_id` is the id of the app in the form of `com.package.name`.
|
38
41
|
```ruby
|
39
|
-
CDG::Services.get_android_version(app_id: app_id)
|
42
|
+
CDG::Services.get_android_version(app_id: app_id) # returns `1.1.5`
|
40
43
|
```
|
41
44
|
|
45
|
+
Use `Gem::Version.new(play_store_version) > Gem::Version.new(app_version)` to compare versions
|
46
|
+
|
42
47
|
#### CDG::Services.ping_slack
|
43
48
|
|
44
49
|
Send a message as an attachment to any slack channel via a Slack webhook, eg. `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX`. See how to set up a [Slack webhook](https://api.slack.com/incoming-webhooks) and send message as [attachment](https://api.slack.com/docs/message-attachments).
|
data/lib/cdg/services.rb
CHANGED
@@ -21,14 +21,11 @@ module CDG
|
|
21
21
|
|
22
22
|
def self.get_android_version app_id: # eg sg.codigo.app_name
|
23
23
|
begin
|
24
|
-
|
25
|
-
elements = resp.css("div[class='content'][itemprop='softwareVersion']")
|
24
|
+
html = URI.parse("https://play.google.com/store/apps/details?id=#{app_id}&hl=en").read
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
elements[0].text.strip
|
31
|
-
end
|
26
|
+
/<div[^>]*?>Current Version<\/div><div><span[^>]*?>(?<android_version>.*?)<\/span><\/div>/ =~ html
|
27
|
+
|
28
|
+
android_version
|
32
29
|
rescue OpenURI::HTTPError => e
|
33
30
|
return nil
|
34
31
|
end
|
data/lib/cdg/services/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdg-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vic-L
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.6.
|
128
|
+
rubygems_version: 2.6.13
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Codigo - Ruby on Rails Team's common services
|