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
- .add_callback(*args) ⇒ Object
- .template(plugin_location) ⇒ Object
- .template_path(plugin_location) ⇒ Object
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.
10 11 12 13 |
# File 'lib/guard/ctags-bundler.rb', line 10 def initialize( = {}) super @ctags_generator = ::Guard::CtagsBundler::CtagsGenerator.new() end |
Class Method Details
.add_callback(*args) ⇒ Object
36 37 38 |
# File 'lib/guard/ctags-bundler.rb', line 36 def self.add_callback(*args) ::Guard::Plugin::Hooker.add_callback(*args) end |
.template(plugin_location) ⇒ Object
40 41 42 |
# File 'lib/guard/ctags-bundler.rb', line 40 def self.template(plugin_location) File.read(template_path(plugin_location)) end |
.template_path(plugin_location) ⇒ Object
44 45 46 |
# File 'lib/guard/ctags-bundler.rb', line 44 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
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/guard/ctags-bundler.rb', line 22 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
15 16 17 18 19 20 |
# File 'lib/guard/ctags-bundler.rb', line 15 def start UI.info 'Guard::CtagsBundler is running!' @ctags_generator. @ctags_generator. @ctags_generator. if [:stdlib] end |