Class: ManageIQ::Style::CLI
- Inherits:
-
Object
- Object
- ManageIQ::Style::CLI
- Defined in:
- lib/manageiq/style/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = parse_cli_options) ⇒ CLI
constructor
A new instance of CLI.
- #install ⇒ Object
- #parse_cli_options ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(options = parse_cli_options) ⇒ CLI
Returns a new instance of CLI.
10 11 12 |
# File 'lib/manageiq/style/cli.rb', line 10 def initialize( = ) @opts = end |
Class Method Details
.run ⇒ Object
6 7 8 |
# File 'lib/manageiq/style/cli.rb', line 6 def self.run new.run end |
Instance Method Details
#install ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/manageiq/style/cli.rb', line 30 def install require 'yaml' require 'more_core_extensions/all' check_for_codeclimate_channel update_rubocop_yml write_rubocop_cc_yml ensure_rubocop_local_yml_exists update_codeclimate_yml ensure_haml_lint_yml update_yamllint update_generator update_gem_source end |
#parse_cli_options ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/manageiq/style/cli.rb', line 14 def require 'optimist' Optimist. do usage "[OPTIONS]" synopsis "\nThe ManageIQ community's style configuration utility." version "v#{ManageIQ::Style::VERSION}\n" opt :install, "Install or update the style configurations", :default => false, :required => true end end |
#run ⇒ Object
26 27 28 |
# File 'lib/manageiq/style/cli.rb', line 26 def run install if @opts[:install] end |