Class: Maximus::CLI
- Inherits:
-
Thor
- Object
- Thor
- Maximus::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/maximus/cli.rb
Overview
Command line abilities
Instance Method Summary collapse
- #backend ⇒ Object
- #frontend ⇒ Object
- #git ⇒ Object
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
- #install ⇒ Object
- #ruby ⇒ Object
- #statistics ⇒ Object
Constructor Details
Instance Method Details
#backend ⇒ Object
38 39 40 41 |
# File 'lib/maximus/cli.rb', line 38 def backend ['rubocop', 'railsbp', 'brakeman'].each { |e| check_exclude(e) } @config.destroy_temp end |
#frontend ⇒ Object
32 33 34 35 |
# File 'lib/maximus/cli.rb', line 32 def frontend ['scsslint', 'jshint'].each { |e| check_exclude(e) } @config.destroy_temp end |
#git ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/maximus/cli.rb', line 57 def git all_tasks = ['frontend', 'backend', 'statistics'] # If all flag is enabled, run everything return all_tasks.each { |a| send(a) } if [:all] # Lint by category unless all flags are blank return all_tasks.each { |a| check_option(a) } unless [:frontend].blank? && [:backend].blank? && [:statistics].blank? # If include flag is enabled, run based on what's included return [:include].each { |i| send(i) } unless [:include].blank? # If all flag is not enabled, lint working copy as it's supposed to be @config.settings[:commit] = [:git] Maximus::GitControl.new({config: @config}).lints_and_stats(true) @config.destroy_temp end |
#install ⇒ Object
73 74 75 |
# File 'lib/maximus/cli.rb', line 73 def install `npm install -g jshint phantomas stylestats` end |
#ruby ⇒ Object
52 53 54 |
# File 'lib/maximus/cli.rb', line 52 def ruby backend end |
#statistics ⇒ Object
44 45 46 47 |
# File 'lib/maximus/cli.rb', line 44 def statistics ['stylestats', 'phantomas', 'wraith'].each { |e| check_exclude(e) } @config.destroy_temp end |