rblock 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.
- data/README.md +8 -0
- data/bin/rblock +31 -18
- metadata +2 -2
data/README.md
CHANGED
@@ -8,6 +8,7 @@ Make sure your server has the following installed:
|
|
8
8
|
|
9
9
|
* GNU screen
|
10
10
|
* Java
|
11
|
+
* Ruby 1.9
|
11
12
|
|
12
13
|
In your console, type:
|
13
14
|
|
@@ -43,3 +44,10 @@ Rblock will start your server. Yup! It's that simple.
|
|
43
44
|
* duplicate servers
|
44
45
|
* template servers
|
45
46
|
* extend with bots and extensions
|
47
|
+
|
48
|
+
# Version History
|
49
|
+
|
50
|
+
## 0.0.3
|
51
|
+
|
52
|
+
* Added --directory flag to most commands
|
53
|
+
* Fixed some bugs regarding the creation of blogs
|
data/bin/rblock
CHANGED
@@ -9,6 +9,7 @@ require_relative '../lib/rblock.rb'
|
|
9
9
|
SUB_COMMANDS = %w(new start stop say console install mv)
|
10
10
|
$global_opts = Trollop::options do
|
11
11
|
banner "rblock: #{Rblock::tagline}"
|
12
|
+
opt :force, "force"
|
12
13
|
stop_on SUB_COMMANDS
|
13
14
|
end
|
14
15
|
|
@@ -16,31 +17,41 @@ $cmd = ARGV.shift # get the subcommand
|
|
16
17
|
$cmd_opts = case $cmd
|
17
18
|
when "install" # parse new options
|
18
19
|
Trollop::options do
|
19
|
-
banner
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
banner <<-EOS
|
21
|
+
Installs minecraft servers.
|
22
|
+
|
23
|
+
Usage:
|
24
|
+
rblock install [options] <server directory>
|
25
|
+
where [options] are:
|
26
|
+
EOS
|
27
|
+
opt :beta, "use beta version of bukkit"
|
28
|
+
opt :bukkit, "bukkit file", :type => :string, :default => nil
|
23
29
|
"Options are official, beta, bukkit, bukkit-beta, or a version number."
|
24
30
|
end
|
25
31
|
when "start" # parse start options
|
26
32
|
Trollop::options do
|
27
|
-
banner "usage: rblock start"
|
33
|
+
banner "usage: rblock start [options]"
|
28
34
|
banner ''
|
35
|
+
opt :directory, "directory", :type => :string, :default => "."
|
36
|
+
opt :instant, "instant"
|
29
37
|
end
|
30
38
|
when "stop" # parse stop options
|
31
39
|
Trollop::options do
|
32
|
-
banner "usage: rblock stop"
|
40
|
+
banner "usage: rblock stop [options]"
|
33
41
|
banner ''
|
42
|
+
opt :directory, "directory", :type => :string, :default => "."
|
34
43
|
end
|
35
44
|
when "console" # parse console options
|
36
45
|
Trollop::options do
|
37
|
-
banner "usage: rblock console"
|
46
|
+
banner "usage: rblock console [options]"
|
38
47
|
banner ''
|
48
|
+
opt :directory, "directory", :type => :string, :default => "."
|
39
49
|
end
|
40
50
|
when "say" # parse say options
|
41
51
|
Trollop::options do
|
42
|
-
banner "usage: rblock say"
|
52
|
+
banner "usage: rblock say <message>"
|
43
53
|
banner ''
|
54
|
+
opt :directory, "directory", :type => :string, :default => "."
|
44
55
|
end
|
45
56
|
when nil
|
46
57
|
puts "rblock: minecraft server management"
|
@@ -60,16 +71,19 @@ def confirm(action)
|
|
60
71
|
end
|
61
72
|
end
|
62
73
|
|
74
|
+
# is there a server directory specified? If so, cd to that
|
75
|
+
if defined? $cmd_opts[:directory]
|
76
|
+
Dir.chdir($cmd_opts[:directory])
|
77
|
+
end
|
78
|
+
|
63
79
|
case $cmd
|
64
80
|
when "install"
|
65
81
|
if ARGV[0] == nil
|
66
82
|
Trollop::die "no server name specified"
|
67
83
|
else
|
68
|
-
server_path = ARGV[0]
|
84
|
+
server_path = ARGV[0]
|
69
85
|
end
|
70
86
|
|
71
|
-
# if multifolder file path, server name is just last bit
|
72
|
-
server_name = server_path.last
|
73
87
|
|
74
88
|
puts "Checking dependencies..."
|
75
89
|
|
@@ -87,15 +101,14 @@ when "install"
|
|
87
101
|
puts "\nCreating server directory..."
|
88
102
|
|
89
103
|
# make the server directory
|
104
|
+
# mkdir_p creates all the intermediate folders, if specified
|
105
|
+
FileUtils.mkdir_p server_path
|
90
106
|
|
91
|
-
server_path.each_with_index do |value, i|
|
92
|
-
begin
|
93
|
-
Dir.mkdir server_path[0..i].join('/')
|
94
|
-
rescue Errno::EEXIST
|
95
|
-
end
|
96
|
-
end
|
97
107
|
|
98
|
-
Dir.chdir(server_path
|
108
|
+
Dir.chdir(server_path) do
|
109
|
+
# server name is the server's folder name
|
110
|
+
server_name = FileUtils.pwd.split("/").last
|
111
|
+
|
99
112
|
puts "Downloading bukkit..."
|
100
113
|
if $cmd_opts[:beta]
|
101
114
|
Rblock::fetch_bukkit('http://cbukk.it/craftbukkit-beta.jar', 'craftbukkit.jar')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rblock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|