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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8902a919795f60723f5a8f77e36569392a9b27e8878fe0e793055d41e3d2712f
4
- data.tar.gz: 0c17121b5cd27736d9caf1f829c71ad2473180a28ccc2cdd99ecd2aab91cbe9f
3
+ metadata.gz: 763265f76f26d40ab424441dc63d27b8726a8619a6cb3cd058c1f8a96d1d7cb3
4
+ data.tar.gz: c376541c3e05472efb43ac3fd4f39e7c69c7d9177ca98368141cf164a45a645b
5
5
  SHA512:
6
- metadata.gz: 8777330e81cf08f1ab781d2beb0010b4c348ee17251d0399d3a5ae3f27ad9e9bfeaf630c3ebb5ff1b6839ac6219771ce89d9b0e30bc705c87eea52d8f736faa1
7
- data.tar.gz: 804a12d588385539bd7cdb1a9629e694af9838c556499d75026b8776870d494c3b49c3b94df1fb2ad4ac5eb4bd10b76c4f0593b618fa2b84c23d825ad6332ca5
6
+ metadata.gz: 3c01b703b4385a58d1d5bc954e9e1f018e9bef313de4703ea12d036774553dbe8fe2b6e0c898a4dcdf130fbad7c8e396fc53df4c8991e3500cfc900beacb5a16
7
+ data.tar.gz: cb184d9dba17c1a54cb8c023006d1f9ec664b78cbeef881d0b996c378760f5c30721c8d823561263e8897827f285b2f4a3630249a008ea3dc0aa0d21fefd9f11
@@ -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
@@ -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
  }
@@ -1,6 +1,5 @@
1
1
  require "httparty"
2
- require "brawlstars/tag"
3
- require "brawlstars/region"
2
+ require "brawlstars/validation"
4
3
 
5
4
  module Brawlstars
6
5
  class Error
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Brawlstars
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
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.0
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-06 00:00:00.000000000 Z
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/region.rb
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!
@@ -1,3 +0,0 @@
1
- def validateRegion(region)
2
- raise Brawlstars::Error::RegionError if (region != "global" and region.length != 2)
3
- end
@@ -1,9 +0,0 @@
1
- def cleanTag(tag)
2
- tag.upcase.sub('#', '').gsub('O', '0')
3
- end
4
-
5
- def validateTag(tag)
6
- tag = cleanTag(tag)
7
- raise Brawlstars::Error::TagError if !tag.match(/^[0289CGJLPQRUVY]+$/)
8
- tag
9
- end