Exception: Epuber::Compiler::FileFinders::MultipleFilesFoundError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/epuber/compiler/file_finders/abstract.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, groups, context_path, files_paths) ⇒ MultipleFilesFoundError

Returns a new instance of MultipleFilesFoundError.

Parameters:

  • pattern (String)

    original pattern for searching

  • groups (Array<Symbol> | Symbol)

    list of groups

  • context_path (String)

    context path of current searching

  • files_paths (Array<String>)

    list of founded files



50
51
52
53
54
55
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 50

def initialize(pattern, groups, context_path, files_paths)
  @pattern = pattern
  @groups = Array(groups)
  @context_path = context_path
  @files_paths = files_paths
end

Instance Attribute Details

#context_pathString (readonly)

Returns:

  • (String)


43
44
45
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 43

def context_path
  @context_path
end

#files_pathsArray<String> (readonly)

Returns:

  • (Array<String>)


31
32
33
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 31

def files_paths
  @files_paths
end

#groupsArray<Symbol> (readonly)

Returns:

  • (Array<Symbol>)


35
36
37
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 35

def groups
  @groups
end

#patternString (readonly)

Returns:

  • (String)


39
40
41
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 39

def pattern
  @pattern
end

Instance Method Details

#to_sObject



57
58
59
60
61
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 57

def to_s
  str = "Found too many files for pattern `#{pattern}` from context path #{context_path}"
  str += ", file groups #{groups.map(&:inspect)}" if !groups.nil? && !groups.empty?
  str + ", founded files #{files_paths}"
end