Class: ErpDevSvcs::Commands::NewGemOwner

Inherits:
Object
  • Object
show all
Defined in:
lib/erp_dev_svcs/commands/new_gem_owner.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNewGemOwner

Returns a new instance of NewGemOwner.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/erp_dev_svcs/commands/new_gem_owner.rb', line 12

def initialize
  options = {}

  gem_names = ErpDevSvcs::Commands::Helper.compass_gem_names

  opt_parser = OptionParser.new do |opt|
    opt.banner = "Usage: compass_ae-dev new_gem_owner --emails LISTOFEMAILS"

    opt.on('-r', '--remove', String, "remove user from gem owner"){|r| options[:remove] = "-r"}
    
    opt.on("-e", "--emails LISTOFEMAILS", Array,
           "comma seperated list of email addresses of the users "\
           "you want to own the compass gems") {|emails| options[:emails] = emails}

    opt.on_tail("-h", "--help", "Show this message") do
      puts opt
      exit
    end
  end

  opt_parser.parse!

  puts opt_parser; exit if options[:emails].nil?

  ErpDevSvcs::Commands::Helper.exec_in_engines do |engine_name|
    command = options[:remove] || "-a" 
    
    options[:emails].each do |email|
      result = %x[gem owner #{engine_name} #{command} #{email}]
      puts result
    end
  end
end

Class Method Details

.executeObject



8
9
10
# File 'lib/erp_dev_svcs/commands/new_gem_owner.rb', line 8

def self.execute
  new()
end