Class: Rusky::Setting
- Inherits:
-
Object
- Object
- Rusky::Setting
- Defined in:
- lib/rusky/setting.rb
Constant Summary collapse
- FILENAME =
'.rusky'
Instance Attribute Summary collapse
-
#cwd ⇒ Object
readonly
Returns the value of attribute cwd.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #commands_for(hook_name) ⇒ Object
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(cwd) ⇒ Setting
constructor
A new instance of Setting.
Constructor Details
Instance Attribute Details
#cwd ⇒ Object (readonly)
Returns the value of attribute cwd.
7 8 9 |
# File 'lib/rusky/setting.rb', line 7 def cwd @cwd end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/rusky/setting.rb', line 7 def filename @filename end |
Instance Method Details
#commands_for(hook_name) ⇒ Object
33 34 35 |
# File 'lib/rusky/setting.rb', line 33 def commands_for(hook_name) @yaml[hook_name] end |
#create ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/rusky/setting.rb', line 17 def create if !exists? puts "rusky > creating .rusky file..." File.write(filename, '') end self end |
#delete ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rusky/setting.rb', line 25 def delete if exists? puts "rusky > deleting .rusky file..." File.delete(filename) end self end |