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
67
68
69
|
# File 'lib/syntax_tree/cli.rb', line 67
def failure
warn("The listed files did not match the expected format.")
end
|
#run(filepath, source) ⇒ Object
56
57
58
59
60
61
|
# File 'lib/syntax_tree/cli.rb', line 56
def run(filepath, source)
raise UnformattedError if source != SyntaxTree.format(source)
rescue StandardError
warn("[#{Color.yellow("warn")}] #{filepath}")
raise
end
|
#success ⇒ Object
63
64
65
|
# File 'lib/syntax_tree/cli.rb', line 63
def success
puts("All files matched expected format.")
end
|