steam-condenser 0.14.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +22 -0
  3. data/LICENSE +1 -1
  4. data/README.md +14 -6
  5. data/Rakefile +35 -0
  6. data/lib/{stringio_additions.rb → core_ext/stringio.rb} +1 -1
  7. data/lib/{exceptions/packet_format_exception.rb → errors/packet_format_error.rb} +5 -5
  8. data/lib/{exceptions/rcon_ban_exception.rb → errors/rcon_ban_error.rb} +5 -5
  9. data/lib/{exceptions/rcon_no_auth_exception.rb → errors/rcon_no_auth_error.rb} +5 -5
  10. data/lib/{exceptions/steam_condenser_exception.rb → errors/steam_condenser_error.rb} +3 -3
  11. data/lib/errors/timeout_error.rb +28 -0
  12. data/lib/{exceptions/web_api_exception.rb → errors/web_api_error.rb} +8 -8
  13. data/lib/steam/community/alien_swarm/alien_swarm_mission.rb +86 -11
  14. data/lib/steam/community/alien_swarm/alien_swarm_stats.rb +38 -15
  15. data/lib/steam/community/alien_swarm/alien_swarm_weapon.rb +29 -8
  16. data/lib/steam/community/app_news.rb +91 -27
  17. data/lib/steam/community/cacheable.rb +65 -21
  18. data/lib/steam/community/css/css_map.rb +39 -9
  19. data/lib/steam/community/css/css_stats.rb +32 -12
  20. data/lib/steam/community/css/css_weapon.rb +46 -10
  21. data/lib/steam/community/defense_grid/defense_grid_stats.rb +129 -17
  22. data/lib/steam/community/dods/dods_class.rb +66 -10
  23. data/lib/steam/community/dods/dods_stats.rb +20 -7
  24. data/lib/steam/community/dods/dods_weapon.rb +35 -24
  25. data/lib/steam/community/game_achievement.rb +50 -19
  26. data/lib/steam/community/game_class.rb +16 -5
  27. data/lib/steam/community/game_inventory.rb +37 -4
  28. data/lib/steam/community/game_item.rb +64 -3
  29. data/lib/steam/community/game_stats.rb +81 -16
  30. data/lib/steam/community/game_weapon.rb +29 -11
  31. data/lib/steam/community/l4d/abstract_l4d_stats.rb +91 -65
  32. data/lib/steam/community/l4d/abstract_l4d_weapon.rb +38 -8
  33. data/lib/steam/community/l4d/l4d2_map.rb +30 -5
  34. data/lib/steam/community/l4d/l4d2_stats.rb +83 -45
  35. data/lib/steam/community/l4d/l4d2_weapon.rb +20 -6
  36. data/lib/steam/community/l4d/l4d_explosive.rb +13 -5
  37. data/lib/steam/community/l4d/l4d_map.rb +35 -7
  38. data/lib/steam/community/l4d/l4d_stats.rb +23 -10
  39. data/lib/steam/community/l4d/l4d_weapon.rb +11 -7
  40. data/lib/steam/community/portal2/portal2_inventory.rb +4 -0
  41. data/lib/steam/community/portal2/portal2_item.rb +13 -1
  42. data/lib/steam/community/portal2/portal2_stats.rb +10 -6
  43. data/lib/steam/community/steam_game.rb +74 -0
  44. data/lib/steam/community/steam_group.rb +48 -14
  45. data/lib/steam/community/steam_id.rb +295 -64
  46. data/lib/steam/community/tf2/tf2_class.rb +66 -7
  47. data/lib/steam/community/tf2/tf2_class_factory.rb +14 -7
  48. data/lib/steam/community/tf2/tf2_engineer.rb +26 -6
  49. data/lib/steam/community/tf2/tf2_golden_wrench.rb +37 -10
  50. data/lib/steam/community/tf2/tf2_inventory.rb +4 -0
  51. data/lib/steam/community/tf2/tf2_item.rb +13 -1
  52. data/lib/steam/community/tf2/tf2_medic.rb +20 -5
  53. data/lib/steam/community/tf2/tf2_sniper.rb +15 -5
  54. data/lib/steam/community/tf2/tf2_spy.rb +20 -6
  55. data/lib/steam/community/tf2/tf2_stats.rb +20 -6
  56. data/lib/steam/community/web_api.rb +50 -32
  57. data/lib/steam/packets/c2m_checkmd5_packet.rb +1 -1
  58. data/lib/steam/packets/m2a_server_batch_packet.rb +3 -2
  59. data/lib/steam/packets/m2s_requestrestart_packet.rb +3 -3
  60. data/lib/steam/packets/rcon/rcon_packet_factory.rb +4 -4
  61. data/lib/steam/packets/request_with_challenge.rb +1 -1
  62. data/lib/steam/packets/s2a_info_base_packet.rb +1 -1
  63. data/lib/steam/packets/s2a_info_detailed_packet.rb +10 -10
  64. data/lib/steam/packets/s2a_player_packet.rb +5 -1
  65. data/lib/steam/packets/s2a_rules_packet.rb +4 -3
  66. data/lib/steam/packets/s2m_heartbeat2_packet.rb +2 -2
  67. data/lib/steam/packets/steam_packet.rb +1 -1
  68. data/lib/steam/packets/steam_packet_factory.rb +12 -16
  69. data/lib/steam/servers/game_server.rb +38 -32
  70. data/lib/steam/servers/goldsrc_server.rb +10 -1
  71. data/lib/steam/servers/master_server.rb +42 -21
  72. data/lib/steam/servers/server.rb +4 -5
  73. data/lib/steam/servers/source_server.rb +20 -5
  74. data/lib/steam/sockets/goldsrc_socket.rb +53 -22
  75. data/lib/steam/sockets/master_server_socket.rb +14 -4
  76. data/lib/steam/sockets/rcon_socket.rb +39 -6
  77. data/lib/steam/sockets/source_socket.rb +19 -15
  78. data/lib/steam/sockets/steam_socket.rb +33 -23
  79. data/lib/steam/steam_player.rb +86 -11
  80. data/lib/steam-condenser/community.rb +24 -24
  81. data/lib/steam-condenser/servers.rb +2 -2
  82. data/lib/steam-condenser/version.rb +3 -3
  83. data/steam-condenser.gemspec +23 -0
  84. data/test/query_tests.rb +12 -12
  85. data/test/rcon_tests.rb +3 -3
  86. data/test/steam/communtiy/steam_community_test_suite.rb +12 -0
  87. data/test/steam/communtiy/steam_group_tests.rb +6 -5
  88. data/test/steam/communtiy/steam_id_tests.rb +6 -5
  89. data/test/steam_community_tests.rb +3 -3
  90. data/test/stringio_additions_tests.rb +7 -7
  91. metadata +61 -43
  92. data/lib/exceptions/timeout_exception.rb +0 -24
  93. data/test/datagram_channel_tests.rb +0 -42
  94. data/test/socket_channel_tests.rb +0 -43
