brawlstars 1.2.0 → 1.2.1
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 +20 -1
- data/brawlstars.gemspec +1 -1
- data/lib/brawlstars.rb +1 -2
- data/lib/brawlstars/validation.rb +15 -0
- data/lib/brawlstars/version.rb +1 -1
- metadata +4 -5
- data/lib/brawlstars/region.rb +0 -3
- data/lib/brawlstars/tag.rb +0 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 763265f76f26d40ab424441dc63d27b8726a8619a6cb3cd058c1f8a96d1d7cb3
|
|
4
|
+
data.tar.gz: c376541c3e05472efb43ac3fd4f39e7c69c7d9177ca98368141cf164a45a645b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c01b703b4385a58d1d5bc954e9e1f018e9bef313de4703ea12d036774553dbe8fe2b6e0c898a4dcdf130fbad7c8e396fc53df4c8991e3500cfc900beacb5a16
|
|
7
|
+
data.tar.gz: cb184d9dba17c1a54cb8c023006d1f9ec664b78cbeef881d0b996c378760f5c30721c8d823561263e8897827f285b2f4a3630249a008ea3dc0aa0d21fefd9f11
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [1.2.1]
|
|
3
|
+
### Added
|
|
4
|
+
- Actual region code checking
|
|
5
|
+
|
|
6
|
+
### Changed
|
|
7
|
+
- Moved validation functions to one file ([validation.rb](../master/lib/brawlstars/tag.rb))
|
|
8
|
+
- Fixed changelog link in gemspec
|
|
9
|
+
|
|
10
|
+
### Removed
|
|
11
|
+
- Removed tag.rb and region.rb (see above)
|
|
12
|
+
|
|
13
|
+
## [1.2.0]
|
|
14
|
+
### Added
|
|
15
|
+
- Add player battle log endpoint
|
|
16
|
+
- Add region parameter to top player/club leaderboards
|
|
17
|
+
- Add RegionError
|
|
18
|
+
|
|
2
19
|
## [1.1.0]
|
|
3
20
|
### Added
|
|
4
21
|
- Custom Error Types
|
|
@@ -6,5 +23,7 @@
|
|
|
6
23
|
## [1.0.0]
|
|
7
24
|
Initial version
|
|
8
25
|
|
|
26
|
+
[1.2.1]: https://github.com/Karthik99999/brawlstarsrb/tree/v1.2.1
|
|
27
|
+
[1.2.0]: https://github.com/Karthik99999/brawlstarsrb/tree/v1.2.0
|
|
9
28
|
[1.1.0]: https://github.com/Karthik99999/brawlstarsrb/tree/v1.1.0
|
|
10
|
-
[1.0.0]: https://github.com/Karthik99999/brawlstarsrb/tree/v1.0.0
|
|
29
|
+
[1.0.0]: https://github.com/Karthik99999/brawlstarsrb/tree/v1.0.0
|
data/brawlstars.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.post_install_message = "Brawlstarsrb is my name, GETting is my game!"
|
|
23
23
|
spec.metadata = {
|
|
24
24
|
"bug_tracker_uri" => "https://github.com/Karthik99999/brawlstarsrb/issues",
|
|
25
|
-
"changelog_uri" => "https://github.com/Karthik99999/brawlstarsrb/CHANGELOG.md",
|
|
25
|
+
"changelog_uri" => "https://github.com/Karthik99999/brawlstarsrb/blob/master/CHANGELOG.md",
|
|
26
26
|
"documentation_uri" => "https://www.rubydoc.info/github/Karthik99999/brawlstarsrb",
|
|
27
27
|
"source_code_uri" => "https://github.com/Karthik99999/brawlstarsrb"
|
|
28
28
|
}
|
data/lib/brawlstars.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
regionCodes = ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BH", "BS", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]
|
|
2
|
+
|
|
3
|
+
def validateRegion(region)
|
|
4
|
+
raise Brawlstars::Error::RegionError if (region != "global" and regionCodes.include? region.upcase)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def cleanTag(tag)
|
|
8
|
+
tag.upcase.delete("#").gsub("O", "0")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def validateTag(tag)
|
|
12
|
+
tag = cleanTag(tag)
|
|
13
|
+
raise Brawlstars::Error::TagError if !tag.match(/^[0289CGJLPQRUVY]+$/)
|
|
14
|
+
tag
|
|
15
|
+
end
|
data/lib/brawlstars/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brawlstars
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Karthik99999
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-07-
|
|
11
|
+
date: 2019-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|
|
@@ -70,15 +70,14 @@ files:
|
|
|
70
70
|
- bin/setup
|
|
71
71
|
- brawlstars.gemspec
|
|
72
72
|
- lib/brawlstars.rb
|
|
73
|
-
- lib/brawlstars/
|
|
74
|
-
- lib/brawlstars/tag.rb
|
|
73
|
+
- lib/brawlstars/validation.rb
|
|
75
74
|
- lib/brawlstars/version.rb
|
|
76
75
|
homepage: https://github.com/Karthik99999/brawlstarsrb
|
|
77
76
|
licenses:
|
|
78
77
|
- MIT
|
|
79
78
|
metadata:
|
|
80
79
|
bug_tracker_uri: https://github.com/Karthik99999/brawlstarsrb/issues
|
|
81
|
-
changelog_uri: https://github.com/Karthik99999/brawlstarsrb/CHANGELOG.md
|
|
80
|
+
changelog_uri: https://github.com/Karthik99999/brawlstarsrb/blob/master/CHANGELOG.md
|
|
82
81
|
documentation_uri: https://www.rubydoc.info/github/Karthik99999/brawlstarsrb
|
|
83
82
|
source_code_uri: https://github.com/Karthik99999/brawlstarsrb
|
|
84
83
|
post_install_message: Brawlstarsrb is my name, GETting is my game!
|
data/lib/brawlstars/region.rb
DELETED