Class: Kiseru::ConfigDir
- Inherits:
-
Object
- Object
- Kiseru::ConfigDir
- Defined in:
- lib/ki_youtrack/kiseru.rb
Constant Summary collapse
- NAME =
'.kiseru'
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #config(app_name) ⇒ Object
-
#initialize(opts = {}) ⇒ ConfigDir
constructor
A new instance of ConfigDir.
Constructor Details
#initialize(opts = {}) ⇒ ConfigDir
Returns a new instance of ConfigDir.
14 15 16 17 18 19 20 21 22 |
# File 'lib/ki_youtrack/kiseru.rb', line 14 def initialize(opts = {}) name = opts.fetch(:name) { NAME } root = Pathname.new(File.(opts.fetch(:root) { '~' })) @path = root + name unless File.directory?(@path) Dir.mkdir(@path) FileUtils.chmod(0700, @path) end end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/ki_youtrack/kiseru.rb', line 12 def path @path end |