sbpanel 0.0.2 → 0.0.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: a4c82849beeed3147b81c1552109eb5cc1777293
4
- data.tar.gz: bea13ff6078706e0b8aeafa62a62e63901d7478e
3
+ metadata.gz: b022058e1c5258ef560dbeb9aa1bbb5a1c354c19
4
+ data.tar.gz: 27f279efc621f9eadf37088f8f732e20adee1f01
5
5
  SHA512:
6
- metadata.gz: 9fd101d9c148f0c0e2fa25c12e4a702bb4d6d1b5e8883c433ed07c800921aeec5c9a32a7ad9fff8b2572196f0ec20b650f34e05f76a6bdbf53fda291257cef10
7
- data.tar.gz: 658532dcc552b67da91869d827dbb7cd8157676e8b978aea7d2c4fc3cd4e17b9816797350d76781d1c2146f0b8b77ce27756278a760aa7253ee8e537eb7dcaa1
6
+ metadata.gz: 845307f847c6bae89fc804c3c7a9d5e500fc98166c510e04a8985390f4da1d8b864b65483b599485ab7910e59104f1b0b73586e310a94850227342a1d6f26de4
7
+ data.tar.gz: 4b14d7c772df25c90db6a8ceeab9fe71cd6069e1313ffa9f39f61751064c2db5ee1ff78151dca4a1eae74debe578733773004f0f5d3ffd2cf9ed186a832aff1f
data/Gemfile.lock ADDED
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sbpanel (0.0.2)
5
+ actionpack
6
+ file-tail
7
+ sinatra
8
+ webrick
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actionpack (4.0.2)
14
+ activesupport (= 4.0.2)
15
+ builder (~> 3.1.0)
16
+ erubis (~> 2.7.0)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ activesupport (4.0.2)
20
+ i18n (~> 0.6, >= 0.6.4)
21
+ minitest (~> 4.2)
22
+ multi_json (~> 1.3)
23
+ thread_safe (~> 0.1)
24
+ tzinfo (~> 0.3.37)
25
+ atomic (1.1.14)
26
+ builder (3.1.4)
27
+ erubis (2.7.0)
28
+ file-tail (1.0.12)
29
+ tins (~> 0.5)
30
+ i18n (0.6.9)
31
+ minitest (4.7.5)
32
+ multi_json (1.8.2)
33
+ rack (1.5.2)
34
+ rack-protection (1.5.1)
35
+ rack
36
+ rack-test (0.6.2)
37
+ rack (>= 1.0)
38
+ sinatra (1.4.4)
39
+ rack (~> 1.4)
40
+ rack-protection (~> 1.4)
41
+ tilt (~> 1.3, >= 1.3.4)
42
+ thread_safe (0.1.3)
43
+ atomic
44
+ tilt (1.4.1)
45
+ tins (0.13.1)
46
+ tzinfo (0.3.38)
47
+ webrick (1.3.1)
48
+
49
+ PLATFORMS
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ sbpanel!
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # sbpanel 0.0.2
1
+ # sbpanel 0.0.3
2
2
 
3
3
  Starbound web status panel! Parses the server debug log to show connected players, active worlds and chat history. Can be observed here: [starbound.mispy.me](http://starbound.mispy.me/)
4
4
 
data/bin/sbpanel CHANGED
@@ -4,25 +4,25 @@ require 'sbpanel'
4
4
  require 'optparse'
5
5
  require 'socket'
6
6
 
7
- options = {
7
+ $options = {
8
8
  bind: "0.0.0.0",
9
9
  port: 8000,
10
10
  address: Socket.gethostname
11
11
  }
12
12
 
13
13
  optparse = OptionParser.new do |opts|
14
- opts.banner = "Usage: sbpanel [options] STARBOUND_LOG_PATH"
14
+ opts.banner = "Usage: sbpanel [$options] STARBOUND_LOG_PATH"
15
15
 
16
- opts.on("-b", "--bind ADDR", "Address to bind [#{options[:bind]}]") do |bind|
17
- options[:bind] = bind
16
+ opts.on("-b", "--bind ADDR", "Address to bind [#{$options[:bind]}]") do |bind|
17
+ $options[:bind] = bind
18
18
  end
19
19
 
20
- opts.on("-p", "--port PORT", "Port to bind [#{options[:port]}]") do |port|
21
- options[:port] = port
20
+ opts.on("-p", "--port PORT", "Port to bind [#{$options[:port]}]") do |port|
21
+ $options[:port] = port
22
22
  end
23
23
 
24
- opts.on("-a", "--address ADDR", "Server address to display [#{options[:address]}]") do |address|
25
- options[:address] = address
24
+ opts.on("-a", "--address ADDR", "Server address to display [#{$options[:address]}]") do |address|
25
+ $options[:address] = address
26
26
  end
27
27
 
28
28
  opts.on('-h', '--help', 'Display this screen') do
@@ -44,30 +44,34 @@ if !File.exists?(ARGV[-1])
44
44
  exit 1
45
45
  end
46
46
 
47
- require 'sinatra'
47
+ require 'sinatra/base'
48
48
 
49
- set :port, options[:port]
50
- set :bind, options[:bind]
51
- set :root, File.join(File.dirname(__FILE__), '..')
49
+ class Panel < Sinatra::Base
50
+ set :port, $options[:port]
51
+ set :bind, $options[:bind]
52
+ set :root, File.join(File.dirname(__FILE__), '..')
52
53
 
53
- game = SBPanel::Game.load(ARGV[0])
54
- game.address = options[:address]
54
+ game = SBPanel::Game.load(ARGV[0])
55
+ game.address = $options[:address]
55
56
 
56
- Thread.new do
57
- begin
58
- game.read_logs
59
- rescue Exception => e
60
- puts e.message
61
- puts e.backtrace.join("\n")
57
+ Thread.new do
58
+ begin
59
+ game.read_logs
60
+ rescue Exception => e
61
+ puts e.message
62
+ puts e.backtrace.join("\n")
63
+ end
62
64
  end
63
- end
64
65
 
65
- helpers ActionView::Helpers::DateHelper
66
+ helpers ActionView::Helpers::DateHelper
66
67
 
67
- get '/' do
68
- game.update_status
69
- game.instance_variables.each do |var|
70
- instance_variable_set var, game.instance_variable_get(var)
68
+ get '/' do
69
+ game.update_status
70
+ game.instance_variables.each do |var|
71
+ instance_variable_set var, game.instance_variable_get(var)
72
+ end
73
+ erb :index
71
74
  end
72
- erb :index
73
75
  end
76
+
77
+ Panel.run!
@@ -1,3 +1,3 @@
1
1
  module SBPanel
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbpanel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaiden Mispy
@@ -76,6 +76,7 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - .gitignore
78
78
  - Gemfile
79
+ - Gemfile.lock
79
80
  - LICENSE
80
81
  - README.md
81
82
  - Rakefile