Sha256: 72eedb0f69c67e8aca649aafa2f11fa2e0ba8cd1befa089f33ac208adc780ab4

Contents?: true

Size: 468 Bytes

Versions: 5

Compression:

Stored size: 468 Bytes

Contents

# frozen_string_literal: true

require 'pathname'
require 'songbook/version'

module Songbook
  def self.select_input_path(path)
    path || '.'
  end

  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
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
songbook-0.5.1 lib/songbook.rb
songbook-0.5.0 lib/songbook.rb
songbook-0.4.0 lib/songbook.rb
songbook-0.3.1 lib/songbook.rb
songbook-0.3.0 lib/songbook.rb