Class: Mvn2::CommandTypes
- Inherits:
-
Object
- Object
- Mvn2::CommandTypes
- Extended by:
- PluginType, TypeHelper
- Defined in:
- lib/mvn2/plugin.rb
Class Method Summary collapse
Class Method Details
.def_command ⇒ Object
112 113 114 115 116 117 |
# File 'lib/mvn2/plugin.rb', line 112 def self.def_command def_command_flag def_command_goal register_type(:operation_name) { |list| get_name(list) || 'Operation' } register_type(:clean_block) { |list| basic_type(list) } end |
.def_command_flag ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/mvn2/plugin.rb', line 119 def self.def_command_flag register_type(:command_flag) { |list| = Plugins.get_var :options flags = [] list.each { |flag| if flag[:block].nil? flags << " #{flag[:options][:flag]}" if flag_boolean(flag, ) else flag[:block].call(, flags) end } flags.join } end |
.def_command_goal ⇒ Object
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/mvn2/plugin.rb', line 134 def self.def_command_goal register_type(:goal_override) { |list| = Plugins.get_var :options full_overrides = complex_filter(list.select { |v| v[:options][:override_all] }.sort_by { |v| -v[:options][:priority] }, , :goal) if full_overrides.nil? || full_overrides.empty? goals = complex_filter(list.select { |v| !v[:options][:override_all] }.sort_by { |v| v[:options][:order] }, , :goal) goals = ['install'] if (goals - ['clean']).empty? goals = ['clean'] + goals unless goals.include?('clean') goals = goals - ['clean'] if Plugins.get(:clean_block) goals.join(' ') else full_overrides.first end } end |