class Guard::AnnotateGem

Public Instance Methods

inline?() click to toggle source
# File lib/guard/annotate_gem.rb, line 9
def inline?
  options[:inline] == true
end
run_on_modifications(paths) click to toggle source
# File lib/guard/annotate_gem.rb, line 5
def run_on_modifications(paths)
  annotate
end

Private Instance Methods

annotate() click to toggle source
# File lib/guard/annotate_gem.rb, line 15
def annotate
  result = annotate_gem
  case result
  when :gems_annotated
    Guard::Compat::UI.info 'Gems annotated', reset: true
  else
    Guard::Compat::UI.info "Gems can't be annotated -- Please check manually", reset: true
  end

  result
end
annotate_gem() click to toggle source
# File lib/guard/annotate_gem.rb, line 27
def annotate_gem
  Guard::Compat::UI.info 'Annotating gems...', reset: true
  ::Bundler.with_clean_env do
    system("bundle exec annotate_gem #{options_flags}")
  end
  $CHILD_STATUS == 0 ? :gems_annotated : false
end
options_flags() click to toggle source
# File lib/guard/annotate_gem.rb, line 35
def options_flags
  output = ''
  output += ' --inline' if inline?

  output
end