Class: Serverspec::Type::Base
- Inherits:
-
Object
- Object
- Serverspec::Type::Base
show all
- Defined in:
- lib/serverspec/type/base.rb
Direct Known Subclasses
Bridge, Cgroup, Command, Cron, DefaultGateway, DockerBase, File, Group, Host, IisAppPool, IisWebsite, Interface, Ip6tables, Ipfilter, Ipnat, Iptables, KernelModule, LinuxKernelParameter, Lxc, MailAlias, Package, PhpConfig, Port, Ppa, Process, RoutingTable, Selinux, SelinuxModule, Service, User, WindowsFeature, WindowsHotFix, WindowsRegistryKey, WindowsScheduledTask, Yumrepo, Zfs
Instance Method Summary
collapse
Constructor Details
#initialize(name = nil) ⇒ Base
Returns a new instance of Base.
3
4
5
6
|
# File 'lib/serverspec/type/base.rb', line 3
def initialize(name=nil)
@name = name
@runner = Specinfra::Runner
end
|
Instance Method Details
#inspect ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/serverspec/type/base.rb', line 15
def inspect
if defined?(PowerAssert)
@inspection
else
to_s
end
end
|
#to_ary ⇒ Object
23
24
25
|
# File 'lib/serverspec/type/base.rb', line 23
def to_ary
to_s.split(" ")
end
|
#to_s ⇒ Object
8
9
10
11
12
13
|
# File 'lib/serverspec/type/base.rb', line 8
def to_s
type = self.class.name.split(':')[-1]
type.gsub!(/([a-z\d])([A-Z])/, '\1 \2')
type.capitalize!
%Q!#{type} "#{@name}"!
end
|