bukkit 2.3.2 → 2.4.0

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: 357bbe413e2a0905b31cda5501a86750b1aba1bc
4
- data.tar.gz: 9747077810bb645b7f620baa4ba19a76c6f464d3
3
+ metadata.gz: d91a89a5486b4939f3772d524bbcdac423541696
4
+ data.tar.gz: 34666baa89b9789b6f3ebdf0f399611014dd4232
5
5
  SHA512:
6
- metadata.gz: 47a3d79f8e7041c7cbc9e515b327d9a93535b17467bf04ce93a5b9c4b1f1c03c41909a688170a7841ce7ebd4157a90848b2810334f5191adb2bb9e9b1357590a
7
- data.tar.gz: 6b9fce1ae6b722e8298c9d7097ddc31b09e86a1223ae89bcbdeaf7083228c72a6a60d66643cbdc7933e3bde1b9806942c57ef05058a177ec917175639f3ee356
6
+ metadata.gz: 7db58c7d226a1efcf91b0af527854ec69e65d2b59a6439e4cc5279670fa7b9a09434d52e341b620c7adb29ac7785d2e9e0163a2d84efc4e2a9b5b1ec23606bff
7
+ data.tar.gz: 576bd272a425c7e1c0f93cb5cb251fcc418dc250186b86f43991f94386d53ae3065c4e1f8e5fffd482f5502b405bea07b22215f7b176e70e68b6f03c344c9248
data/.gitignore CHANGED
@@ -2,6 +2,8 @@
2
2
  *.swp
3
3
  *~
4
4
  *.gem
5
+ .bundle/
5
6
  gem/
6
7
  my-awesome-server/
7
8
  Gemfile.lock
9
+ test_server/
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.0
3
4
  - 2.0.0
4
5
  - 1.9.3
data/Rakefile CHANGED
@@ -8,7 +8,12 @@
8
8
  require "rubygems"
9
9
  require "rake"
10
10
  require "colorize"
11
- require "rake/testtask"
11
+ require 'cucumber'
12
+ require 'cucumber/rake/task'
13
+
14
+ Cucumber::Rake::Task.new(:features) do |t|
15
+ t.cucumber_opts = "features --format pretty"
16
+ end
12
17
 
13
18
  # Helpers
14
19
  def test(filename)
@@ -23,14 +28,6 @@ task :default do
23
28
  puts "Run: ".yellow + "`bukkit --help` to list all commands."
24
29
  end
25
30
 
26
- # Run all tests.
27
- Rake::TestTask.new do |t|
28
- t.libs << "test"
29
- t.libs << "bin"
30
- t.test_files = FileList['test/test*.rb']
31
- t.verbose = true
32
- end
33
-
34
31
  desc "Build gem."
35
32
  task :build do
36
33
  puts "Starting gem build...".yellow
data/bin/bukkit CHANGED
@@ -5,6 +5,7 @@ $: << File.expand_path(File.dirname(__FILE__) + "/../lib")
5
5
  require 'rubygems'
6
6
  require 'commander/import'
7
7
 
8
+ require 'bukkit/version'
8
9
  require 'bukkit.rb'
9
10
 
10
11
  program :version, Bukkit::VERSION
@@ -152,13 +153,13 @@ end
152
153
  command :install do |c|
153
154
  c.syntax = "bukkit install my-favorite-plugin"
154
155
  c.summary = "Install a plugin to your server."
155
- c.description = c.summary
156
+ c.description = "An easy way to install a plugin to your server. (case insensitive)"
156
157
  c.example c.summary, "bukkit install my-favorite-plugin"
157
158
 
158
159
  c.action do |args, options|
159
160
  name = args.shift
160
161
 
161
- if name.empty?
162
+ if name.nil? || name.empty?
162
163
  abort "You didn't enter a plugin name."
163
164
  else
164
165
  plugin = Bukkit::Plugin.new(name)
@@ -166,3 +167,20 @@ command :install do |c|
166
167
  end
167
168
  end
168
169
  end
