bukkit 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b456919320509c81ec4330d3fea300e46e96ca67
4
- data.tar.gz: 5b07179f64b14ed897b797b77dda010079a0b8c8
3
+ metadata.gz: 28cb8d634661578cf277b6fc98310b33d3cfa09f
4
+ data.tar.gz: 78c6d26768e07272475313a00d1047f30f4fa1c5
5
5
  SHA512:
6
- metadata.gz: 9198e59e4b3bf729c6e80cb886361417f1f2e8cd3ae42ca240ebb78606cb477247ef42a3486eff740de1ecb6ffec50020818cb4aae153465ecf1c3ff7535cfd8
7
- data.tar.gz: 937abdb09b5882c8887e7f37b702eaf0d2f258e6bccbc03f25f4bb5779b12851141b60bc04531f789161596e4c031632c81a369bca3bad983b2877b304bed8ad
6
+ metadata.gz: 9f607ffc2ff9803d38f69f652d8ec8211cae91d345e5c8b024bf1871ff017055fe703410011d24b9c221025827458639c48cbaa47b3df0afc4b248f576b0bbcd
7
+ data.tar.gz: 1535f425f630dfe2f6cf43db46fd1247e968dad1ea41d89404bf8f7cf8ab02f1692c23d11d4f5f5e82dc869669e6296c85cfc4b78cae1c88c3b1b177de75ad0e
data/CHANGELOG CHANGED
@@ -1,4 +1,5 @@
1
1
  v0.1.0: Added 'update' command and a few bug fixes.
2
2
  v0.1.1: Major bug fix.
3
3
  v0.1.2: 'website' command fixed.
