steam-id 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +71 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/steam/id.rb +29 -0
- data/lib/steam/id/base.rb +70 -0
- data/lib/steam/id/community_id.rb +19 -0
- data/lib/steam/id/steam2_id.rb +34 -0
- data/lib/steam/id/steam2_id_parser.rb +34 -0
- data/lib/steam/id/steam2_printer.rb +39 -0
- data/lib/steam/id/steam3_id.rb +29 -0
- data/lib/steam/id/steam3_id_parser.rb +53 -0
- data/lib/steam/id/steam3_printer.rb +32 -0
- data/lib/steam/id/struct.rb +91 -0
- data/lib/steam/id/version.rb +6 -0
- data/steam-id.gemspec +29 -0
- metadata +123 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8a6cf18a2204410c6772f50957b7c1b7617c288c
|
4
|
+
data.tar.gz: 4acc1ac662cf695c80bef760e06d471643f1cfc3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c60c39a114cd46046b03e6b98725f8dfa2fec2faff33722550b1890a72462bc4af9ab351577f355e0554797fb8c3b25103e10eb71b22004481402542d2083ea6
|
7
|
+
data.tar.gz: 2bab90e6d37b0ec067eec2c6ff4bbfbb5a59a52af68eb80c4659fd7bbd03fe7c1caefa0a121c408d878abfd56469ec21b39aaf3c4b3cd7a3d498d135f4f2e27c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# Id
|
2
|
+
[![Build Status](https://travis-ci.org/fastpeek/steam-id.svg?branch=master)](https://travis-ci.org/fastpeek/steam-id)
|
3
|
+
![Gem Version](https://img.shields.io/gem/v/steam-id.svg)
|
4
|
+
|
5
|
+
Valve's SteamId data type in Ruby.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'steam-id'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install steam-id
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
# Create from Community Id
|
27
|
+
id = CommunityId.parse(76561197998193728)
|
28
|
+
|
29
|
+
# Create from a Steam2 Id
|
30
|
+
id = Steam2Id.parse('STEAM_0:0:18964000')
|
31
|
+
|
32
|
+
# Create from a Steam3Id
|
33
|
+
id = Steam3Id.parse('[U:1:37928000]')
|
34
|
+
```
|
35
|
+
|
36
|
+
The `#parse` method returns nil if the parsing fails. Parsing can be a success
|
37
|
+
but the Steam Id can still be invalid. To determine validity of the Steam ID a
|
38
|
+
`#valid?` method is provided.
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
# Create from Community Id
|
42
|
+
id = CommunityId.parse(76561197998193728)
|
43
|
+
id.valid? # => true
|
44
|
+
|
45
|
+
id = Steam2Id.parse('STEAM_0:0:0')
|
46
|
+
id.valid? # => false
|
47
|
+
```
|
48
|
+
|
49
|
+
A `#to_s` and `#to_i` method are also provided for representing the object in
|
50
|
+
String and Integer form. By default `#to_s` returns the Steam2 string
|
51
|
+
representation. A printer class can be passed to `#to_s` to render in different
|
52
|
+
formats. The `#to_i` method returns the 64 bit steam id.
|
53
|
+
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# Create from Community Id
|
57
|
+
id = CommunityId.parse(76561197998193728)
|
58
|
+
id.to_s # => 'STEAM_0:0:18964000'
|
59
|
+
id.to_s(Steam::Id::Steam3Printer) # => '[U:1:37928000]'
|
60
|
+
|
61
|
+
id = Steam2Id.parse('STEAM_0:0:18964000')
|
62
|
+
id.to_i # => 76561197998193728
|
63
|
+
```
|
64
|
+
|
65
|
+
## Limitations
|
66
|
+
|
67
|
+
Steam3 ID support is limited to account types of "Individual"
|
68
|
+
|
69
|
+
## References
|
70
|
+
|
71
|
+
[SteamKit](https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Types/SteamID.cs)
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'steam/id'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/steam/id.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'steamd'
|
2
|
+
Steamd.load_language
|
3
|
+
|
4
|
+
require 'steam/id/version'
|
5
|
+
require 'steam/id/struct'
|
6
|
+
require 'steam/id/base'
|
7
|
+
require 'steam/id/community_id'
|
8
|
+
require 'steam/id/steam2_id'
|
9
|
+
require 'steam/id/steam3_id'
|
10
|
+
require 'steam/id/steam3_id_parser'
|
11
|
+
require 'steam/id/steam2_id_parser'
|
12
|
+
require 'steam/id/steam2_printer'
|
13
|
+
require 'steam/id/steam3_printer'
|
14
|
+
|
15
|
+
# Root Steam namespace
|
16
|
+
module Steam
|
17
|
+
# Represents a Valve Steam Id
|
18
|
+
module Id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Represents a Valve Steam Id in the Community Id format
|
23
|
+
CommunityId = Steam::Id::CommunityId
|
24
|
+
|
25
|
+
# Represents a Valve Steam Id in the Steam2 Id format
|
26
|
+
Steam2Id = Steam::Id::Steam2Id
|
27
|
+
|
28
|
+
# Represents a Valve Steam Id in the Steam3 Id format
|
29
|
+
Steam3Id = Steam::Id::Steam3Id
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
module Steam
|
4
|
+
module Id
|
5
|
+
# Represents a SteamID holds the various parts of the Steam Id an internal
|
6
|
+
# 64bit datastructure
|
7
|
+
class Base
|
8
|
+
extend Forwardable
|
9
|
+
|
10
|
+
# Delegate some getter methods to the internal data struct
|
11
|
+
def_delegators :@struct, :account_id, :account_type, :instance, :universe
|
12
|
+
|
13
|
+
# Delegate some setter methods to the internal data struct
|
14
|
+
def_delegators :@struct, :account_id=,
|
15
|
+
:account_type=, :instance=, :universe=
|
16
|
+
|
17
|
+
attr_reader :struct
|
18
|
+
|
19
|
+
# Create a new Steam ID
|
20
|
+
def initialize(struct = Struct.new)
|
21
|
+
@struct = struct
|
22
|
+
end
|
23
|
+
|
24
|
+
# Return the Steam Id in string format. By default the Steam2 format
|
25
|
+
# is returned
|
26
|
+
#
|
27
|
+
# @param klass [Printer] a steam id printer
|
28
|
+
# @return [String] the steam id in the desired format
|
29
|
+
def to_s(klass = Steam2Printer)
|
30
|
+
printer ||= klass.new(self)
|
31
|
+
printer.print
|
32
|
+
end
|
33
|
+
|
34
|
+
# Return the Steam Id in int format.
|
35
|
+
#
|
36
|
+
# @return [Integer] the steam id in int format
|
37
|
+
def to_i
|
38
|
+
@struct.to_i
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns true if the Steam id is valid
|
42
|
+
#
|
43
|
+
# @return [Bool] true if valid, otherwise false
|
44
|
+
def valid?
|
45
|
+
valid_universe? && valid_account?
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
# @api private
|
51
|
+
def valid_account?
|
52
|
+
return false if account_type <= EAccountType::INVALID ||
|
53
|
+
account_type >= EAccountType::MAX
|
54
|
+
|
55
|
+
if account_type == EAccountType::INDIVIDUAL
|
56
|
+
return false if account_id.zero?
|
57
|
+
end
|
58
|
+
|
59
|
+
true
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
def valid_universe?
|
64
|
+
return false if universe <= EUniverse::INVALID ||
|
65
|
+
universe >= EUniverse::MAX
|
66
|
+
true
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
module Steam
|
3
|
+
module Id
|
4
|
+
# Represents a 64 bit community ID
|
5
|
+
class CommunityId < Base
|
6
|
+
# Parse a community id from an input
|
7
|
+
#
|
8
|
+
# @param id [String, Integer] the input id
|
9
|
+
def self.parse(id)
|
10
|
+
new(id)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Create a community id object
|
14
|
+
def initialize(id)
|
15
|
+
super(Struct.new(id))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
module Steam
|
3
|
+
module Id
|
4
|
+
# Represents a Steam ID in the Steam2 format.
|
5
|
+
class Steam2Id < Base
|
6
|
+
# Parse a Steam2Id from a given input string
|
7
|
+
#
|
8
|
+
# @param id [String] the input string
|
9
|
+
# @return [Steam2Id, nil]
|
10
|
+
def self.parse(id)
|
11
|
+
parser = Steam2IdParser.new(id)
|
12
|
+
parser.parse
|
13
|
+
|
14
|
+
new(parser.universe, parser.account_id, parser.auth_server)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Instantiate a Steam2Id object
|
18
|
+
def initialize(universe, account_id, auth_server)
|
19
|
+
super()
|
20
|
+
self.instance = 1
|
21
|
+
self.universe = universe
|
22
|
+
self.account_type = EAccountType::INDIVIDUAL
|
23
|
+
self.account_id = (account_id << 1) | auth_server
|
24
|
+
end
|
25
|
+
|
26
|
+
# Sets the correct universe for a Steam2Id
|
27
|
+
#
|
28
|
+
# @param universe [Integer] the universe
|
29
|
+
def universe=(universe)
|
30
|
+
struct.universe = universe.zero? ? EUniverse::PUBLIC : universe
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Steam
|
2
|
+
module Id
|
3
|
+
# Parse a steam 2 id string
|
4
|
+
class Steam2IdParser
|
5
|
+
# A Regex representing a valid Steam 2 string
|
6
|
+
# rubocop:disable LineLength
|
7
|
+
STEAM2_REGEX = /STEAM_(?<universe>[0-4]):(?<authserver>[0-1]):(?<accountid>\d+)/
|
8
|
+
|
9
|
+
attr_reader :universe, :account_id, :auth_server
|
10
|
+
|
11
|
+
def initialize(id)
|
12
|
+
@id = id.to_s
|
13
|
+
@universe = EUniverse::INVALID
|
14
|
+
@account_id = 0
|
15
|
+
@auth_server = 0
|
16
|
+
end
|
17
|
+
|
18
|
+
# Parse a Steam2Id from a given input string
|
19
|
+
def parse
|
20
|
+
return unless matches
|
21
|
+
@universe = Integer(matches['universe'])
|
22
|
+
@account_id = Integer(matches['accountid'])
|
23
|
+
@auth_server = Integer(matches['authserver'])
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
# @api private
|
29
|
+
def matches
|
30
|
+
@matches ||= @id.match(STEAM2_REGEX)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Steam
|
2
|
+
module Id
|
3
|
+
# Prints a given Steam::Id in the Steam2 format
|
4
|
+
class Steam2Printer
|
5
|
+
attr_reader :base
|
6
|
+
|
7
|
+
# Creates a new instance of the Steam2Printer
|
8
|
+
def initialize(base)
|
9
|
+
@base = base
|
10
|
+
end
|
11
|
+
|
12
|
+
# Prints the String
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
def print
|
16
|
+
"STEAM_#{universe_digit}:#{account_id & 1}:#{account_id >> 1}"
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# Gives the real digit represented by the universe
|
22
|
+
#
|
23
|
+
# @return [Integer] the universe digit
|
24
|
+
def universe_digit
|
25
|
+
universe <= EUniverse::PUBLIC ? 0 : universe
|
26
|
+
end
|
27
|
+
|
28
|
+
# @api private
|
29
|
+
def universe
|
30
|
+
base.universe
|
31
|
+
end
|
32
|
+
|
33
|
+
# @api private
|
34
|
+
def account_id
|
35
|
+
base.account_id
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
module Steam
|
3
|
+
module Id
|
4
|
+
# Represents a Valve Steam Id in the Steam3 format.
|
5
|
+
#
|
6
|
+
# @note Only individual accounts are supported
|
7
|
+
class Steam3Id < Base
|
8
|
+
# Create a Steam3 id by parsing an input string
|
9
|
+
#
|
10
|
+
# @param id [String] the input id
|
11
|
+
def self.parse(id)
|
12
|
+
parser = Steam3IdParser.new(id)
|
13
|
+
parser.parse
|
14
|
+
|
15
|
+
new(parser.universe, parser.instance,
|
16
|
+
parser.account_id, parser.type)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Instantiate a Steam3 id
|
20
|
+
def initialize(universe, instance, account_id, account_type)
|
21
|
+
super()
|
22
|
+
self.universe = universe
|
23
|
+
self.instance = instance
|
24
|
+
self.account_id = account_id
|
25
|
+
self.account_type = account_type
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Steam
|
2
|
+
module Id
|
3
|
+
# Parse a steam 3 id string
|
4
|
+
class Steam3IdParser
|
5
|
+
# A Regex representing a valid Steam 3 string
|
6
|
+
# rubocop:disable LineLength
|
7
|
+
STEAM3_REGEX = /\[(?<type>[AGMPCgcLTIUai]):(?<universe>[0-4]):(?<account>\d+)(:(?<instance>\d+))?\]/
|
8
|
+
|
9
|
+
attr_reader :account_id
|
10
|
+
attr_reader :universe
|
11
|
+
attr_reader :type
|
12
|
+
|
13
|
+
def initialize(id)
|
14
|
+
@id = id.to_s
|
15
|
+
@type = nil
|
16
|
+
@account_id = 0
|
17
|
+
@universe = EUniverse::INVALID
|
18
|
+
@type = 'U'
|
19
|
+
end
|
20
|
+
|
21
|
+
# Create a Steam3 id by parsing an input string
|
22
|
+
def parse
|
23
|
+
return unless matches
|
24
|
+
|
25
|
+
@account_id = Integer(matches['account'])
|
26
|
+
@universe = Integer(matches['universe'])
|
27
|
+
@type = matches['type']
|
28
|
+
end
|
29
|
+
|
30
|
+
# The instance of the account. Currently only instance 1 is supported
|
31
|
+
def instance
|
32
|
+
1
|
33
|
+
end
|
34
|
+
|
35
|
+
# The type of account as an integer
|
36
|
+
def type
|
37
|
+
case @type
|
38
|
+
when 'U'
|
39
|
+
EAccountType::INDIVIDUAL
|
40
|
+
else
|
41
|
+
EAccountType::INVALID
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
# @api private
|
48
|
+
def matches
|
49
|
+
@matches ||= @id.match(STEAM3_REGEX)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Steam
|
2
|
+
module Id
|
3
|
+
# Prints a Steam::Id in the Steam 3 format
|
4
|
+
class Steam3Printer
|
5
|
+
attr_reader :base
|
6
|
+
|
7
|
+
# Creates a new Steam3Printer object
|
8
|
+
def initialize(base)
|
9
|
+
@base = base
|
10
|
+
end
|
11
|
+
|
12
|
+
# Prints the Steam::Id in Steam3 format.
|
13
|
+
#
|
14
|
+
# @note Only Individual account types are supported
|
15
|
+
def print
|
16
|
+
"[U:#{instance}:#{account_id}]"
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# @api private
|
22
|
+
def instance
|
23
|
+
base.instance
|
24
|
+
end
|
25
|
+
|
26
|
+
# @api private
|
27
|
+
def account_id
|
28
|
+
base.account_id
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
module Steam
|
2
|
+
module Id
|
3
|
+
# The internal datastructure of a steamid. A 64 bit integer
|
4
|
+
class Struct
|
5
|
+
attr_reader :data
|
6
|
+
|
7
|
+
# The bit mask applied to get the account id
|
8
|
+
ACCOUNT_ID_MASK = 0xFFFFFFFF
|
9
|
+
|
10
|
+
# The bit mask applied to get the instance mask
|
11
|
+
INSTANCE_MASK = 0xFFFFF
|
12
|
+
|
13
|
+
# The bit mask applied to get the universe mask
|
14
|
+
UNIVERSE_MASK = 0xFF
|
15
|
+
|
16
|
+
# The bit mask applied to get the account type
|
17
|
+
ACCOUNT_TYPE_MASK = 0xF
|
18
|
+
|
19
|
+
def initialize(data = 0)
|
20
|
+
@data = data.to_i
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns the internal integer
|
24
|
+
def to_i
|
25
|
+
@data.to_i
|
26
|
+
end
|
27
|
+
|
28
|
+
# Gets the account id
|
29
|
+
#
|
30
|
+
# @return [Integer] the account id
|
31
|
+
def account_id
|
32
|
+
get(0, ACCOUNT_ID_MASK)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Sets the account_id
|
36
|
+
#
|
37
|
+
# @return [Integer] the account id
|
38
|
+
def account_id=(value)
|
39
|
+
set(0, ACCOUNT_ID_MASK, value)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Gets the instance
|
43
|
+
#
|
44
|
+
# @return [Integer] the account id
|
45
|
+
def instance
|
46
|
+
get(32, INSTANCE_MASK)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Sets the instance
|
50
|
+
def instance=(value)
|
51
|
+
set(32, INSTANCE_MASK, value)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Gets the account type
|
55
|
+
#
|
56
|
+
# @return [Integer] the account type
|
57
|
+
def account_type
|
58
|
+
get(52, ACCOUNT_TYPE_MASK)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Sets the account type
|
62
|
+
def account_type=(value)
|
63
|
+
set(52, ACCOUNT_TYPE_MASK, value)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Gets the universe
|
67
|
+
#
|
68
|
+
# @return [Integer] the universe
|
69
|
+
def universe
|
70
|
+
get(56, UNIVERSE_MASK)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Sets the universe
|
74
|
+
def universe=(value)
|
75
|
+
set(56, UNIVERSE_MASK, value)
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
# @api private
|
81
|
+
def get(offset, mask)
|
82
|
+
(@data >> offset) & mask
|
83
|
+
end
|
84
|
+
|
85
|
+
# @api private
|
86
|
+
def set(offset, mask, value)
|
87
|
+
@data = (@data & ~(mask << offset)) | ((value & mask) << offset)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
data/steam-id.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'steam/id/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'steam-id'
|
8
|
+
spec.version = Steam::Id::VERSION
|
9
|
+
spec.authors = ['Taylor Finnell']
|
10
|
+
spec.email = ['tmfinnell@gmail.com']
|
11
|
+
spec.license = 'MIT'
|
12
|
+
|
13
|
+
spec.summary = 'Steam IDs in Ruby.'
|
14
|
+
spec.description = 'Steam IDs in Ruby.'
|
15
|
+
spec.homepage = 'https://github.com/fastpeek/steam-id'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = 'bin'
|
21
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_dependency 'steamd', '~> 0.1'
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: steam-id
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Taylor Finnell
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: steamd
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
description: Steam IDs in Ruby.
|
70
|
+
email:
|
71
|
+
- tmfinnell@gmail.com
|
72
|
+
executables:
|
73
|
+
- console
|
74
|
+
- setup
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".gitignore"
|
79
|
+
- ".rspec"
|
80
|
+
- ".travis.yml"
|
81
|
+
- Gemfile
|
82
|
+
- LICENSE
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- bin/console
|
86
|
+
- bin/setup
|
87
|
+
- lib/steam/id.rb
|
88
|
+
- lib/steam/id/base.rb
|
89
|
+
- lib/steam/id/community_id.rb
|
90
|
+
- lib/steam/id/steam2_id.rb
|
91
|
+
- lib/steam/id/steam2_id_parser.rb
|
92
|
+
- lib/steam/id/steam2_printer.rb
|
93
|
+
- lib/steam/id/steam3_id.rb
|
94
|
+
- lib/steam/id/steam3_id_parser.rb
|
95
|
+
- lib/steam/id/steam3_printer.rb
|
96
|
+
- lib/steam/id/struct.rb
|
97
|
+
- lib/steam/id/version.rb
|
98
|
+
- steam-id.gemspec
|
99
|
+
homepage: https://github.com/fastpeek/steam-id
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata: {}
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.5.1
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Steam IDs in Ruby.
|
123
|
+
test_files: []
|