class MxxRu::Util::Mode

Class, which detects MxxRu current mode.

Attributes

is_brief_desc[R]

Public Class Methods

generate_option_reader( option ) click to toggle source

Method for generation methods like is_clean, is_rebuild, etc.

# File lib/mxx_ru/util.rb, line 152
def Mode.generate_option_reader( option )
  class_eval do
    define_method( option ) do
      OptionParser.instance.send( option )
    end
  end
end
new() click to toggle source

Constructor checks for special arguments in command line.

# File lib/mxx_ru/util.rb, line 168
def initialize
  CmdLineOptionProcessor.instance.parse

  @is_brief_desc = OptionParser.instance.is_brief_desc
  @is_brief_desc = false if OptionParser.instance.is_brief_desc_disabled

  @is_dry_run = OptionParser.instance.is_dry_run

  @is_manual_dry_run = false
end

Public Instance Methods

is_dry_run() click to toggle source

Is dry-run mode set? Dry-run mode is set, if –mxx-dry-run command line parameter is set, or if it's manually set.

# File lib/mxx_ru/util.rb, line 182
def is_dry_run
  return ( @is_dry_run || @is_manual_dry_run )
end
manual_dry_run( a_is_manual_dry_run ) click to toggle source

On/Off manual dry-run mode. In some cases it's efficient to turn it on for some time. For example, it's used to handle subprojects with –mxx-cpp-1 option set.

# File lib/mxx_ru/util.rb, line 190
def manual_dry_run( a_is_manual_dry_run )
  @is_manual_dry_run = a_is_manual_dry_run
end
try_enable_show_brief() click to toggle source

Try to manually enable 'show-brief' mode. Attempt ignored if '–mxx-show-brief-disabled' was specified.

# File lib/mxx_ru/util.rb, line 196
def try_enable_show_brief
  @is_brief_desc = true unless OptionParser.instance.is_brief_desc_disabled
end