glowstone 1.0.0 → 1.0.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.
- data/glowstone.gemspec +1 -1
- data/lib/glowstone/server.rb +11 -0
- data/lib/glowstone/version.rb +1 -1
- metadata +2 -2
data/glowstone.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.email = ["me@tomheinan.com"]
|
8
8
|
gem.description = "Glowstone helps shed light on your Minecraft server!"
|
9
9
|
gem.summary = "This tiny gem implements the Gamespy query protocol to access pertinent real-time information hidden away inside your Minecraft server."
|
10
|
-
gem.homepage = "
|
10
|
+
gem.homepage = "https://github.com/tomheinan/glowstone"
|
11
11
|
|
12
12
|
gem.files = `git ls-files`.split($\)
|
13
13
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/glowstone/server.rb
CHANGED
@@ -6,6 +6,7 @@ module Glowstone
|
|
6
6
|
|
7
7
|
attr_reader :host, :port
|
8
8
|
attr_accessor :timeout
|
9
|
+
attr_reader :motd, :gamemode, :version, :plugins, :map_name, :num_players, :max_players, :players
|
9
10
|
|
10
11
|
def initialize(host="localhost", port=25565)
|
11
12
|
@host = host
|
@@ -33,6 +34,16 @@ module Glowstone
|
|
33
34
|
self
|
34
35
|
end
|
35
36
|
|
37
|
+
def to_hash
|
38
|
+
vars_to_skip = ["@timeout", "@socket"]
|
39
|
+
|
40
|
+
hash = Hash.new
|
41
|
+
instance_variables.each do |var|
|
42
|
+
hash[var.to_s.delete("@").to_sym] = instance_variable_get(var) unless vars_to_skip.include?(var.to_s)
|
43
|
+
end
|
44
|
+
hash
|
45
|
+
end
|
46
|
+
|
36
47
|
protected ##################### helper methods and other such shenanigans #
|
37
48
|
|
38
49
|
def get_session_id
|
data/lib/glowstone/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glowstone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -44,7 +44,7 @@ files:
|
|
44
44
|
- lib/glowstone/packets.rb
|
45
45
|
- lib/glowstone/server.rb
|
46
46
|
- lib/glowstone/version.rb
|
47
|
-
homepage:
|
47
|
+
homepage: https://github.com/tomheinan/glowstone
|
48
48
|
licenses: []
|
49
49
|
post_install_message:
|
50
50
|
rdoc_options: []
|