data/test/rcon_tests.rb CHANGED
@@ -1,7 +1,7 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
1
+ # This code is free software; you can redistribute it and/or modify it under
2
+ # the terms of the new BSD License.
3
3
  #
4
- # Copyright (c) 2008-2010, Sebastian Staudt
4
+ # Copyright (c) 2008-2011, Sebastian Staudt
5
5
 
6
6
  require 'ipaddr'
7
7
  require 'test/unit'
@@ -0,0 +1,12 @@
1
+ # This code is free software; you can redistribute it and/or modify it under
2
+ # the terms of the new BSD License.
3
+ #
4
+ # Copyright (c) 2009-2011, Sebastian Staudt
5
+
6
+ require 'test/unit'
7
+
8
+ suite_dir = File.dirname(__FILE__)
9
+ $LOAD_PATH.unshift(suite_dir) unless $LOAD_PATH.include?(suite_dir)
10
+
11
+ require 'steam_group_tests'
12
+ require 'steam_id_tests'
@@ -1,12 +1,13 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
1
+ # This code is free software; you can redistribute it and/or modify it under
2
+ # the terms of the new BSD License.
3
3
  #
4
- # Copyright (c) 2009, Sebastian Staudt
4
+ # Copyright (c) 2009-2011, Sebastian Staudt
5
5
 
