unit-hosting 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -0
- data/Gemfile.lock +36 -0
- data/VERSION +1 -1
- data/lib/unit-hosting.rb +2 -0
- data/lib/unit-hosting/agent.rb +12 -3
- data/lib/unit-hosting/api.rb +7 -0
- data/lib/unit-hosting/api/base.rb +48 -0
- data/lib/unit-hosting/api/vm.rb +62 -0
- data/lib/unit-hosting/api/vm_group.rb +44 -0
- data/lib/unit-hosting/api/vm_recipe.rb +30 -0
- data/lib/unit-hosting/cache.rb +12 -0
- data/lib/unit-hosting/cli.rb +6 -41
- data/lib/unit-hosting/commands.rb +88 -26
- data/lib/unit-hosting/group.rb +59 -0
- data/test/test_unit-hosting.rb +8 -2
- data/unit-hosting.gemspec +96 -0
- metadata +130 -12
data/Gemfile
CHANGED
@@ -2,6 +2,13 @@ source "http://rubygems.org"
|
|
2
2
|
# Add dependencies required to use your gem here.
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
|
+
gem 'mutter'
|
6
|
+
gem 'keystorage', '> 0.1'
|
7
|
+
gem 'mechanize', '>= 1.0.0'
|
8
|
+
gem 'highline', '> 1.6'
|
9
|
+
gem 'progressbar', '>= 0.9.0'
|
10
|
+
gem 'httpclient', '>= 2.1.6.1'
|
11
|
+
gem 'command-line-utils' , '>= 0.0.1'
|
5
12
|
|
6
13
|
# Add dependencies to develop your gem here.
|
7
14
|
# Include everything needed to run rake, tests, features, etc.
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
command-line-utils (0.0.1)
|
5
|
+
git (1.2.5)
|
6
|
+
highline (1.6.1)
|
7
|
+
httpclient (2.1.6.1)
|
8
|
+
jeweler (1.5.2)
|
9
|
+
bundler (~> 1.0.0)
|
10
|
+
git (>= 1.2.5)
|
11
|
+
rake
|
12
|
+
keystorage (0.4.3)
|
13
|
+
mechanize (1.0.0)
|
14
|
+
nokogiri (>= 1.2.1)
|
15
|
+
mutter (0.5.3)
|
16
|
+
nokogiri (1.4.4)
|
17
|
+
progressbar (0.9.0)
|
18
|
+
rake (0.8.7)
|
19
|
+
rcov (0.9.9)
|
20
|
+
shoulda (2.11.3)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
ruby
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
bundler (~> 1.0.0)
|
27
|
+
command-line-utils (>= 0.0.1)
|
28
|
+
highline (> 1.6)
|
29
|
+
httpclient (>= 2.1.6.1)
|
30
|
+
jeweler (~> 1.5.2)
|
31
|
+
keystorage (> 0.1)
|
32
|
+
mechanize (>= 1.0.0)
|
33
|
+
mutter
|
34
|
+
progressbar (>= 0.9.0)
|
35
|
+
rcov
|
36
|
+
shoulda
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/unit-hosting.rb
CHANGED
data/lib/unit-hosting/agent.rb
CHANGED
@@ -32,11 +32,20 @@ module UnitHosting
|
|
32
32
|
getr("/logout")
|
33
33
|
end
|
34
34
|
|
35
|
+
def group(id)
|
36
|
+
getr("/my/group/#{id}/info")
|
37
|
+
group = Group.new(id)
|
38
|
+
group.key = page.at("span.api-key").text.to_s
|
39
|
+
group.name = page.at("span.group-name").text.to_s
|
40
|
+
group
|
41
|
+
end
|
42
|
+
|
35
43
|
def groups
|
36
44
|
getr("/my/group")
|
37
|
-
page.search("#server-groups .instance_id a").
|
38
|
-
|
39
|
-
}
|
45
|
+
page.search("#server-groups .instance_id a").collect { |a|
|
46
|
+
group(a.text.to_s)
|
47
|
+
}.extend(Groups)
|
40
48
|
end
|
49
|
+
|
41
50
|
end
|
42
51
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim:set fileencoding=utf-8:
|
3
|
+
require 'rubygems'
|
4
|
+
require 'logger'
|
5
|
+
require 'xmlrpc/client'
|
6
|
+
require 'optparse'
|
7
|
+
require 'rexml/document'
|
8
|
+
|
9
|
+
module UnitHosting
|
10
|
+
module Api
|
11
|
+
def keypath instance_id
|
12
|
+
"%s/.UnitHosting/keys/%s.key" % [ENV['HOME'], instance_id]
|
13
|
+
end
|
14
|
+
module_function :keypath
|
15
|
+
class Base
|
16
|
+
attr_reader :instance_id,:api_key;
|
17
|
+
def initialize(instance_id=nil,api_key=nil)
|
18
|
+
@instance_id = instance_id
|
19
|
+
@api_key = api_key
|
20
|
+
@server = XMLRPC::Client.
|
21
|
+
new_from_uri("https://www.unit-hosting.com/xmlrpc",nil,1000)
|
22
|
+
@server.instance_variable_get(:@http).
|
23
|
+
instance_variable_get(:@ssl_context).
|
24
|
+
instance_variable_set(:@verify_mode, OpenSSL::SSL::VERIFY_NONE)
|
25
|
+
end
|
26
|
+
def self.load(instance_id)
|
27
|
+
self.new.load(instance_id)
|
28
|
+
end
|
29
|
+
def load(instance_id)
|
30
|
+
load_key(UnitHosting::keypath(instance_id))
|
31
|
+
end
|
32
|
+
def load_key(file)
|
33
|
+
File::open(file) do |f|
|
34
|
+
xml = f.read
|
35
|
+
doc = REXML::Document.new(xml)
|
36
|
+
@instance_id = doc.elements[@instance_id_elm].text
|
37
|
+
@api_key = doc.elements[@api_key_elm].text
|
38
|
+
end
|
39
|
+
self
|
40
|
+
end
|
41
|
+
def server_call(method,param = {})
|
42
|
+
param["instance_id"] = @instance_id
|
43
|
+
param["api_key"] = @api_key
|
44
|
+
return @server.call(method,param)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim:set fileencoding=utf-8:
|
3
|
+
require "rubygems"
|
4
|
+
require 'mutter'
|
5
|
+
|
6
|
+
require 'unit-hosting/api/base'
|
7
|
+
|
8
|
+
module UnitHosting
|
9
|
+
module Api
|
10
|
+
class Vm < Base
|
11
|
+
def initialize(instance_id=nil,api_key=nil)
|
12
|
+
@instance_id_elm = '/server/instance_id'
|
13
|
+
@api_key_elm = '/server/key'
|
14
|
+
super
|
15
|
+
end
|
16
|
+
def reboot
|
17
|
+
server_call("vm.reboot")
|
18
|
+
end
|
19
|
+
def start
|
20
|
+
server_call("vm.start")
|
21
|
+
end
|
22
|
+
def shutdown
|
23
|
+
server_call("vm.shutdown")
|
24
|
+
end
|
25
|
+
def power_off
|
26
|
+
server_call("vm.powerOff")
|
27
|
+
end
|
28
|
+
def destroy
|
29
|
+
server_call("vm.destroy")
|
30
|
+
end
|
31
|
+
def status?
|
32
|
+
server_call("vm.getStatus")
|
33
|
+
end
|
34
|
+
def memory_unit_size size
|
35
|
+
server_call("vm.setMemoryUnitSize",{"size" => size})
|
36
|
+
end
|
37
|
+
def cpu_unit_num num
|
38
|
+
server_call("vm.setCpuUnitNum",{"num" => num})
|
39
|
+
end
|
40
|
+
def memory_unit_size?
|
41
|
+
server_call("vm.getMemoryUnitSize")
|
42
|
+
end
|
43
|
+
def cpu_unit_num?
|
44
|
+
server_call("vm.getCpuUnitNum")
|
45
|
+
end
|
46
|
+
def ips
|
47
|
+
server_call("vm.getIpInfo")
|
48
|
+
end
|
49
|
+
def display_name
|
50
|
+
server_call("vm.getDisplayName")
|
51
|
+
end
|
52
|
+
def display_name= name
|
53
|
+
server_call("vm.setDisplayName",{"display_name" => name})
|
54
|
+
end
|
55
|
+
def replicate name=""
|
56
|
+
server_call("vm.replicate",{"display_name" => name})
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim:set fileencoding=utf-8:
|
3
|
+
require 'unit-hosting/api/base'
|
4
|
+
require 'unit-hosting/api/vm'
|
5
|
+
|
6
|
+
module UnitHosting
|
7
|
+
module Api
|
8
|
+
class VmGroup < Base
|
9
|
+
def initialize(instance_id=nil,api_key=nil)
|
10
|
+
@instance_id_elm = '/server-group/instance_id'
|
11
|
+
@api_key_elm = '/server-group/key'
|
12
|
+
super
|
13
|
+
end
|
14
|
+
# このサーバグループに含まれるVMオブジェクトをすべて返す
|
15
|
+
def vms
|
16
|
+
server_call("vmGroup.getVms")
|
17
|
+
end
|
18
|
+
def vm_api_key instance_id
|
19
|
+
server_call("vmGroup.getVms").each do |vm|
|
20
|
+
return vm["api_key"] if vm[instance_id] == instance_id
|
21
|
+
end
|
22
|
+
end
|
23
|
+
# instance_idに紐づくvmを返す
|
24
|
+
def vm(instance_id)
|
25
|
+
Vm.new(instance_id,vm_api_key(instance_id))
|
26
|
+
end
|
27
|
+
# vmの作成
|
28
|
+
def create_vm(recipe)
|
29
|
+
r = server_call("vmGroup.createVm",recipe.params)
|
30
|
+
return false if r["result"] != "success"
|
31
|
+
r
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
if $0 == __FILE__
|
38
|
+
pp UnitHosting::VmGroup.load('tumf-sg-10').vm('tumf-vm-107')
|
39
|
+
exit
|
40
|
+
recipe = UnitHosting::VmRecipe.new
|
41
|
+
# recipe.
|
42
|
+
end
|
43
|
+
|
44
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim:set fileencoding=utf-8:
|
3
|
+
require 'unit_hosting/base'
|
4
|
+
module UnitHosting
|
5
|
+
module Api
|
6
|
+
class VmRecipe
|
7
|
+
attr_accessor :rootpw,:ssh_key,:plan_id
|
8
|
+
attr_accessor :op_user,:op_mail,:user_script,:display_name
|
9
|
+
def initialize
|
10
|
+
@op_user = ENV['USER']
|
11
|
+
end
|
12
|
+
def load_ssh_key file
|
13
|
+
File::open(file) do |f|
|
14
|
+
@ssh_key = f.read
|
15
|
+
end
|
16
|
+
end
|
17
|
+
def params
|
18
|
+
param = {
|
19
|
+
"rootpw" => @rootpw,
|
20
|
+
"ssh_key" => @ssh_key,
|
21
|
+
"op_user" => @op_user,
|
22
|
+
"op_mail" => @op_mail,
|
23
|
+
"user_script" => @user_script,
|
24
|
+
"plan_id" => @plan_id,
|
25
|
+
"display_name" => @display_name
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/unit-hosting/cli.rb
CHANGED
@@ -1,50 +1,15 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# -*- coding: utf-8 -*-
|
3
|
-
require '
|
3
|
+
require 'command-line-utils'
|
4
4
|
require 'unit-hosting/commands'
|
5
|
-
|
6
5
|
module UnitHosting
|
7
|
-
class CLI
|
6
|
+
class CLI < CommandLineUtils::CLI
|
8
7
|
def initialize
|
9
|
-
|
10
|
-
@
|
8
|
+
super
|
9
|
+
@commands = Commands.new
|
11
10
|
end
|
12
|
-
|
13
|
-
|
14
|
-
begin
|
15
|
-
@opt = OptionParser.new
|
16
|
-
@opt.on('--version', 'show version') { version;exit }
|
17
|
-
@opt.on('--help', 'show this message') { usage;exit }
|
18
|
-
@opt.on('--debug', 'debug mode') { @options[:debug] = true }
|
19
|
-
cmd_argv = @opt.order!(argv)
|
20
|
-
cmd = cmd_argv.shift
|
21
|
-
raise unless cmd
|
22
|
-
Commands.new(cmd_argv,@options).send(cmd)
|
23
|
-
rescue =>e
|
24
|
-
puts "Message: #{e}\n"
|
25
|
-
usage
|
26
|
-
raise e if @options[:debug]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def usage(e=nil)
|
31
|
-
puts @opt
|
32
|
-
puts "\nCommands:\n"
|
33
|
-
COMMANDS.each { |c|
|
34
|
-
puts " " + c
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
def version
|
39
|
-
File.open(File.dirname(__FILE__) + '/../../VERSION',"r") { |file|
|
40
|
-
puts file.gets
|
41
|
-
}
|
42
|
-
end
|
43
|
-
|
44
|
-
class << self
|
45
|
-
def run(argv)
|
46
|
-
self.new.execute(argv)
|
47
|
-
end
|
11
|
+
def dispatch(cmd,cmd_argv)
|
12
|
+
@commands.send(cmd.sub(/:/,"_"))
|
48
13
|
end
|
49
14
|
end
|
50
15
|
end
|
@@ -6,36 +6,22 @@ require "highline/import"
|
|
6
6
|
require "keystorage"
|
7
7
|
|
8
8
|
require "unit-hosting"
|
9
|
+
require "unit-hosting/api"
|
9
10
|
require "unit-hosting/agent"
|
11
|
+
require "unit-hosting/cache"
|
10
12
|
#require "unit-hosting/api"
|
13
|
+
require "command-line-utils"
|
11
14
|
|
12
15
|
module UnitHosting
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
@
|
18
|
-
@command_options = cmd_options
|
19
|
-
@help = false
|
16
|
+
class Commands < CommandLineUtils::Commands
|
17
|
+
# CommandLineUtils::COMMANDS +=
|
18
|
+
def initialize
|
19
|
+
super
|
20
|
+
@commands += ["login","logout","update","groups","group"]
|
20
21
|
@agent = Agent.new
|
22
|
+
@cache_file = ENV['HOME']+"/.unit-hosting.cache"
|
23
|
+
@cache = Cache.new(@cache_file)
|
21
24
|
|
22
|
-
@summery = ""
|
23
|
-
@banner = ""
|
24
|
-
end
|
25
|
-
|
26
|
-
def help
|
27
|
-
opt = OptionParser.new
|
28
|
-
opt.parse!(@command_options)
|
29
|
-
@summery = "Show command helps."
|
30
|
-
@banner = "command"
|
31
|
-
return opt if @help
|
32
|
-
@help = true
|
33
|
-
command = @command_options.shift
|
34
|
-
raise "Unknown command: " + command unless COMMANDS.include?(command)
|
35
|
-
opt = send(command)
|
36
|
-
puts "Summery: #{@summery}"
|
37
|
-
opt.banner="Usage: unit-hosting [options] #{command} #{@banner}"
|
38
|
-
puts opt
|
39
25
|
end
|
40
26
|
|
41
27
|
def login
|
@@ -76,10 +62,72 @@ module UnitHosting
|
|
76
62
|
Keystorage.delete("bookscan")
|
77
63
|
end
|
78
64
|
|
79
|
-
|
65
|
+
include UnitHosting::Api
|
80
66
|
def update
|
67
|
+
all = false
|
68
|
+
opt = OptionParser.new
|
69
|
+
opt.on('-a','--all', 'update all cache') { all = true }
|
70
|
+
opt.parse!(@command_options)
|
71
|
+
@summery = "Update cache."
|
72
|
+
@banner = "GID [-a|--all]"
|
73
|
+
return opt if @help
|
74
|
+
gid = @command_options.shift
|
75
|
+
|
76
|
+
|
81
77
|
start
|
82
|
-
|
78
|
+
gs = @agent.groups.collect { |g|
|
79
|
+
unless g.key.empty?
|
80
|
+
v = @cache.groups.find{ |c| c.instance_id == g.instance_id }
|
81
|
+
v.update if v and v.vms == nil
|
82
|
+
g.vms = v.vms if v
|
83
|
+
g
|
84
|
+
end
|
85
|
+
}.compact
|
86
|
+
@cache.transaction { |ps|
|
87
|
+
if all
|
88
|
+
ps["groups"] = gs.find_all { |g|
|
89
|
+
!g.key.empty?
|
90
|
+
}.extend(Groups).update
|
91
|
+
else
|
92
|
+
group = ask_group(gid,gs)
|
93
|
+
ps["groups"] = gs.collect{ |g|
|
94
|
+
unless g.key.empty?
|
95
|
+
g.update if g.instance_id == group.instance_id
|
96
|
+
g
|
97
|
+
end
|
98
|
+
}.compact.extend(Groups)
|
99
|
+
end
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
def groups
|
104
|
+
opt = OptionParser.new
|
105
|
+
opt.parse!(@command_options)
|
106
|
+
@summery = "List sever groups."
|
107
|
+
@banner = ""
|
108
|
+
return opt if @help
|
109
|
+
|
110
|
+
puts @cache.groups.tablize
|
111
|
+
end
|
112
|
+
|
113
|
+
def group
|
114
|
+
opt = OptionParser.new
|
115
|
+
opt.parse!(@command_options)
|
116
|
+
@summery = "List servers in group."
|
117
|
+
@banner = ""
|
118
|
+
return opt if @help
|
119
|
+
|
120
|
+
id = @command_options.shift
|
121
|
+
group = ask_group(id,@cache.groups)
|
122
|
+
puts group.tablize if group
|
123
|
+
end
|
124
|
+
|
125
|
+
def vif_plug
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
def vm_create
|
130
|
+
# vm:create tumf-sg-1
|
83
131
|
end
|
84
132
|
|
85
133
|
private
|
@@ -93,5 +141,19 @@ module UnitHosting
|
|
93
141
|
end
|
94
142
|
end
|
95
143
|
|
144
|
+
def ask_group(id,gs)
|
145
|
+
unless id
|
146
|
+
puts gs.extend(Groups).tablize
|
147
|
+
id = ask('Enter group id ([q]uit): ',gs.ids << 'q') { |q|
|
148
|
+
q.validate = /\w+/
|
149
|
+
q.readline = true
|
150
|
+
}
|
151
|
+
end
|
152
|
+
raise SystemExit if id == "q"
|
153
|
+
group = gs.find { |g| id == g.instance_id }
|
154
|
+
raise "Group #{id} is not exists." unless group
|
155
|
+
group
|
156
|
+
end
|
157
|
+
|
96
158
|
end
|
97
159
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
require 'rubygems'
|
4
|
+
require 'mutter'
|
5
|
+
|
6
|
+
module UnitHosting
|
7
|
+
module Groups
|
8
|
+
|
9
|
+
def update
|
10
|
+
each { |g| g.update}
|
11
|
+
self
|
12
|
+
end
|
13
|
+
|
14
|
+
def tablize
|
15
|
+
table = Mutter::Table.new(:delimiter => '|') do
|
16
|
+
column :style => :green
|
17
|
+
column
|
18
|
+
end
|
19
|
+
each do |group|
|
20
|
+
table << [group.instance_id, group.name]
|
21
|
+
end
|
22
|
+
table.to_s if length > 0
|
23
|
+
end
|
24
|
+
|
25
|
+
def ids
|
26
|
+
collect { |g| g.instance_id }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class Group
|
31
|
+
include UnitHosting::Api
|
32
|
+
|
33
|
+
attr_accessor :instance_id, :key, :name, :remote, :vms
|
34
|
+
alias :apikey :key
|
35
|
+
|
36
|
+
def initialize(instance_id = nil)
|
37
|
+
@instance_id = instance_id
|
38
|
+
end
|
39
|
+
|
40
|
+
def update
|
41
|
+
STDERR.puts "update #{instance_id}"
|
42
|
+
@vms = VmGroup.new(@instance_id,@key).vms
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
46
|
+
def tablize
|
47
|
+
table = Mutter::Table.new(:delimiter => '|') do
|
48
|
+
column :style => :green
|
49
|
+
column;column
|
50
|
+
end
|
51
|
+
return "#{instance_id} has no vms" unless @vms
|
52
|
+
@vms.each { |vm|
|
53
|
+
table << [vm["instance_id"],vm["status"],vm["display_name"]]
|
54
|
+
}
|
55
|
+
table.to_s if @vms.length > 0
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
data/test/test_unit-hosting.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
require 'helper'
|
2
3
|
|
3
4
|
class TestUnitHosting < Test::Unit::TestCase
|
4
|
-
|
5
|
-
|
5
|
+
context "Agent" do
|
6
|
+
should "access" do
|
7
|
+
UnitHosting::Agent.new {|agent|
|
8
|
+
agent.getr("/")
|
9
|
+
assert(agent.page.body =~ /ユニットホスティング/,"to top page")
|
10
|
+
}
|
11
|
+
end
|
6
12
|
end
|
7
13
|
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{unit-hosting}
|
8
|
+
s.version = "0.0.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Yoshihiro TAKAHARA"]
|
12
|
+
s.date = %q{2011-01-23}
|
13
|
+
s.default_executable = %q{unit-hosting}
|
14
|
+
s.description = %q{This is a command to manage virtual servers on UnitHosting(http://www.unit-hosting.com).}
|
15
|
+
s.email = %q{y.takahara@gmail.com}
|
16
|
+
s.executables = ["unit-hosting"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bin/unit-hosting",
|
29
|
+
"lib/unit-hosting.rb",
|
30
|
+
"lib/unit-hosting/agent.rb",
|
31
|
+
"lib/unit-hosting/api.rb",
|
32
|
+
"lib/unit-hosting/api/base.rb",
|
33
|
+
"lib/unit-hosting/api/vm.rb",
|
34
|
+
"lib/unit-hosting/api/vm_group.rb",
|
35
|
+
"lib/unit-hosting/api/vm_recipe.rb",
|
36
|
+
"lib/unit-hosting/cache.rb",
|
37
|
+
"lib/unit-hosting/cli.rb",
|
38
|
+
"lib/unit-hosting/commands.rb",
|
39
|
+
"lib/unit-hosting/group.rb",
|
40
|
+
"test/helper.rb",
|
41
|
+
"test/test_unit-hosting.rb",
|
42
|
+
"unit-hosting.gemspec"
|
43
|
+
]
|
44
|
+
s.homepage = %q{http://github.com/tumf/unit-hosting}
|
45
|
+
s.licenses = ["MIT"]
|
46
|
+
s.require_paths = ["lib"]
|
47
|
+
s.rubygems_version = %q{1.4.2}
|
48
|
+
s.summary = %q{unit-hosting command line tool}
|
49
|
+
s.test_files = [
|
50
|
+
"test/helper.rb",
|
51
|
+
"test/test_unit-hosting.rb"
|
52
|
+
]
|
53
|
+
|
54
|
+
if s.respond_to? :specification_version then
|
55
|
+
s.specification_version = 3
|
56
|
+
|
57
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
|
+
s.add_runtime_dependency(%q<mutter>, [">= 0"])
|
59
|
+
s.add_runtime_dependency(%q<keystorage>, ["> 0.1"])
|
60
|
+
s.add_runtime_dependency(%q<mechanize>, [">= 1.0.0"])
|
61
|
+
s.add_runtime_dependency(%q<highline>, ["> 1.6"])
|
62
|
+
s.add_runtime_dependency(%q<progressbar>, [">= 0.9.0"])
|
63
|
+
s.add_runtime_dependency(%q<httpclient>, [">= 2.1.6.1"])
|
64
|
+
s.add_runtime_dependency(%q<command-line-utils>, [">= 0.0.1"])
|
65
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
66
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
67
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
68
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<mutter>, [">= 0"])
|
71
|
+
s.add_dependency(%q<keystorage>, ["> 0.1"])
|
72
|
+
s.add_dependency(%q<mechanize>, [">= 1.0.0"])
|
73
|
+
s.add_dependency(%q<highline>, ["> 1.6"])
|
74
|
+
s.add_dependency(%q<progressbar>, [">= 0.9.0"])
|
75
|
+
s.add_dependency(%q<httpclient>, [">= 2.1.6.1"])
|
76
|
+
s.add_dependency(%q<command-line-utils>, [">= 0.0.1"])
|
77
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
78
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
79
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
80
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
81
|
+
end
|
82
|
+
else
|
83
|
+
s.add_dependency(%q<mutter>, [">= 0"])
|
84
|
+
s.add_dependency(%q<keystorage>, ["> 0.1"])
|
85
|
+
s.add_dependency(%q<mechanize>, [">= 1.0.0"])
|
86
|
+
s.add_dependency(%q<highline>, ["> 1.6"])
|
87
|
+
s.add_dependency(%q<progressbar>, [">= 0.9.0"])
|
88
|
+
s.add_dependency(%q<httpclient>, [">= 2.1.6.1"])
|
89
|
+
s.add_dependency(%q<command-line-utils>, [">= 0.0.1"])
|
90
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
91
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
92
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
93
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unit-hosting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yoshihiro TAKAHARA
|
@@ -15,12 +15,12 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-23 00:00:00 +09:00
|
19
19
|
default_executable: unit-hosting
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
type: :
|
23
|
-
name:
|
22
|
+
type: :runtime
|
23
|
+
name: mutter
|
24
24
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
@@ -32,10 +32,119 @@ dependencies:
|
|
32
32
|
version: "0"
|
33
33
|
prerelease: false
|
34
34
|
requirement: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :runtime
|
37
|
+
name: keystorage
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 9
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 1
|
47
|
+
version: "0.1"
|
48
|
+
prerelease: false
|
49
|
+
requirement: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
type: :runtime
|
52
|
+
name: mechanize
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 23
|
59
|
+
segments:
|
60
|
+
- 1
|
61
|
+
- 0
|
62
|
+
- 0
|
63
|
+
version: 1.0.0
|
64
|
+
prerelease: false
|
65
|
+
requirement: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
type: :runtime
|
68
|
+
name: highline
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 1
|
77
|
+
- 6
|
78
|
+
version: "1.6"
|
79
|
+
prerelease: false
|
80
|
+
requirement: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
type: :runtime
|
83
|
+
name: progressbar
|
84
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 59
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
- 9
|
93
|
+
- 0
|
94
|
+
version: 0.9.0
|
95
|
+
prerelease: false
|
96
|
+
requirement: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
type: :runtime
|
99
|
+
name: httpclient
|
100
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 125
|
106
|
+
segments:
|
107
|
+
- 2
|
108
|
+
- 1
|
109
|
+
- 6
|
110
|
+
- 1
|
111
|
+
version: 2.1.6.1
|
112
|
+
prerelease: false
|
113
|
+
requirement: *id006
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
type: :runtime
|
116
|
+
name: command-line-utils
|
117
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 29
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
- 0
|
126
|
+
- 1
|
127
|
+
version: 0.0.1
|
128
|
+
prerelease: false
|
129
|
+
requirement: *id007
|
130
|
+
- !ruby/object:Gem::Dependency
|
131
|
+
type: :development
|
132
|
+
name: shoulda
|
133
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
139
|
+
segments:
|
140
|
+
- 0
|
141
|
+
version: "0"
|
142
|
+
prerelease: false
|
143
|
+
requirement: *id008
|
35
144
|
- !ruby/object:Gem::Dependency
|
36
145
|
type: :development
|
37
146
|
name: bundler
|
38
|
-
version_requirements: &
|
147
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
39
148
|
none: false
|
40
149
|
requirements:
|
41
150
|
- - ~>
|
@@ -47,11 +156,11 @@ dependencies:
|
|
47
156
|
- 0
|
48
157
|
version: 1.0.0
|
49
158
|
prerelease: false
|
50
|
-
requirement: *
|
159
|
+
requirement: *id009
|
51
160
|
- !ruby/object:Gem::Dependency
|
52
161
|
type: :development
|
53
162
|
name: jeweler
|
54
|
-
version_requirements: &
|
163
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
55
164
|
none: false
|
56
165
|
requirements:
|
57
166
|
- - ~>
|
@@ -63,11 +172,11 @@ dependencies:
|
|
63
172
|
- 2
|
64
173
|
version: 1.5.2
|
65
174
|
prerelease: false
|
66
|
-
requirement: *
|
175
|
+
requirement: *id010
|
67
176
|
- !ruby/object:Gem::Dependency
|
68
177
|
type: :development
|
69
178
|
name: rcov
|
70
|
-
version_requirements: &
|
179
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
71
180
|
none: false
|
72
181
|
requirements:
|
73
182
|
- - ">="
|
@@ -77,7 +186,7 @@ dependencies:
|
|
77
186
|
- 0
|
78
187
|
version: "0"
|
79
188
|
prerelease: false
|
80
|
-
requirement: *
|
189
|
+
requirement: *id011
|
81
190
|
description: This is a command to manage virtual servers on UnitHosting(http://www.unit-hosting.com).
|
82
191
|
email: y.takahara@gmail.com
|
83
192
|
executables:
|
@@ -89,6 +198,7 @@ extra_rdoc_files:
|
|
89
198
|
- README.rdoc
|
90
199
|
files:
|
91
200
|
- Gemfile
|
201
|
+
- Gemfile.lock
|
92
202
|
- LICENSE.txt
|
93
203
|
- README.rdoc
|
94
204
|
- Rakefile
|
@@ -96,10 +206,18 @@ files:
|
|
96
206
|
- bin/unit-hosting
|
97
207
|
- lib/unit-hosting.rb
|
98
208
|
- lib/unit-hosting/agent.rb
|
209
|
+
- lib/unit-hosting/api.rb
|
210
|
+
- lib/unit-hosting/api/base.rb
|
211
|
+
- lib/unit-hosting/api/vm.rb
|
212
|
+
- lib/unit-hosting/api/vm_group.rb
|
213
|
+
- lib/unit-hosting/api/vm_recipe.rb
|
214
|
+
- lib/unit-hosting/cache.rb
|
99
215
|
- lib/unit-hosting/cli.rb
|
100
216
|
- lib/unit-hosting/commands.rb
|
217
|
+
- lib/unit-hosting/group.rb
|
101
218
|
- test/helper.rb
|
102
219
|
- test/test_unit-hosting.rb
|
220
|
+
- unit-hosting.gemspec
|
103
221
|
has_rdoc: true
|
104
222
|
homepage: http://github.com/tumf/unit-hosting
|
105
223
|
licenses:
|