hive-stalker 0.1.2 → 0.1.3

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: dbb396653951a206bca6b8e264ab0b01a3ba2fb9
4
- data.tar.gz: 72e9a8e985965ca686ce62253efa42212cdb502c
3
+ metadata.gz: 5c5e80a8cd50b6af6a8b3d6f62c016c354dda620
4
+ data.tar.gz: fa6b23f7b415d94fa1609a2b3c3ac3252e0323c6
5
5
  SHA512:
6
- metadata.gz: f311d7d466dd2496ba2aba89f40abf5901e42719c5d8b10606b24ed236d8d6a4ff23a5c9db02067d2b2cb609a36c09272690dee7459b460258f706af39919c95
7
- data.tar.gz: eac2cdf74f31757acae31e029a29fbd94bd3438e8271269a0ca1c60ed3e70dbb1fb29d90b4f9926ffa653cfd31cc20073d10e9a3aac4619f99c95477e27d5a78
6
+ metadata.gz: eb7762168a29e55a8eec2b6032195a5af0a073e918c485708fcf93cb4a28bf5790257dcf6e62bcfbc8ee942804dff1370897908943afb0cd9838c7322786f7df
7
+ data.tar.gz: cbd17affbe4ed6a68b2f21b67763d8b6b6a53e9cf75b7b67d242fc746022f8987f17cdb350559d6acfd53fc31ee7c916302afb16b9d716c87aa056d86d9658f5
@@ -19,6 +19,14 @@ glance - what to expact from upgrading to a new version.
19
19
  ### Removed
20
20
 
21
21
 
22
+ ## [0.1.3] - 2016-12-25
23
+
24
+ ### Fixed
25
+
26
+ - HiveStalker::SteamID.from_string did not support account IDs with less than
27
+ eight digits.
28
+
29
+
22
30
  ## [0.1.2] - 2016-12-25
23
31
 
24
32
  ### Changed
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "hive-stalker"
7
- spec.version = '0.1.2'
7
+ spec.version = '0.1.3'
8
8
  spec.authors = ["Michael Senn"]
9
9
  spec.email = ["michael@morrolan.ch"]
10
10
 
@@ -6,7 +6,8 @@ module HiveStalker
6
6
  PATTERN_STEAM_ID = /^STEAM_0:([0-9]):([0-9]+)$/
7
7
  PATTERN_STEAM_ID_3 = /^U:([0-9]{1,2}):([0-9]+)$/
8
8
  PATTERN_STEAM_ID_64 = /^765([0-9]+)$/
9
- PATTERN_ACCOUNT_ID = /^[0-9]{8}$/
9
+ # Not sure what its valid range is - exists with at least 7 and 8 numbers.
10
+ PATTERN_ACCOUNT_ID = /^[0-9]+$/
10
11
 
11
12
  # Convert Steam ID into account ID suitable for API calls.
12
13
  # @param s [String] Steam ID, either of:
@@ -22,10 +23,6 @@ module HiveStalker
22
23
  s = s.to_s
23
24
 
24
25
  # https://developer.valvesoftware.com/wiki/SteamID#Format
25
- PATTERN_ACCOUNT_ID.match(s) do |m|
26
- return s.to_i
27
- end
28
-
29
26
  PATTERN_STEAM_ID.match(s) do |m|
30
27
  return m[1].to_i + m[2].to_i * 2
31
28
  end
@@ -38,6 +35,11 @@ module HiveStalker
38
35
  return m[1].to_i - STEAM_ID_64_OFFSET
39
36
  end
40
37
 
38
+ # Matching this one last, as not to catch an ID 64 on accident.
39
+ PATTERN_ACCOUNT_ID.match(s) do |m|
40
+ return s.to_i
41
+ end
42
+
41
43
  # If we get until here, we did not match any regex.
42
44
  raise ArgumentError, "#{ s.inspect } is not a supported SteamID."
43
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hive-stalker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Senn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-24 00:00:00.000000000 Z
11
+ date: 2016-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus