Sha256: 8e2e48f8dc511baea985538b87964ae04b24082c88fc84abf4d66f89158e4f48

Contents?: true

Size: 1018 Bytes

Versions: 1

Compression:

Stored size: 1018 Bytes

Contents

#!/usr/bin/env ruby

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'minglr'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'minglr', "minglr_action"))

rc_config = MinglrConfigParser.parse
uri_options = rc_config[:global] || {}
project = rc_config[:global][:default].to_sym if rc_config[:global][:default]
original_arguments = ARGV

if MinglrAction::ACTIONS.include?(ARGV[0])
  action = ARGV[0]
else
  if ARGV[0] && (ARGV[0] =~ /^--/).nil?
    project = ARGV[0].to_sym 
    action = ARGV[1]
  end
end

if project
  uri_options.merge! rc_config[project]
  uri_options[:protocol] = uri_options[:url].slice(/^.*\:/).chop
  uri_options[:url].gsub!(/^(http|https)\:\/\//, "")
  uri_options[:host_and_port], uri_options[:project] = uri_options[:url].split("/projects/")
  MingleResource.configure uri_options
  Attachment.configure
  extra_options = MinglrOptionsParser.parse(original_arguments)
  MinglrAction.execute(action, ARGV, extra_options, rc_config[project])
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
schubert-minglr-1.1.0 bin/minglr