Module: LicenseList::Tasks::License

Extended by:
License
Included in:
License
Defined in:
lib/license-list/tasks/license.rb

Instance Method Summary collapse

Instance Method Details

#export(file_name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/license-list/tasks/license.rb', line 8

def export(file_name)
  if file_name.blank?
    file_name = "license.csv"
  end

  if File.exist?(file_name)
    puts "file #{file_name} already exists"
  else
    puts "writing to #{file_name}"
    File.open(file_name, "w+") do |f|
      list_licenses(f)
    end
  end
end

#listObject



5
6
7
# File 'lib/license-list/tasks/license.rb', line 5

def list
  list_licenses($stdout)
end