170
+
171
+ command :uninstall do |c|
172
+ c.syntax = "bukkit uninstall my-not-so-favorite-plugin"
173
+ c.summary = "Uninstall a plugin from your server."
174
+ c.description = "An easy way to uninstall a plugin from your server. (case insensitive)"
175
+ c.example c.summary, "bukkit uninstall my-not-so-favorite-plugin"
176
+
177
+ c.action do |args, options|
178
+ name = args.shift
179
+
180
+ if name.nil? || name.empty?
181
+ abort "You didn't enter a plugin name."
182
+ else
183
+ Bukkit::Plugin.uninstall(name)
184
+ end
185
+ end
186
+ end
data/bukkit.gemspec CHANGED
@@ -28,4 +28,6 @@ Gem::Specification.new do |spec|
28
28
  # Dev Dependencies
29
29
  spec.add_development_dependency('bundler')
30
30
  spec.add_development_dependency('rake')
31
+ spec.add_development_dependency('cucumber')
32
+ spec.add_development_dependency('aruba')
31
33
  end
data/lib/bukkit.rb CHANGED
@@ -4,13 +4,15 @@ require 'colorize'
4
4
  require 'open-uri'
5
5
  require 'json'
6
6
 
7
- require 'bukkit/create'
8
- require 'bukkit/download'
9
- require 'bukkit/install'
10
- require 'bukkit/start'
11
- require 'bukkit/update'
12
- require 'bukkit/version'
13
- require 'bukkit/website'
7
+ # To require all files.
8
+ require 'bukkit/create.rb'
9
+ require 'bukkit/download.rb'
10
+ require 'bukkit/install.rb'
11
+ require 'bukkit/start.rb'
12
+ require 'bukkit/uninstall.rb'
13
+ require 'bukkit/update.rb'
14
+ require 'bukkit/version.rb'
15
+ require 'bukkit/website.rb'
14
16
 
15
17
  module Bukkit
16
18
  class Server
@@ -0,0 +1,44 @@
1
+ module Bukkit
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
+
11
+ plugins = Dir.glob("*")
12
+ delete = []
13
+
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
+
20
+ delete << plugin
21
+ end
22
+ end
23
+
24
+ # Delete each matching file.
25
+ if delete.empty?
26
+ puts "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
+
33
+ FileUtils.rm_rf file
34
+ puts file.light_red + " deleted".red
35
+ end
36
+
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
+ end
@@ -1,4 +1,4 @@
1
1
  module Bukkit
2
- VERSION = "2.3.2"
2
+ VERSION = "2.4.0"
3
3
  VERSION_FULL = "Bukkit-CLI v#{VERSION}"
4
4
  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.3.2
4
+ version: 2.4.0
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-01-01 00:00:00.000000000 Z
11
+ date: 2014-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: archive-zip
@@ -122,6 +122,34 @@ dependencies:
122
122
  - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: cucumber
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: aruba
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
125
153
  description: A command line wrapper for CraftBukkit.
126
154
  email:
127
155
  - school@jessegrant.net
@@ -133,7 +161,6 @@ files:
133
161
  - .gitignore
134
162
  - .ruby-version
135
163
  - .travis.yml
136
- - CHANGELOG
137
164
  - Gemfile
138
165
  - Gemfile.lock
139
166
  - LICENSE
@@ -146,6 +173,7 @@ files:
146
173
  - lib/bukkit/download.rb
147
174
  - lib/bukkit/install.rb
148
175
  - lib/bukkit/start.rb
176
+ - lib/bukkit/uninstall.rb
149
177
  - lib/bukkit/update.rb
150
178
  - lib/bukkit/version.rb
151
179
  - lib/bukkit/website.rb
data/CHANGELOG DELETED
@@ -1,12 +0,0 @@
1
- v0.1.0: Added 'update' command and a few bug fixes.
2
- v0.1.1: Major bug fix.
3
- v0.1.2: 'website' command fixed.
4
- v0.1.3: Minor bug fixes.
5
- v0.1.4: Much better documentation.
6
- v1.0.0: Total revamp of the CLI and docs. Definitely v1.0.
7
- v1.0.1: Got rid of the old docs.
8
- v1.0.2: Fixed some cosmetic things and bugs.
9
- v1.0.3: Just made the CLI little bit nicer.
10
- v1.0.4: Better Windows support and '--force' option to the 'new' command.
11
- v1.2.0: Code refactored.
12
- v1.3.0: Friendly output and '--ram' option.