Class: GmVault::Config
- Inherits:
-
Object
- Object
- GmVault::Config
- Defined in:
- lib/gmvault/config.rb
Overview
Wrapper around GmVault configuration
Constant Summary
- BASE_DIR =
Default location
ENV['HOME'] + '/.gmvault'
- DEF_DB =
Default maildb location
ENV['HOME'] + '/Mail/gmvault-db'
Instance Attribute Summary (collapse)
-
- (Object) path
readonly
Returns the value of attribute path.
Class Method Summary (collapse)
-
+ (Array) list(path = BASE_DIR)
Class method equiv.
Instance Method Summary (collapse)
-
- (Array) find_addrs
Looks at all configured email addresses.
-
- (Config) initialize(path = BASE_DIR)
constructor
Constructor.
-
- (Array) list
Get all configured email addresses.
Constructor Details
- (Config) initialize(path = BASE_DIR)
Constructor
28 29 30 |
# File 'lib/gmvault/config.rb', line 28 def initialize(path = BASE_DIR) @path = path end |
Instance Attribute Details
- (Object) path (readonly)
Returns the value of attribute path
19 20 21 |
# File 'lib/gmvault/config.rb', line 19 def path @path end |
Class Method Details
+ (Array) list(path = BASE_DIR)
Class method equiv. to #list
52 53 54 |
# File 'lib/gmvault/config.rb', line 52 def self.list(path = BASE_DIR) self.new(path).list end |
Instance Method Details
- (Array) find_addrs
Looks at all configured email addresses
34 35 36 37 38 39 40 41 42 |
# File 'lib/gmvault/config.rb', line 34 def find_addrs @list = Array.new Dir.chdir(@path) do Dir['**.oauth'].each do |m| @list << m.split('.')[0..-2].join('.') end end @list end |
- (Array) list
Get all configured email addresses
46 47 48 |
# File 'lib/gmvault/config.rb', line 46 def list @list || find_addrs() end |