Class: VimEpidemic::Config
- Inherits:
-
Object
- Object
- VimEpidemic::Config
- Defined in:
- lib/vim-epidemic/config.rb
Instance Attribute Summary collapse
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
Instance Method Summary collapse
- #add(*args, &block) ⇒ Object
- #bundle_dir ⇒ Object
- #configure(&block) ⇒ Object
- #empty? ⇒ Boolean
- #exists? ⇒ Boolean
- #file ⇒ Object
- #has?(*args) ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #touch ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
7 8 9 10 |
# File 'lib/vim-epidemic/config.rb', line 7 def initialize @plugins = [] @home = File. '~' end |
Instance Attribute Details
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins.
5 6 7 |
# File 'lib/vim-epidemic/config.rb', line 5 def plugins @plugins end |
Instance Method Details
#add(*args, &block) ⇒ Object
24 25 26 |
# File 'lib/vim-epidemic/config.rb', line 24 def add *args, &block @plugins << Plugin.new(self, *args, block) end |
#bundle_dir ⇒ Object
40 41 42 |
# File 'lib/vim-epidemic/config.rb', line 40 def bundle_dir File.join @home, '.vim', 'bundle' end |
#configure(&block) ⇒ Object
28 29 30 |
# File 'lib/vim-epidemic/config.rb', line 28 def configure &block self.instance_eval &block end |
#empty? ⇒ Boolean
20 21 22 |
# File 'lib/vim-epidemic/config.rb', line 20 def empty? @plugins.empty? end |
#exists? ⇒ Boolean
36 37 38 |
# File 'lib/vim-epidemic/config.rb', line 36 def exists? File.exists? file end |
#file ⇒ Object
32 33 34 |
# File 'lib/vim-epidemic/config.rb', line 32 def file File.join @home, '.epidemic.vim.rb' end |
#has?(*args) ⇒ Boolean
16 17 18 |
# File 'lib/vim-epidemic/config.rb', line 16 def has? *args @plugins.find{ |p| p.match? *args } end |
#touch ⇒ Object
12 13 14 |
# File 'lib/vim-epidemic/config.rb', line 12 def touch FileUtils.touch file end |