Method: Fixman::CommandLine#get_params

Defined in:
lib/fixman/command_line.rb

#get_params(extra_templates, groups) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/fixman/command_line.rb', line 100

def get_params extra_templates, groups
  input = {}
  start_session input, URL_TEMPLATE

  input[:owner], input[:name] =
    Fixman::Repository.extract_owner_and_name input[:url]
  unless input[:owner] && input[:name]
    start_session input, NAME_TEMPLATE
    start_session input, OWNER_TEMPLATE
  end

  unless groups.empty?
    GROUPS_TEMPLATE[:choices] = groups
    start_session input, GROUPS_TEMPLATE
  end

  extra_templates.each do |template|
    start_session input, template
  end

  input[:sha] = Repository.retrieve_head_sha input[:url]

  input
end