Class: SyntaxTree::CLI::Check
Overview
An action of the CLI that ensures that the filepath is formatted as expected.
Defined Under Namespace
Classes: UnformattedError
Instance Method Summary
collapse
Instance Method Details
#failure ⇒ Object
73
74
75
|
# File 'lib/syntax_tree/cli.rb', line 73
def failure
warn("The listed files did not match the expected format.")
end
|
#run(handler, filepath, source) ⇒ Object
62
63
64
65
66
67
|
# File 'lib/syntax_tree/cli.rb', line 62
def run(handler, filepath, source)
raise UnformattedError if source != handler.format(source)
rescue StandardError
warn("[#{Color.yellow("warn")}] #{filepath}")
raise
end
|
#success ⇒ Object
69
70
71
|
# File 'lib/syntax_tree/cli.rb', line 69
def success
puts("All files matched expected format.")
end
|