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.
-
#only ⇒ Object
readonly
Returns the value of attribute only.
-
#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
Instance Attribute Details
#baseline ⇒ Object (readonly)
Returns the value of attribute baseline
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def baseline @baseline end |
#compact ⇒ Object (readonly)
Returns the value of attribute compact
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def compact @compact end |
#directories ⇒ Object (readonly)
Returns the value of attribute directories
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def directories @directories end |
#fail_on ⇒ Object (readonly)
Returns the value of attribute fail_on
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def fail_on @fail_on end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def mode @mode end |
#only ⇒ Object (readonly)
Returns the value of attribute only
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def only @only end |
#packaging ⇒ Object (readonly)
Returns the value of attribute packaging
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def packaging @packaging end |
#skip ⇒ Object (readonly)
Returns the value of attribute skip
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def skip @skip end |
#top ⇒ Object (readonly)
Returns the value of attribute top
4 5 6 |
# File 'lib/hashira/cli/options.rb', line 4 def top @top end |
Class Method Details
.build(mode) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/hashira/cli/options.rb', line 8 def self.build(mode) new( directories: [], baseline: "", fail_on: [], skip: [], only: [], packaging: :auto, top: nil, compact: nil, mode: ) end |
.parse(argv) ⇒ Object
6 |
# File 'lib/hashira/cli/options.rb', line 6 def self.parse(argv) = CommandLine.new(argv). |
Instance Method Details
#analyzers ⇒ Object
23 |
# File 'lib/hashira/cli/options.rb', line 23 def analyzers = Hashira::Pipeline::ANALYZERS - skip |
#pipeline ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/hashira/cli/options.rb', line 15 def pipeline chosen = Hashira::Project.new(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:, only:) end |