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
82
83
84
|
# File 'lib/syntax_tree/cli.rb', line 82
def failure
warn("The listed files did not match the expected format.")
end
|
#run(handler, filepath, source) ⇒ Object
71
72
73
74
75
76
|
# File 'lib/syntax_tree/cli.rb', line 71
def run(handler, filepath, source)
raise UnformattedError if source != handler.format(source)
rescue StandardError
warn("[#{Color.yellow("warn")}] #{filepath}")
raise
end
|
#success ⇒ Object
78
79
80
|
# File 'lib/syntax_tree/cli.rb', line 78
def success
puts("All files matched expected format.")
end
|