class Pandocomatic::Input

Generic class to handle input files and directories in a general manner.

Attributes

errors[R]

Public Class Methods

new(input) click to toggle source

Create a new Input

@param input [String a list of input files

# File lib/pandocomatic/input.rb, line 29
def initialize(input)
  @input_files = input
  @errors = []
end

Public Instance Methods

absolute_path() click to toggle source

The absolute path to this Input

@return String

# File lib/pandocomatic/input.rb, line 37
def absolute_path
  File.absolute_path @input_files.first
end
base() click to toggle source

The base name of this Input

@return String

# File lib/pandocomatic/input.rb, line 44
def base
  File.basename @input_files.first
end
directory?() click to toggle source

Is this input a directory?

@return Boolean

# File lib/pandocomatic/input.rb, line 58
def directory?
  File.directory? @input_files.first
end
errors?() click to toggle source

Does this input have encountered any errors?

@return Boolean

# File lib/pandocomatic/input.rb, line 65
def errors?
  !@errors.empty?
end
name() click to toggle source

The name of this input

@return String

# File lib/pandocomatic/input.rb, line 51
def name
  @input_files.first
end
to_s() click to toggle source

A string representation of this Input

@return String

# File lib/pandocomatic/input.rb, line 72
def to_s
  name
end