rubybukkit 0.0.2
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 +7 -0
- data/lib/rabbit.rb +4 -0
- data/lib/rabbit/gem_manager.rb +39 -0
- data/lib/rabbit/operation_helper.rb +11 -0
- data/lib/rabbit/version.rb +5 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4c121bfb5122461fd6f1fdc17a1112b6114e9f47
|
4
|
+
data.tar.gz: 0a03371bcdc78ddbefbc384f66f0bfd67ffb0cba
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5ba11d5e4a9fae9409ef4d440ec0b705a40aff312223ffe866bada12c70947dba4bc24c7e1e52538e03b7976994ee4a786353a75508dc2f816ed4057327e4b3
|
7
|
+
data.tar.gz: fc1148481539f04e0c46216e8d626929a9208b3d3cc2c2ac7b35b56902753575cb148e032ed16e1f47589da039cda165e3236b0c58fc22e23ee7db4dc9d1cc94
|
data/lib/rabbit.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'rubygems/commands/install_command'
|
2
|
+
require 'rubygems/commands/update_command'
|
3
|
+
require 'rubygems/commands/uninstall_command'
|
4
|
+
|
5
|
+
module Rabbit
|
6
|
+
|
7
|
+
module GemManager
|
8
|
+
extend self
|
9
|
+
|
10
|
+
def installed?(gem_name)
|
11
|
+
return Gem::Specification.find_all_by_name(gem_name).size > 0
|
12
|
+
end
|
13
|
+
|
14
|
+
def install(gem_name)
|
15
|
+
return success false if installed? gem_name
|
16
|
+
command = Gem::Commands::InstallCommand.new
|
17
|
+
command.handle_options [gem_name, '-i', Gem::path.first]
|
18
|
+
begin
|
19
|
+
command.execute
|
20
|
+
rescue Gem::SystemExitException => e
|
21
|
+
if e.exit_code == 0
|
22
|
+
return success true
|
23
|
+
else
|
24
|
+
return failure e.exit_code
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def update(gem_name)
|
30
|
+
#TODO: implement!
|
31
|
+
end
|
32
|
+
|
33
|
+
def uninstall(gem_name)
|
34
|
+
#TODO: implement!
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import 'net.rubybukkit.rabbit.ruby.Operation'
|
2
|
+
import 'net.rubybukkit.rabbit.ruby.SuccessfulOperation'
|
3
|
+
import 'net.rubybukkit.rabbit.ruby.UnsuccessfulOperation'
|
4
|
+
|
5
|
+
def success(result)
|
6
|
+
return SuccessfulOperation.new result
|
7
|
+
end
|
8
|
+
|
9
|
+
def failure(result)
|
10
|
+
return UnsuccessfulOperation.new result
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubybukkit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jason Skyedge
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-21 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- jskyedge@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/rabbit/gem_manager.rb
|
21
|
+
- lib/rabbit/operation_helper.rb
|
22
|
+
- lib/rabbit/version.rb
|
23
|
+
- lib/rabbit.rb
|
24
|
+
homepage: http://github.com/rubybukkit
|
25
|
+
licenses:
|
26
|
+
- MIT
|
27
|
+
metadata: {}
|
28
|
+
post_install_message:
|
29
|
+
rdoc_options: []
|
30
|
+
require_paths:
|
31
|
+
- lib
|
32
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - '>='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.9.2
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 2.0.14
|
45
|
+
signing_key:
|
46
|
+
specification_version: 4
|
47
|
+
summary: Rabbit is a Ruby implementation of CraftRabbit Minecraft server.
|
48
|
+
test_files: []
|