Class: Laborantin::Commands::Rm

Inherits:
Laborantin::Command show all
Defined in:
lib/laborantin/runner/commands/rm.rb

Instance Attribute Summary

Attributes inherited from Laborantin::Command

#args, #opts, #runner

Attributes included from Metaprog::Completeable

#completion_block

Instance Method Summary collapse

Methods inherited from Laborantin::Command

describe, each, execute, inherited, #initialize, option, plumbery!, plumbery?, porcelain?, #puts, #run

Methods included from Metaprog::Completeable

#complete, #completion_propositions_iterating_on

Constructor Details

This class inherits a constructor from Laborantin::Command

Instance Method Details

#at_risk?Boolean

Returns:

  • (Boolean)


86
87
88
89
# File 'lib/laborantin/runner/commands/rm.rb', line 86

def at_risk?
  (not has_listed_parameters?) and
  (not has___only_parameter?)
end

#has___only_parameter?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/laborantin/runner/commands/rm.rb', line 82

def has___only_parameter?
  (opts[:failed_only] == true) or (opts[:successful_only] == true)
end

#has_listed_parameters?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/laborantin/runner/commands/rm.rb', line 78

def has_listed_parameters?
  [:environments, :scenarii, :parameters].map{|i| opts[i].empty?}.include?(false)
end