6
6
  $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
7
7
 
8
- require "steam/community/steam_group"
9
- require "test/unit"
8
+ require 'test/unit'
9
+
10
+ require 'steam/community/steam_group'
10
11
 
11
12
  class SteamGroupTests < Test::Unit::TestCase
12
13
 
@@ -1,12 +1,13 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
1
+ # This code is free software; you can redistribute it and/or modify it under
2
+ # the terms of the new BSD License.
3
3
  #
4
- # Copyright (c) 2009, Sebastian Staudt
4
+ # Copyright (c) 2009-2011, Sebastian Staudt
5
5
 
6
6
  $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
7
7
 
8
- require "steam/community/steam_id"
9
- require "test/unit"
8
+ require 'test/unit'
9
+
10
+ require 'steam/community/steam_id'
10
11
 
11
12
  class SteamIdTests < Test::Unit::TestCase
12
13
 
@@ -1,7 +1,7 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
1
+ # This code is free software; you can redistribute it and/or modify it under
2
+ # the terms of the new BSD License.
3
3
  #
4
- # Copyright (c) 2008-2009, Sebastian Staudt
4
+ # Copyright (c) 2008-2011, Sebastian Staudt
5
5
 
6
6
  require 'test/unit'
7
7
 
@@ -1,18 +1,18 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
1
+ # This code is free software; you can redistribute it and/or modify it under
2
+ # the terms of the new BSD License.
3
3
  #
4
- # Copyright (c) 2009-2010, Sebastian Staudt
4
+ # Copyright (c) 2009-2011, Sebastian Staudt
5
5
 
6
6
  require 'test/unit'
7
7
 
8
8
  $:.push File.join(File.dirname(__FILE__), '..', 'lib')
9
9
 
10
- require 'stringio_additions'
10
+ require 'core_ext/stringio'
11
11
 
12
- class StringIOAdditionsTests < Test::Unit::TestCase
12
+ class StringIOTests < Test::Unit::TestCase
13
13
 
14
14
  def test_allocate
15
- buffer = StringIO.allocate(10)
15
+ buffer = StringIO.alloc 10
16
16
  assert_equal("\0" * 10, buffer.string)
17
17
  end
18
18
 
@@ -56,7 +56,7 @@ class StringIOAdditionsTests < Test::Unit::TestCase
56
56
  buffer = StringIO.new('te')
57
57
  buffer.write('st')
58
58
  assert_equal('st', buffer.string)
59
- buffer = StringIO.allocate(4)
59
+ buffer = StringIO.alloc 4
60
60
  buffer.write('test')
61
61
  assert_equal('test', buffer.string)
62
62
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steam-condenser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 39
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 14
9
- - 0
10
- version: 0.14.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sebastian Staudt
@@ -15,12 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-01 00:00:00 Z
18
+ date: 2011-08-23 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: bzip2-ruby
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
26
24
  - - ~>
@@ -31,40 +29,58 @@ dependencies:
31
29
  - 2
32
30
  - 7
33
31
  version: 0.2.7
32
+ name: bzip2-ruby
33
+ prerelease: false
34
34
  type: :runtime
35
- version_requirements: *id001
35
+ requirement: *id001
36
36
  - !ruby/object:Gem::Dependency
37
- name: json
38
- prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
38
  none: false
41
39
  requirements:
42
40
  - - ~>
43
41
  - !ruby/object:Gem::Version
44
- hash: 1
42
+ hash: 17
45
43
  segments:
46
44
  - 1
47
- - 5
48
- - 1
49
- version: 1.5.1
45
+ - 0
46
+ - 3
47
+ version: 1.0.3
48
+ name: multi_json
49
+ prerelease: false
50
50
  type: :runtime
51
- version_requirements: *id002
51
+ requirement: *id002
52
52
  - !ruby/object:Gem::Dependency