4
- v0.1.3: Minor bug fixes.
4
+ v0.1.3: Minor bug fixes.
5
+ v0.1.4: Much better documentation.
data/README.md CHANGED
@@ -19,3 +19,12 @@ A command line wrapper for CraftBukkit.
19
19
  `bukkit install pluginname` Installs a new plugin. As long as it is on [dev.bukkit.org](http://dev.bukkit.org/).
20
20
 
21
21
  `bukkit website pluginname` Opens the website of a plugin.
22
+
23
+ `bukkit update` Get's latest version of CraftBukkit.
24
+
25
+ `bukkit [-[-h]elp]` Displays help for commands.
26
+
27
+ `bukkit [-[-v]ersion]` Gives current Bukkit CLI version
28
+
29
+ ###Prerequisites:
30
+
data/lib/bukkit.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Orderly and Alphabetical requires h, i, n, s, v
1
+ # Orderly and Alphabetical Require Statements
2
2
  require 'rubygems'
3
3
 
4
4
  require 'bukkit/download'
@@ -15,10 +15,10 @@ module Bukkit
15
15
 
16
16
  # First arg control flow
17
17
  case opt1
18
- when "-v", "--version", "version"
18
+ when "-v", "--version", "version", "v"
19
19
  puts Bukkit::VERSION_FULL
20
- when "-h", "--help", "help"
21
- Bukkit::help
20
+ when "-h", "--help", "help", "h"
21
+ Bukkit::Help.all
22
22
  when "new"
23
23
  Bukkit::new
24
24
  when "start"
@@ -32,10 +32,11 @@ module Bukkit
32
32
  else
33
33
  if opt1.nil?
34
34
  puts "You didn't enter a command.\n"
35
- Bukkit::help
35
+ Bukkit::Help.all
36
36
  else
37
37
  puts "'#{opt1}' is not a command."
38
38
  puts "Run 'bukkit --help' for a list of commands."
39
+ Bukkit::Help.all
39
40
  end
40
41
  end
41
42
  end
@@ -7,6 +7,7 @@ module Bukkit
7
7
  file.write open("#{uri}").read
8
8
  end
9
9
  rescue Errno::ENOENT
10
+ Bukkit::Help.download
10
11
  abort "Error! No internet connection."
11
12
  end
12
13
  end
data/lib/bukkit/help.rb CHANGED
@@ -1,26 +1,51 @@
1
1
  module Bukkit
2
- def self.help
3
- puts " Commands:"
4
- puts " Create new server:"
5
- puts " bukkit new SERVER_NAME"
6
- puts "\n"
7
- puts " Start the server:"
8
- puts " bukkit start"
9
- puts "\n"
10
- puts " Install a plugin:"
11
- puts " bukkit install PLUGIN_NAME"
12
- puts "\n"
13
- puts " Open a plugin's website:"
14
- puts " bukkit website PLUGIN_NAME"
15
- puts "\n"
16
- puts " Update your version of CraftBukkit:"
17
- puts " bukkit update"
18
- puts "\n"
19
- # Put Last
20
- puts " Show this page:"
21
- puts " bukkit --help OR bukkit -h"
22
- puts "\n"
23
- puts " Get version:"
24
- puts " bukkit --version OR bukkit -v"
2
+ class Help
3
+
4
+ # All Help Commands
5
+
6
+ def self.all
7
+ puts "Usage: bukkit COMMAND [OPTIONS]"
8
+ puts ""
9
+ puts "COMMANDS:"
10
+
11
+ new
12
+ start
13
+ install
14
+ website
15
+ update
16
+ help
17
+ version
18
+ end
19
+
20
+ # Individual Help Commands
21
+
22
+ def self.new
23
+ puts " USAGE: bukkit new my-awesome-server-name"
24
+ puts " Creates a new server."
25
+ end
26
+ def self.start
27
+ puts " USAGE: bukkit start"
28
+ puts " Starts up your server. Must be run in the server's root directory."
29
+ end
30
+ def self.install
31
+ puts " USAGE: bukkit install pluginname"
32
+ puts " Installs a new plugin. As long as it is on http://dev.bukkit.org."
33
+ end
34
+ def self.website
35
+ puts " USAGE: bukkit website pluginname"
36
+ puts " Opens the website of a plugin."
37
+ end
38
+ def self.update
39
+ puts " USAGE: bukkit update"
40
+ puts " Get's latest version of CraftBukkit."
41
+ end
42
+ def self.help
43
+ puts " USAGE: bukkit [-[-h]elp]"
44
+ puts " Displays help for commands."
45
+ end
46
+ def self.version
47
+ puts " USAGE: bukkit [-[-v]ersion]"
48
+ puts " Gives current Bukkit CLI version"
49
+ end
25
50
  end
26
51
  end
@@ -6,7 +6,7 @@ require 'launchy'
6
6
  module Bukkit
7
7
  def self.install
8
8
  $opt2 = ARGV[1].downcase
9
- abort("USAGE: bukkit install PLUGIN_NAME") if $opt2.nil?
9
+ abort(Bukkit::Help.install) if $opt2.nil?
10
10
  begin
11
11
  plugins_api = JSON.parse(open("http://api.bukget.org/3/plugins/bukkit/#{$opt2}").read)
12
12
  website = plugins_api["website"]
data/lib/bukkit/new.rb CHANGED
@@ -23,8 +23,10 @@ module Bukkit
23
23
  Bukkit::start
24
24
  else
25
25
  if q1.length > 0
26
+ Bukkit::Help.new
26
27
  abort(" \"#{q1}\" is not an option.")
27
28
  else
29
+ Bukkit::Help.new
28
30
  abort(" You didn't enter an option.")
29
31
  end
30
32
  end
data/lib/bukkit/start.rb CHANGED
@@ -8,6 +8,7 @@ module Bukkit
8
8
  puts "Make sure that you're in your server's root directory."
9
9
  puts "If Java runtime is not present, run 'bukkit start' once Java is installed to complete the installation."
10
10
  system 'java -jar craftbukkit.jar'
11
+ Bukkit::Help.start
11
12
  end
12
13
  end
13
14
  end
data/lib/bukkit/update.rb CHANGED
@@ -27,6 +27,7 @@ module Bukkit
27
27
  end
28
28
  rescue
29
29
  puts "Uh oh! Something failed. Please report what you were doing at the time of this bug, and any other info you have at: https://github.com/JesseHerrick/bukkit/issues/new"
30
+ Bukkit::Help.update
30
31
  end
31
32
  end
32
33
  end
@@ -1,4 +1,4 @@
1
1
  module Bukkit
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  VERSION_FULL = "Bukkit-CLI v#{VERSION}"
4
4
  end
@@ -11,6 +11,7 @@ module Bukkit
11
11
  Launchy.open(website)
12
12
  rescue OpenURI::HTTPError
13
13
  puts " Plugin not found.\n Make sure you have the name correct."
14
+ Bukkit::Help.website
14
15
  end
15
16
  end
16
17
  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: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Herrick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-07 00:00:00.000000000 Z
11
+ date: 2013-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json