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



52
53
54
55
56
57
58
59
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 52

def initialize(pattern, groups, context_path, files_paths)
  super()

  @pattern = pattern
  @groups = Array(groups)
  @context_path = context_path
  @files_paths = files_paths
end

Instance Attribute Details

#context_pathString (readonly)

Returns:

  • (String)


45
46
47
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 45

def context_path
  @context_path
end

#files_pathsArray<String> (readonly)

Returns:

  • (Array<String>)


33
34
35
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 33

def files_paths
  @files_paths
end

#groupsArray<Symbol> (readonly)

Returns:

  • (Array<Symbol>)


37
38
39
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 37

def groups
  @groups
end

#patternString (readonly)

Returns:

  • (String)


41
42
43
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 41

def pattern
  @pattern
end

Instance Method Details

#to_sObject



61
62
63
64
65
# File 'lib/epuber/compiler/file_finders/abstract.rb', line 61

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