class MxxRu::Cpp::Mode

Class, detecting a mode of MxxRu::Cpp is running

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/cpp/mode.rb, line 98
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 a special arguments in a command line

# File lib/mxx_ru/cpp/mode.rb, line 113
def initialize
  CmdLineOptionProcessor.instance.parse

  @manual_dry_run_counter = 0
end

Public Instance Methods

after_subprj_processing() click to toggle source

It should be executed after build/clean of subprojects. If is_only_one option is set and manual_dry_run_counter is equal to 0, manual dry_run mode is activated.

# File lib/mxx_ru/cpp/mode.rb, line 134
def after_subprj_processing
  if is_only_one
    @manual_dry_run_counter -= 1
    if 0 == @manual_dry_run_counter
      MxxRu::Util::Mode.instance.manual_dry_run( false )
    end
  end
end
before_subprj_processing() click to toggle source

It should be executed before build/clean of subprojects. If is_only_one option is set and manual_dry_run_counter is equal to 0, manual dry_run mode is activated.

# File lib/mxx_ru/cpp/mode.rb, line 122
def before_subprj_processing
  if is_only_one
    if 0 == @manual_dry_run_counter
      MxxRu::Util::Mode.instance.manual_dry_run( true )
    end
    @manual_dry_run_counter += 1
  end
end