class GitlabToDoap::Command

Public Instance Methods

run() click to toggle source
# File lib/gitlab-to-doap/command.rb, line 50
def run
  g2d = GitlabToDoap.new(params[:gitlab_endpoint], params[:gitlab_token])
  project = g2d.gitlab_project(params[:project])
  xml = g2d.doap_xml(project)

  if params[:file]
    # output_filename = project.path_with_namespace.gsub(/\W/, "-") + ".doap.xml"
    File.open(params[:file], "w") do |f|
      f.puts xml
    end
  else
    puts xml
  end
end