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 (Symbol)

    list of groups

  • context_path (String)

    context path of current searching

  • files_paths (Array<String>)

    list of founded files



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

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

Instance Attribute Details

#context_pathString (readonly)

Returns:

  • (String)


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

def context_path
  @context_path
end

#files_pathsArray<String> (readonly)

Returns:

  • (Array<String>)


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

def files_paths
  @files_paths
end

#groupsArray<Symbol> (readonly)

Returns:

  • (Array<Symbol>)


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

def groups
  @groups
end

#patternString (readonly)

Returns:

  • (String)


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

def pattern
  @pattern
end

Instance Method Details

#to_sObject



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

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