class Guard::Ronn::Runner

Attributes

notifier[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/guard/ronn/runner.rb, line 7
def initialize(options = {})
  @options  = options
  @notifier = Notifier.new
end

Public Instance Methods

run(paths, options = {}) click to toggle source
# File lib/guard/ronn/runner.rb, line 12
def run(paths, options = {})
  return false if paths.empty?

  options = @options.merge(options)
  message = options[:message] || "Running: #{paths.join(' ')}"

  Compat::UI.info(message, reset: true)

  result = system(ronn_command(paths, options))

  @notifier.notify(result)
end

Private Instance Methods

bundler?() click to toggle source
# File lib/guard/ronn/runner.rb, line 37
def bundler?
  @bundler ||= File.exist?("#{Dir.pwd}/Gemfile")
end
ronn_command(paths, options = {}) click to toggle source
# File lib/guard/ronn/runner.rb, line 27
def ronn_command(paths, options = {})
  cmd_parts = []
  cmd_parts << 'bundle exec' if bundler? && options[:bundler] != false
  cmd_parts << 'ronn'
  cmd_parts << options[:cli] if options[:cli]
  cmd_parts << paths.join(' ')

  cmd_parts.join(' ')
end