bukkit 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -0
- data/bin/bukkit +3 -44
- data/bukkit.gemspec +2 -4
- data/lib/bukkit.rb +11 -11
- data/lib/bukkit/create.rb +43 -43
- data/lib/bukkit/download.rb +28 -28
- data/lib/bukkit/install.rb +38 -38
- data/lib/bukkit/start.rb +17 -17
- data/lib/bukkit/uninstall.rb +36 -36
- data/lib/bukkit/update.rb +10 -10
- data/lib/bukkit/version.rb +2 -2
- data/lib/bukkit/website.rb +14 -14
- metadata +5 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60e76e7012eb4078a4bc60c931c9be6b64a67c63
|
4
|
+
data.tar.gz: e192cfebc9c104b1f8b8b8e2df6582a4b235c179
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a8daac45e797244eb25cdd8c36221527817a05952fd822de967b73d84837e552c1a22e840e8d86289e40f9f8a614dde456f36ee2b4e2dc0ee2ee719ee84b4f
|
7
|
+
data.tar.gz: a403a7ce21100e273249fbf67a8aeab6343509723a77c742581316fab539f68160fcc615fdfff9c9b87304900eafd7a85820f9ab9d1a531ae1b8133b7d59b541
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.5
|
data/.travis.yml
CHANGED
data/bin/bukkit
CHANGED
@@ -23,49 +23,8 @@ command :new do |c|
|
|
23
23
|
c.option "--nostart", "Just creates a new server, doesn't start it."
|
24
24
|
|
25
25
|
c.action do |args, options|
|
26
|
-
|
27
|
-
|
28
|
-
dev = options.dev
|
29
|
-
force = options.force
|
30
|
-
nostart = options.nostart
|
31
|
-
|
32
|
-
name = args.shift
|
33
|
-
|
34
|
-
new_options = Hash.new
|
35
|
-
|
36
|
-
# If it doesn't have a name then just stop them right there.
|
37
|
-
abort "You didn't enter a server name.\nTry `bukkit new my-awesome-server-name`." if name.nil?
|
38
|
-
|
39
|
-
# Add the build to the new_options hash.
|
40
|
-
if rb
|
41
|
-
new_options.merge!(:build => :rb)
|
42
|
-
elsif beta
|
43
|
-
new_options.merge!(:build => :beta)
|
44
|
-
elsif dev
|
45
|
-
new_options.merge!(:build => :dev)
|
46
|
-
else
|
47
|
-
# If the user didn't give a build option then ask for it.
|
48
|
-
build = ask "Build [rb/beta/dev]: "
|
49
|
-
case build
|
50
|
-
when "rb", "recommended"
|
51
|
-
new_options.merge!(:build => :rb)
|
52
|
-
when "beta"
|
53
|
-
new_options.merge!(:build => :beta)
|
54
|
-
when "dev", "development"
|
55
|
-
new_options.merge!(:build => :dev)
|
56
|
-
else
|
57
|
-
abort "Invalid build option.".red
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# Add the force option if it's needed. Adds the bool returned from 'force'.
|
62
|
-
force = false if force.nil?
|
63
|
-
new_options.merge!(:force => force)
|
64
|
-
|
65
|
-
# Now finally send the options to the method.
|
66
|
-
server = Bukkit::Server.new(name)
|
67
|
-
server.create(new_options)
|
68
|
-
Bukkit::Server.start unless nostart == true
|
26
|
+
puts "I'm sorry, but it looks like the Bukkit project has been discontinued.".red
|
27
|
+
puts "Check out this link to see what's going on: ".green + "http://bukkit.org/threads/mojang-and-the-bukkit-project.309715/"
|
69
28
|
end
|
70
29
|
end
|
71
30
|
alias_command :create, :new
|
@@ -185,4 +144,4 @@ command :uninstall do |c|
|
|
185
144
|
Bukkit::Plugin.uninstall(name)
|
186
145
|
end
|
187
146
|
end
|
188
|
-
end
|
147
|
+
end
|
data/bukkit.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Jesse Herrick"]
|
9
9
|
spec.email = ["school@jessegrant.net"]
|
10
10
|
spec.description = %q{A command line wrapper for CraftBukkit.}
|
11
|
-
|
11
|
+
spec.summary = %q{NOTE: Bukkit project discontinued. - A command line wrapper for CraftBukkit. Manage your server easier.}
|
12
12
|
spec.homepage = "https://github.com/JesseHerrick/Bukkit-CLI"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
@@ -30,7 +30,5 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency('rake')
|
31
31
|
spec.add_development_dependency('cucumber')
|
32
32
|
spec.add_development_dependency('aruba')
|
33
|
-
spec.add_development_dependency('guard')
|
34
|
-
spec.add_development_dependency('guard-cucumber')
|
35
33
|
spec.add_development_dependency('libnotify')
|
36
|
-
end
|
34
|
+
end
|
data/lib/bukkit.rb
CHANGED
@@ -15,16 +15,16 @@ require 'bukkit/version.rb'
|
|
15
15
|
require 'bukkit/website.rb'
|
16
16
|
|
17
17
|
module Bukkit
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
class Server
|
19
|
+
def initialize(name)
|
20
|
+
@name = name
|
21
|
+
end
|
22
|
+
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
class Plugin
|
25
|
+
def initialize(name)
|
26
|
+
@name = name.downcase
|
27
|
+
@plugin_api = JSON.parse(open("http://api.bukget.org/3/plugins/bukkit/#{@name}").read)
|
28
|
+
end
|
29
|
+
end
|
30
30
|
end
|
data/lib/bukkit/create.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
module Bukkit
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
2
|
+
class Server
|
3
|
+
public
|
4
|
+
# Create a new server.
|
5
|
+
def create(options = {}) # Options: { :build => :rb/:beta/:dev, :force => false/true }
|
6
|
+
@force = options[:force]
|
7
|
+
|
8
|
+
# If the dir already exists, fail gracefully.
|
9
|
+
check_for_dir(@name)
|
10
|
+
|
11
|
+
# Let the dark side of the force flow through you...
|
12
|
+
if @force == true
|
13
|
+
puts "Overwriting: ".light_red + "#{@name}/"
|
14
|
+
FileUtils.rm_rf(@name)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Create the server directory and cd into it.
|
18
|
+
Dir.mkdir(@name)
|
19
|
+
puts " Create: ".green + "#{@name}/"
|
20
|
+
Dir.chdir(@name)
|
21
|
+
|
22
|
+
# Fail gracefully on control + C (SIGINT)
|
23
|
+
trap("SIGINT") {
|
24
|
+
FileUtils.rm_rf(@name)
|
25
|
+
puts "#{@name} not created.".red
|
26
|
+
}
|
27
|
+
|
28
|
+
# Download build.
|
29
|
+
Bukkit::Server.download("http://dl.bukkit.org/latest-#{options[:build].to_s}/craftbukkit.jar")
|
30
|
+
|
31
|
+
# Give some friendly output.
|
32
|
+
puts "New server build at: ".blue + "#{Dir.pwd}/".light_blue
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def check_for_dir(dirname)
|
37
|
+
if Dir.exists?(dirname) && @force == false
|
38
|
+
puts "'#{dirname}' already exists.".red
|
39
|
+
|
40
|
+
names = %w{ minecraftyness mine-opolis mineville minetown bukkits-o-fun }
|
41
|
+
abort "Try ".yellow + "`bukkit new #{names.sample}` ".light_yellow + "or".yellow + " `bukkit new #{dirname} --force`".light_blue
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
45
|
end
|
data/lib/bukkit/download.rb
CHANGED
@@ -2,36 +2,36 @@ require 'rest-client'
|
|
2
2
|
require 'fileutils'
|
3
3
|
|
4
4
|
module Bukkit
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
class Server
|
6
|
+
# Download a file from a URI.
|
7
|
+
def self.download(uri, options = {}) # Options: { :filename => "filename.ext" }
|
8
|
+
# Get the filename. If it isn't defined, derive it from the URI.
|
9
|
+
if options[:filename]
|
10
|
+
filename = options[:filename]
|
11
|
+
else
|
12
|
+
filename = uri.split("\/").last
|
13
|
+
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
# Catch SIGINT if needed.
|
16
|
+
trap("SIGINT") {
|
17
|
+
puts "\nDownload failed.".red
|
18
|
+
FileUtils.rm(filename) if File.exists? filename
|
19
|
+
exit
|
20
|
+
}
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
# Give some friendly output.
|
23
|
+
puts "Downloading: ".yellow + filename
|
24
|
+
puts " From: ".yellow + uri
|
25
|
+
puts "(This may take a while depending on your internet connection.)".light_yellow
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
# Download the file.
|
28
|
+
data = RestClient.get(uri)
|
29
|
+
File.open(filename, "wb") do |file|
|
30
|
+
file.write(data)
|
31
|
+
end
|
32
|
+
# => filename.ext
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
puts filename.light_green + " successfully downloaded.".green
|
35
|
+
end
|
36
|
+
end
|
37
37
|
end
|
data/lib/bukkit/install.rb
CHANGED
@@ -3,47 +3,47 @@ require 'json'
|
|
3
3
|
require 'archive/zip'
|
4
4
|
|
5
5
|
module Bukkit
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
class Plugin
|
7
|
+
# Install a new plugin.
|
8
|
+
def install
|
9
|
+
# Get server's download link.
|
10
|
+
@download_url = @plugin_api["versions"][0]["download"]
|
11
|
+
@filename = @plugin_api["versions"][0]["filename"]
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
# Fail... gracefully, if craftbukkit.jar does not exist.
|
14
|
+
abort "You're not in a server's root directory!".red unless File.exists? "craftbukkit.jar"
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
# Go into plugins and download the plugin.
|
17
|
+
Dir.chdir("plugins")
|
18
|
+
Bukkit::Server.download(@download_url, :filename => @filename)
|
19
19
|
|
20
|
-
|
20
|
+
file_ext = File.extname(@filename)
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
22
|
+
# Unzip if it's a zip
|
23
|
+
case file_ext
|
24
|
+
when ".zip"
|
25
|
+
# Extract Zip Archive
|
26
|
+
Archive::Zip.extract(@filename, @name)
|
27
|
+
Dir.chdir(@name)
|
28
|
+
jarfiles = Dir.glob("*.jar")
|
29
|
+
# Move each jar file outside the folder.
|
30
|
+
jarfiles.each do |jar|
|
31
|
+
FileUtils.mv(jar, "../")
|
32
|
+
end
|
33
|
+
puts " Unarchived: ".yellow + @filename
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
35
|
+
Dir.chdir("../")
|
36
|
+
# Delete the extracted folder.
|
37
|
+
FileUtils.rm_rf("#{@name}/")
|
38
|
+
# Delete the archive.
|
39
|
+
FileUtils.rm_rf(@filename)
|
40
|
+
when ".jar"
|
41
|
+
nil
|
42
|
+
else
|
43
|
+
abort "Something weird happened...\nThe file extension is #{file_ext}, not '.zip' or '.jar'."
|
44
|
+
end
|
45
|
+
puts " Installed: ".light_green + @name
|
46
|
+
puts @name.light_green + " successfully installed!".green
|
47
|
+
end
|
48
|
+
end
|
49
49
|
end
|
data/lib/bukkit/start.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
module Bukkit
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
class Server
|
3
|
+
# Start the server.
|
4
|
+
def self.start(options = {})
|
5
|
+
if File.exists?("craftbukkit.jar")
|
6
|
+
ram = options[:ram]
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
puts "Starting your CraftBukkit server...".green
|
9
|
+
if ram.nil? or ram == 0
|
10
|
+
system 'java -jar craftbukkit.jar'
|
11
|
+
else
|
12
|
+
puts "Ram: ".blue + ram.to_s.light_blue
|
13
|
+
system "java -Xmx#{ram}M -Xms#{ram}M -jar craftbukkit.jar"
|
14
|
+
end
|
15
|
+
else
|
16
|
+
abort "You're not in your server's root directory.".red
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
20
|
end
|
data/lib/bukkit/uninstall.rb
CHANGED
@@ -1,44 +1,44 @@
|
|
1
1
|
module Bukkit
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
class Plugin
|
3
|
+
def self.uninstall(name)
|
4
|
+
# First check if in root dir.
|
5
|
+
abort "You're not in a server's root directory!".red unless File.exists? "craftbukkit.jar"
|
6
|
+
|
7
|
+
if Dir.exists?("plugins")
|
8
|
+
# The plugins dir exists and is not empty.
|
9
|
+
Dir.chdir("plugins")
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
plugins = Dir.glob("*")
|
12
|
+
delete = []
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
# Case insensitively checks each file/dir for a match.
|
15
|
+
plugins.each do |plugin|
|
16
|
+
if /#{name}/i =~ plugin
|
17
|
+
# Make the plugin name look the way the plugin dev wanted.
|
18
|
+
name = plugin if File.ftype(plugin) == "directory"
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
delete << plugin
|
21
|
+
end
|
22
|
+
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
# Delete each matching file.
|
25
|
+
if delete.empty?
|
26
|
+
abort "No plugins found matching '#{name}'".yellow
|
27
|
+
else
|
28
|
+
delete.each do |file|
|
29
|
+
if File.ftype(file) == "directory"
|
30
|
+
file = "#{file}/"
|
31
|
+
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
FileUtils.rm_rf file
|
34
|
+
puts file.light_red + " deleted".red
|
35
|
+
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
puts "#{name} has been successfully uninstalled.".green
|
38
|
+
end
|
39
|
+
else
|
40
|
+
abort "You have no plugins to uninstall."
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
44
|
end
|
data/lib/bukkit/update.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Bukkit
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
class Server
|
3
|
+
# Download a new version of bukkit.
|
4
|
+
def self.update(options = { :build => :rb }) # Options: { :build => :rb/:beta/:dev }
|
5
|
+
Bukkit::Server.download("http://dl.bukkit.org/latest-#{options[:build].to_s}/craftbukkit.jar")
|
6
|
+
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
# Download a new version of bukkit.
|
9
|
+
def update(options = { :build => :rb }) # Options: { :build => :rb/:beta/:dev }
|
10
|
+
Bukkit::Server.download("http://dl.bukkit.org/latest-#{options[:build].to_s}/craftbukkit.jar")
|
11
|
+
end
|
12
|
+
end
|
13
13
|
end
|
data/lib/bukkit/version.rb
CHANGED
data/lib/bukkit/website.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
require 'launchy'
|
2
2
|
|
3
3
|
module Bukkit
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
class Plugin
|
5
|
+
# Return the plugin's website URL.
|
6
|
+
def website
|
7
|
+
@website = @plugin_api["website"]
|
8
|
+
end
|
9
|
+
# => http://dev.bukkit.org/bukkit-plugins/pluginname
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
11
|
+
# Open website in default browser.
|
12
|
+
def view_website
|
13
|
+
Launchy.open(website)
|
14
|
+
puts "Opening #{@name}'s Website...".light_green
|
15
|
+
puts " Website: ".yellow + website
|
16
|
+
sleep 1.5
|
17
|
+
return website
|
19
18
|
end
|
19
|
+
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bukkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Herrick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: archive-zip
|
@@ -150,34 +150,6 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: guard
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: guard-cucumber
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - ">="
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - ">="
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
153
|
- !ruby/object:Gem::Dependency
|
182
154
|
name: libnotify
|
183
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -245,10 +217,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
217
|
version: '0'
|
246
218
|
requirements: []
|
247
219
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.2.
|
220
|
+
rubygems_version: 2.2.2
|
249
221
|
signing_key:
|
250
222
|
specification_version: 4
|
251
|
-
summary: A command line wrapper for CraftBukkit.
|
223
|
+
summary: 'NOTE: Bukkit project discontinued. - A command line wrapper for CraftBukkit.
|
224
|
+
Manage your server easier.'
|
252
225
|
test_files:
|
253
226
|
- features/create.feature
|
254
227
|
- features/install.feature
|