Class: Hashira::CLI
- Inherits:
-
Object
- Object
- Hashira::CLI
- Defined in:
- lib/hashira/cli.rb,
lib/hashira/cli/flag.rb,
lib/hashira/cli/flags.rb,
lib/hashira/cli/options.rb
Defined Under Namespace
Modules: FailOn, Format, PackageBy, Skip, Usage Classes: Arguments, CommandLine, Flag, Options, Run
Constant Summary collapse
- FLAGS =
[ Flag.new( name: "--format", arg: "FORMAT", parse: Format, mode: :parsed, text: ["text (default), json, dot, or mermaid"] ), Flag.new(name: "--json", mode: :json, text: ["shorthand for --format json"]), Flag.new( name: "--fail-on", arg: "KINDS", field: :fail_on, parse: FailOn, mode: :fail_on, text: [ "exit 1 if findings exist; comma-separated", "kinds: cycles, sdp, mixed_audience, wide_edge,", "roll_call, complexity, duplication, smells (all", "of them), or one smell kind such as feature_envy" ] ), Flag.new( name: "--skip", arg: "ANALYZERS", field: :skip, parse: Skip, text: ["drop an analyzer; comma-separated: coupling,", "complexity, duplication, smells"] ), Flag.new( name: "--package-by", arg: "WHAT", field: :packaging, parse: PackageBy, text: [ "group coupling by: auto, folder, or namespace", "(top-level constant). Default auto: namespace for", "Rails apps (config/application.rb in or beside the", "analyzed directory), folder otherwise" ] ), Flag.new( name: "--ratchet", mode: :ratchet, text: ["fail when edges or findings appear that the", "baseline lacks"] ), Flag.new(name: "--update-baseline", mode: :update, text: ["record the current edges and findings"]), Flag.new( name: "--baseline", arg: "PATH", field: :baseline, default: "hashira_baseline.json", text: ["baseline file (default: hashira_baseline.json)"] ), Flag.new(name: "-h, --help", mode: :help, text: ["print this help"]), Flag.new(name: "--version", mode: :version, text: ["print the version"]) ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ CLI
Returns a new instance of CLI.
18 19 20 21 |
# File 'lib/hashira/cli.rb', line 18 def initialize() @options = @pipeline = .pipeline end |
Class Method Details
.failure(error) ⇒ Object
13 14 15 16 |
# File 'lib/hashira/cli.rb', line 13 def self.failure(error) warn("hashira: #{error.}") 1 end |