Class: GitlabToDoap::Command
- Inherits:
-
Object
- Object
- GitlabToDoap::Command
- Includes:
- TTY::Option
- Defined in:
- lib/gitlab-to-doap/command.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
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 |