53
- name: ore-tasks
54
- prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
56
54
  none: false
57
55
  requirements:
58
56
  - - ~>
59
57
  - !ruby/object:Gem::Version
60
- hash: 19
58
+ hash: 63
61
59
  segments:
62
60
  - 0
63
- - 3
61
+ - 9
62
+ - 2
63
+ version: 0.9.2
64
+ name: rake
65
+ prerelease: false
66
+ type: :development
67
+ requirement: *id003
68
+ - !ruby/object:Gem::Dependency
69
+ version_requirements: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ hash: 7
75
+ segments:
64
76
  - 0
65
- version: 0.3.0
77
+ - 7
78
+ - 2
79
+ version: 0.7.2
80
+ name: yard
81
+ prerelease: false
66
82
  type: :development
67
- version_requirements: *id003
83
+ requirement: *id004
68
84
  description: A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
69
85
  email:
70
86
  - koraktor@gmail.com
@@ -72,16 +88,18 @@ executables: []
72
88
 
73
89
  extensions: []
74
90
 
75
- extra_rdoc_files:
76
- - LICENSE
77
- - README.md
91
+ extra_rdoc_files: []
92
+
78
93
  files:
79
- - lib/exceptions/packet_format_exception.rb
80
- - lib/exceptions/rcon_ban_exception.rb
81
- - lib/exceptions/rcon_no_auth_exception.rb
82
- - lib/exceptions/steam_condenser_exception.rb
83
- - lib/exceptions/timeout_exception.rb
84
- - lib/exceptions/web_api_exception.rb
94
+ - Gemfile
95
+ - Gemfile.lock
96
+ - lib/core_ext/stringio.rb
97
+ - lib/errors/packet_format_error.rb
98
+ - lib/errors/rcon_ban_error.rb
99
+ - lib/errors/rcon_no_auth_error.rb
100
+ - lib/errors/steam_condenser_error.rb
101
+ - lib/errors/timeout_error.rb
102
+ - lib/errors/web_api_error.rb
85
103
  - lib/steam/community/alien_swarm/alien_swarm_mission.rb
86
104
  - lib/steam/community/alien_swarm/alien_swarm_stats.rb
87
105
  - lib/steam/community/alien_swarm/alien_swarm_weapon.rb
@@ -112,6 +130,7 @@ files:
112
130
  - lib/steam/community/portal2/portal2_inventory.rb
113
131
  - lib/steam/community/portal2/portal2_item.rb
114
132
  - lib/steam/community/portal2/portal2_stats.rb
133
+ - lib/steam/community/steam_game.rb
115
134
  - lib/steam/community/steam_group.rb
116
135
  - lib/steam/community/steam_id.rb
117
136
  - lib/steam/community/tf2/tf2_class.rb
@@ -169,20 +188,20 @@ files:
169
188
  - lib/steam-condenser/servers.rb
170
189
  - lib/steam-condenser/version.rb
171
190
  - lib/steam-condenser.rb
172
- - lib/stringio_additions.rb
173
191
  - LICENSE
192
+ - Rakefile
174
193
  - README.md
175
- - test/datagram_channel_tests.rb
194
+ - steam-condenser.gemspec
176
195
  - test/query_tests.rb
177
196
  - test/rcon_tests.rb
178
- - test/socket_channel_tests.rb
197
+ - test/steam/communtiy/steam_community_test_suite.rb
179
198
  - test/steam/communtiy/steam_group_tests.rb
180
199
  - test/steam/communtiy/steam_id_tests.rb
181
200
  - test/steam_community_tests.rb
182
201
  - test/stringio_additions_tests.rb
183
- homepage: http://koraktor.github.com/steam-condenser
184
- licenses:
185
- - BSD
202
+ homepage: http://koraktor.de/steam-condenser
203
+ licenses: []
204
+
186
205
  post_install_message:
187
206
  rdoc_options: []
188
207
 
@@ -208,16 +227,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
227
  version: "0"
209
228
  requirements: []
210
229
 
