module Songbook

Constants

VERSION

Public Class Methods

select_input_path(path) click to toggle source
# File lib/songbook.rb, line 7
def self.select_input_path(path)
  path || '.'
end
select_output_path(input_path:, output_path:) click to toggle source
# File lib/songbook.rb, line 11
def self.select_output_path(input_path:, output_path:)
  if output_path
    output_path
  elsif !Pathname.new(input_path).exist?
    raise "Cannot find input_path '#{input_path}'"
  elsif Pathname.new(input_path).file?
    input_path.sub(/\.ya?ml$/, '.txt')
  else
    input_path
  end
end