Class: Boxen::Service
- Inherits:
-
Object
- Object
- Boxen::Service
- Defined in:
- lib/boxen/service.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(name) ⇒ Service
constructor
A new instance of Service.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Service
Returns a new instance of Service.
13 14 15 |
# File 'lib/boxen/service.rb', line 13 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/boxen/service.rb', line 5 def name @name end |
Class Method Details
.list ⇒ Object
7 8 9 10 11 |
# File 'lib/boxen/service.rb', line 7 def self.list files.collect do |service| new(human_name(service)) end end |
Instance Method Details
#disable ⇒ Object
25 26 27 |
# File 'lib/boxen/service.rb', line 25 def disable Boxen::Util.sudo('/bin/launchctl', 'unload', '-w', location) end |
#enable ⇒ Object
21 22 23 |
# File 'lib/boxen/service.rb', line 21 def enable Boxen::Util.sudo('/bin/launchctl', 'load', '-w', location) end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/boxen/service.rb', line 17 def to_s name end |