Class: VundleCli::Finder
- Inherits:
-
Object
- Object
- VundleCli::Finder
- Defined in:
- lib/vundle_cli/finder.rb
Instance Attribute Summary collapse
-
#bundle ⇒ Object
readonly
Returns the value of attribute bundle.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#vimrc ⇒ Object
readonly
Returns the value of attribute vimrc.
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(options, bundle = '') ⇒ Finder
constructor
A new instance of Finder.
- #list ⇒ Object
Constructor Details
#initialize(options, bundle = '') ⇒ Finder
Returns a new instance of Finder.
10 11 12 13 14 |
# File 'lib/vundle_cli/finder.rb', line 10 def initialize(, bundle = '') = @vimrc = Helpers.file_validate(.vimrc) @bundle = bundle end |
Instance Attribute Details
#bundle ⇒ Object (readonly)
Returns the value of attribute bundle.
8 9 10 |
# File 'lib/vundle_cli/finder.rb', line 8 def bundle @bundle end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/vundle_cli/finder.rb', line 4 def end |
#vimrc ⇒ Object (readonly)
Returns the value of attribute vimrc.
6 7 8 |
# File 'lib/vundle_cli/finder.rb', line 6 def vimrc @vimrc end |
Instance Method Details
#find ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/vundle_cli/finder.rb', line 25 def find puts "Searching..." open(@vimrc, 'r').each { |l| matches = l.chomp.match(/^Bundle (\S*)/) if matches bundle = matches[1].gsub("'", '') puts "Found #{bundle}" if bundle.downcase.include?(@bundle.downcase) end } end |
#list ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/vundle_cli/finder.rb', line 16 def list open(@vimrc, 'r').each { |l| matches = l.chomp.match(/^Bundle (\S*)/) if matches puts matches[1].gsub("'", '') end } end |