Class: Xcop::CLI
- Inherits:
-
Object
- Object
- Xcop::CLI
- Defined in:
- lib/xcop/cli.rb
Overview
Command line interface.
- Author
-
Yegor Bugayenko (yegor256@gmail.com)
- Copyright
-
Copyright © 2017-2026 Yegor Bugayenko
- License
-
MIT
Constant Summary collapse
- EXTENSIONS =
Extensions recognized when a directory is passed as input.
%w[xml xsd xhtml xsl html].freeze
Class Method Summary collapse
-
.expand(dir) ⇒ Object
Recursively collect XML-like files inside a directory.
Instance Method Summary collapse
-
#fix ⇒ Object
Fix them all.
-
#initialize(files, nocolor: false) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
Class Method Details
.expand(dir) ⇒ Object
Recursively collect XML-like files inside a directory.
24 25 26 |
# File 'lib/xcop/cli.rb', line 24 def self.(dir) EXTENSIONS.flat_map { |ext| Dir.glob(File.join(dir, '**', "*.#{ext}")) }.sort end |