Module: GuardHelpers::BaseHelper

Included in:
BasicHelper, GemHelper, GuardHelper, InitdHelper, MdHelper
Defined in:
lib/guard_helpers/base_helper.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



28
29
30
# File 'lib/guard_helpers/base_helper.rb', line 28

def included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#handle_all_paths(file) ⇒ Object



50
51
52
53
54
55
# File 'lib/guard_helpers/base_helper.rb', line 50

def handle_all_paths(file)
  ps = paths.flatten.grep file
  unless ps.empty?
    yield
  end
end

#handle_each_path(file) ⇒ Object



57
58
59
60
61
62
63
64
# File 'lib/guard_helpers/base_helper.rb', line 57

def handle_each_path(file)
  ps = paths.flatten.grep file
  unless ps.empty?
    ps.each do |p|
      yield p
    end
  end
end

#pathsObject



44
45
46
47
48
# File 'lib/guard_helpers/base_helper.rb', line 44

def paths
  @paths.flatten! if @paths.respond_to?(:flatten!)
  @paths.uniq! if @paths.respond_to?(:uniq!)
  @paths ||= []
end

#run_on_modifications(paths) ⇒ Object



38
39
40
41
42
# File 'lib/guard_helpers/base_helper.rb', line 38

def run_on_modifications(paths)
  @paths = paths
  Out.table "paths:", "#{paths}", "file:#{File.basename __FILE__} line:#{__LINE__}"
  super if defined? super
end

#startObject



33
34
35
# File 'lib/guard_helpers/base_helper.rb', line 33

def start
  super if defined? super
end