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
106
107
108
|
# File 'lib/syntax_tree/cli.rb', line 106
def failure
warn("The listed files did not match the expected format.")
end
|
#run(item) ⇒ Object
94
95
96
97
98
99
100
|
# File 'lib/syntax_tree/cli.rb', line 94
def run(item)
source = item.source
raise UnformattedError if source != item.handler.format(source)
rescue StandardError
warn("[#{Color.yellow("warn")}] #{item.filepath}")
raise
end
|
#success ⇒ Object
102
103
104
|
# File 'lib/syntax_tree/cli.rb', line 102
def success
puts("All files matched expected format.")
end
|