Compare commits

...

3 Commits

Author SHA1 Message Date
Denis Knauf 8421148a3e Regenerate gemspec for version 0.0.1 2013-03-18 15:37:40 +01:00
Denis Knauf 80d267613d Version bump to 0.0.1 2013-03-18 15:37:35 +01:00
Denis Knauf 51b911c7f7 Domain#state_reason added. "#{state} beacause #{reason}." possible 2013-03-18 15:37:19 +01:00
3 changed files with 33 additions and 28 deletions

View File

@ -1 +1 @@
0.0.0
0.0.1

View File

@ -76,10 +76,10 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Error 'Misc I/O Error'
EOF 'End-of-file from server'
KeepAlive 'Keepalive timer triggered'
Client 'Client requested it'
Error 'misc I/O Error'
EOF 'end-of-file from server'
KeepAlive 'keepalive timer triggered'
Client 'client requested it'
Last '--'
end
end
@ -88,7 +88,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
Last '--'
end
end
@ -97,7 +97,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
Last '--'
end
end
@ -106,7 +106,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
Last '--'
end
end
@ -115,7 +115,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
Last '--'
end
end
@ -124,7 +124,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
Last '--'
end
end
@ -133,7 +133,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
User 'paused on user request'
Migration 'paused for offline migration'
Save 'paused for save'
@ -151,7 +151,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unknown 'the reason is unknown'
Unknown 'unknown reason'
Booted 'normal startup from boot'
Migrated 'migrated from another host'
Restored 'restored from a state file'
@ -168,7 +168,7 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
User 'shutting down on user request'
Last '--'
end
@ -178,30 +178,30 @@ module Libvirt
enum_fields :comment
start_at 0
enum do
Unkown 'the reason is unknown'
Unkown 'unknown reason'
Shutdown 'normal shutdown'
Destroyed 'forced poweroff'
Crashed 'domain crashed'
Migrated 'migrated to another host'
Saved 'saved to a file'
Failed 'domain failed to start'
FromSnapshot 'restoed from a snapshot which was taken while domain was shutoff'
FromSnapshot 'restored from a snapshot which was taken while domain was shutoff'
Last '--'
end
end
class State < Enum
enum_fields :commend, :reasons
enum_fields :comment, :reasons
start_at 0
enum do
Nostate 'no state', NostateReason
Running 'the domain is running', RunningReason
Blocked 'the domain is blocked on resource', BlockedReason
Paused 'the domain is paused by user', PausedReason
Shutdown 'the domain is being shut down', ShutdownReason
Shutoff 'the domain is shut off', ShutoffReason
Crashed 'the domain is crashed', CrashedReason
PMSuspended 'the domain is suspended by guest power management', PMSuspendedReason
Nostate 'No state', NostateReason
Running 'The domain is running', RunningReason
Blocked 'The domain is blocked on resource', BlockedReason
Paused 'The domain is paused by user', PausedReason
Shutdown 'The domain is being shut down', ShutdownReason
Shutoff 'The domain is shut off', ShutoffReason
Crashed 'The domain is crashed', CrashedReason
PMSuspended 'The domain is suspended by guest power management', PMSuspendedReason
Last '--'
end
@ -215,8 +215,12 @@ module Libvirt
end
end
def state_reason
State[self.state]
end
def inspect
state, reason = State[self.state]
state, reason = state_reason
"#<#{self.class.name}: #{uuid} #{name} #{state.title}[#{reason.title}]>"
end
end

View File

@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = "libvirt-ext"
s.version = "0.0.0"
s.version = "0.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Denis Knauf"]
s.date = "2013-03-16"
s.date = "2013-03-18"
s.description = "ruby-libvirt is only a mapped api and unrubish. libvirt-ext extents functionality to be more rubish."
s.email = "Denis.Knauf@gmail.com"
s.extra_rdoc_files = [
@ -25,13 +25,14 @@ Gem::Specification.new do |s|
"Rakefile",
"VERSION",
"lib/libvirt-ext.rb",
"libvirt-ext.gemspec",
"test/helper.rb",
"test/test_libvirt-ext.rb"
]
s.homepage = "http://github.com/DenisKnauf/libvirt-ext"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = "1.8.11"
s.rubygems_version = "1.8.23"
s.summary = "Extents ruby-libvirt with usefull functions"
if s.respond_to? :specification_version then