Class: Guard::CtagsBundler
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::CtagsBundler
- Defined in:
- lib/guard/ctags-bundler.rb,
lib/guard/ctags-bundler/ctags_generator.rb
Defined Under Namespace
Classes: CtagsGenerator
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CtagsBundler
constructor
A new instance of CtagsBundler.
- #run_on_changes(paths) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ CtagsBundler
Returns a new instance of CtagsBundler.
7 8 9 10 |
# File 'lib/guard/ctags-bundler.rb', line 7 def initialize( = {}) super @ctags_generator = ::Guard::CtagsBundler::CtagsGenerator.new() end |
Class Method Details
.template(plugin_location) ⇒ Object
33 34 35 |
# File 'lib/guard/ctags-bundler.rb', line 33 def self.template(plugin_location) File.read(template_path(plugin_location)) end |
.template_path(plugin_location) ⇒ Object
37 38 39 |
# File 'lib/guard/ctags-bundler.rb', line 37 def self.template_path(plugin_location) File.join(plugin_location, 'lib', 'guard', 'ctags-bundler', 'templates', 'Guardfile') end |
Instance Method Details
#run_on_changes(paths) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/guard/ctags-bundler.rb', line 19 def run_on_changes(paths) if paths.include?('Gemfile.lock') UI.info "regenerating bundler tags..." @ctags_generator. end ruby_files = paths.reject {|f| f == 'Gemfile.lock'} if ruby_files.any? UI.info "regenerating project tags..." @ctags_generator. end end |
#start ⇒ Object
12 13 14 15 16 17 |
# File 'lib/guard/ctags-bundler.rb', line 12 def start UI.info 'Guard::CtagsBundler is running!' @ctags_generator. @ctags_generator. @ctags_generator. if [:stdlib] end |