Class: GitlabToDoap::Command

Inherits:
Object
  • Object
show all
Includes:
TTY::Option
Defined in:
lib/gitlab-to-doap/command.rb

Instance Method Summary collapse

Instance Method Details

#runObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# 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