Class: Serverspec::Type::Process
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::Process
show all
- Defined in:
- lib/serverspec/type/process.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #to_ary, #to_s
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth) ⇒ Object
16
17
18
|
# File 'lib/serverspec/type/process.rb', line 16
def method_missing(meth)
get_column(meth.to_s)
end
|
Instance Method Details
#get_column(keyword) ⇒ Object
20
21
22
23
24
25
|
# File 'lib/serverspec/type/process.rb', line 20
def get_column(keyword)
ret = @runner.get_process(@name, :format => "#{keyword}=")
val = ret.stdout.strip
val = val.to_i if val.match(/^\d+$/)
val
end
|
#group ⇒ Object
12
13
14
|
# File 'lib/serverspec/type/process.rb', line 12
def group
get_column("group")
end
|
#running? ⇒ Boolean
3
4
5
6
|
# File 'lib/serverspec/type/process.rb', line 3
def running?
pid = @runner.get_process(@name, :format => "pid=").stdout
not pid.empty?
end
|
#user ⇒ Object
8
9
10
|
# File 'lib/serverspec/type/process.rb', line 8
def user
get_column("user")
end
|