Class: Guard::Teabag::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/teabag/resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Resolver

Returns a new instance of Resolver.



7
8
9
10
# File 'lib/guard/teabag/resolver.rb', line 7

def initialize(options = {})
  @options = options
  #@excluded = Dir[@options[:exclude].to_s]
end

Instance Attribute Details

#suitesObject

Returns the value of attribute suites.



5
6
7
# File 'lib/guard/teabag/resolver.rb', line 5

def suites
  @suites
end

Instance Method Details

#resolve(original_paths) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/guard/teabag/resolver.rb', line 12

def resolve(original_paths)
  @suites = {}
  original_paths.uniq.each do |path|
    if result = ::Teabag::Suite.resolve_spec_for(path)
      suite = @suites[result[:suite]] ||= []
      suite << result[:path]
    end
  end
end