211
- rubyforge_project: steam-condenser
212
- rubygems_version: 1.8.5
230
+ rubyforge_project:
231
+ rubygems_version: 1.8.8
213
232
  signing_key:
214
233
  specification_version: 3
215
234
  summary: Steam Condenser - A Steam query library
216
235
  test_files:
217
- - test/datagram_channel_tests.rb
218
236
  - test/query_tests.rb
219
237
  - test/rcon_tests.rb
220
- - test/socket_channel_tests.rb
238
+ - test/steam/communtiy/steam_community_test_suite.rb
221
239
  - test/steam/communtiy/steam_group_tests.rb
222
240
  - test/steam/communtiy/steam_id_tests.rb
223
241
  - test/steam_community_tests.rb
@@ -1,24 +0,0 @@
1
- # This code is free software; you can redistribute it and/or modify it under
2
- # the terms of the new BSD License.
3
- #
4
- # Copyright (c) 2008-2011, Sebastian Staudt
5
-
6
- require 'exceptions/steam_condenser_exception'
7
-
8
- # This exception class indicates that an operation could not be finished within
9
- # a reasonable amount of time
10
- #
11
- # This usually indicates that a server could not be contacted because of
12
- # network problems.
13
- #
14
- # @author Sebastian Staudt
15
- # @note {SteamSocket.timeout=} allows to set a custom timeout for socket
16
- # operations
17
- class TimeoutException < SteamCondenserException
18
-
19
- # Creates a new `TimeoutException` instance
20
- def initialize
21
- super 'The operation timed out.'
22
- end
23
-
24
- end
@@ -1,42 +0,0 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
3
- #
4
- # Copyright (c) 2009-2010, Sebastian Staudt
5
-
6
- require 'test/unit'
7
-
8
- $:.push File.join(File.dirname(__FILE__), '..', 'lib')
9
-
10
- require 'datagram_channel'
11
- require 'stringio_additions'
12
-
13
- class DatagramChannelTests < Test::Unit::TestCase
14
-
15
- def test_read_write
16
- port = rand(65536 - 1024) + 1024
17
-
18
- socket = UDPSocket.new
19
- socket.bind('localhost', port)
20
-
21
- channel = DatagramChannel.open
22
- channel.connect('localhost', port)
23
-
24
- string = 'test'
25
-
26
- buffer = StringIO.new string
27
- channel.write(buffer)
28
- sent, socket_addr = socket.recvfrom(4)
29
- socket.send(string, 0, 'localhost', socket_addr[1])
30
- buffer = StringIO.allocate 4
31
- channel.read(buffer)
32
-
33
- channel.close
34
- socket.close
35
-
36
- received = buffer.string
37
-
38
- assert_equal(string, sent)
39
- assert_equal(string, received)
40
- end
41
-
42
- end
@@ -1,43 +0,0 @@
1
- # This code is free software; you can redistribute it and/or modify it under the
2
- # terms of the new BSD License.
3
- #
4
- # Copyright (c) 2009-2010, Sebastian Staudt
5
-
6
- $:.push File.join(File.dirname(__FILE__), '..', 'lib')
7
-
8
- require 'test/unit'
9
-
10
- require 'stringio_additions'
11
- require 'socket_channel'
12
-
13
- class SocketChannelTests < Test::Unit::TestCase
14
-
15
- def test_read_write
16
- port = rand(65536 - 1024) + 1024
17
-
18
- server = TCPServer.new('localhost', port)
19
-
20
- channel = SocketChannel.open
21
- channel.connect Socket.getaddrinfo('localhost', port)
22
-
23
- socket= server.accept
24
-
25
- string = 'test'
26
-
27
- buffer = StringIO.new string
28
- channel.write(buffer)
29
- sent, socket_addr = socket.recvfrom(4)
30
- socket.send(string, 0)
31
- buffer = StringIO.allocate 4
32
- channel.read(buffer)
33
-
34
- channel.close
35
- socket.close
36
-
37
- received = buffer.string
38
-
39
- assert_equal(string, sent)
40
- assert_equal(string, received)
41
- end
42
-
43
- end