Class: Hashira::CLI::Options
- Inherits:
-
Data
- Object
- Data
- Hashira::CLI::Options
- Defined in:
- lib/hashira/cli/options.rb
Instance Attribute Summary collapse
-
#baseline ⇒ Object
readonly
Returns the value of attribute baseline.
-
#compact ⇒ Object
readonly
Returns the value of attribute compact.
-
#directories ⇒ Object
readonly
Returns the value of attribute directories.
-
#fail_on ⇒ Object
readonly
Returns the value of attribute fail_on.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#packaging ⇒ Object
readonly
Returns the value of attribute packaging.
-
#skip ⇒ Object
readonly
Returns the value of attribute skip.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
Class Method Summary collapse
Instance Method Summary collapse
- #analyzers ⇒ Object
-
#initialize(**attributes) ⇒ Options
constructor
A new instance of Options.
- #pipeline ⇒ Object
Constructor Details
Instance Attribute Details
#baseline ⇒ Object (readonly)
Returns the value of attribute baseline
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def baseline @baseline end |
#compact ⇒ Object (readonly)
Returns the value of attribute compact
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def compact @compact end |
#directories ⇒ Object (readonly)
Returns the value of attribute directories
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def directories @directories end |
#fail_on ⇒ Object (readonly)
Returns the value of attribute fail_on
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def fail_on @fail_on end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def mode @mode end |
#packaging ⇒ Object (readonly)
Returns the value of attribute packaging
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def packaging @packaging end |
#skip ⇒ Object (readonly)
Returns the value of attribute skip
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def skip @skip end |
#top ⇒ Object (readonly)
Returns the value of attribute top
6 7 8 |
# File 'lib/hashira/cli/options.rb', line 6 def top @top end |
Class Method Details
.page(mode) ⇒ Object
10 |
# File 'lib/hashira/cli/options.rb', line 10 def self.page(mode) = new(**PAGE, mode:) |
.parse(argv) ⇒ Object
8 |
# File 'lib/hashira/cli/options.rb', line 8 def self.parse(argv) = CommandLine.new(argv). |
Instance Method Details
#analyzers ⇒ Object
25 |
# File 'lib/hashira/cli/options.rb', line 25 def analyzers = Hashira::Pipeline::ANALYZERS - skip |
#pipeline ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/hashira/cli/options.rb', line 17 def pipeline chosen = Hashira::Project.detect(directories) told = Hashira::Report::Notices.new told.scanning(chosen.files.size) told.rails if directories.empty? && File.exist?("config/application.rb") Hashira::Pipeline.new(chosen, enabled: analyzers, packaging:) end |