Sha256: 30c544893c4d63049e47092c9b3b73eb31d0c2103d0c4ad3f1a7c460d520684f
Contents?: true
Size: 1.45 KB
Versions: 6
Compression:
Stored size: 1.45 KB
Contents
require_relative 'configuration_checker' module MavenHelperScript class ArgumentParser def initialize(file) @projectPom = File.join(file, "pom.xml") @configChecker = MavenHelperScript::ConfigurationChecker.new(file, 'm.yml') end public def parse(args) resultingCommands = Array[] specialtyCommands = @configChecker.checkForArguments() result = "" processingCommand = true args.each do |arg| if isSpecialtyCommand arg specialtyCommands << arg else if processingCommand result << "mvn " << @configChecker.checkForCommand(arg) processingCommand = false else foundModule = @configChecker.checkForModule(arg) result << " -pl " << foundModule << " -f " << @projectPom resultingCommands << result result = "" processingCommand = true end end end applySpecialtyCommandsTo(specialtyCommands, resultingCommands) resultingCommands end private def applySpecialtyCommandsTo(specialtyCommands, resultingCommands) specialtyCommands.each do |command| resultingCommands.each do |it| it = it << " " << command end end end def isSpecialtyCommand(command) if command.start_with?('-') return true end false end end end
Version data entries
6 entries across 6 versions & 1 rubygems