Sha256: dcbbd42c7f2e0f6f85102b2734df442d378fe56ddf1cae982dca827a1b1bd61b

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ruby
#
#  Created on 2007-12-6.
#  Copyright (c) 2007. All rights reserved.

begin
  require 'rubygems'
rescue LoadError
  # no rubygems to load, so we fail silently
end

require 'optparse'
require 'flac2mp3'

# NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.

OPTIONS = {}
MANDATORY_OPTIONS = %w[]

parser = OptionParser.new do |opts|
  opts.banner = <<BANNER
Usage: #{File.basename($0)} [filename]

Options are:
BANNER
  opts.separator ''
  opts.on('-v', '--version',
          "Show the #{File.basename($0)} version number and exit") { puts "flac2mp3 #{Flac2mp3::VERSION::STRING}"; exit }
  opts.on('-h', '--help',
          'Show this help message.') { puts opts; exit }
  opts.parse!(ARGV)

  if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
    puts opts; exit
  end
end

# do stuff
filename = ARGV[0]

unless filename
  puts "Usage: #{File.basename($0)} [filename]"
  exit
end

Flac2mp3.convert(filename.dup)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flac2mp3-0.2.0 bin/flac2mp3
flac2mp3-0.2.1 bin/flac2mp3
flac2mp3-0.2.2 bin/flac2mp3
flac2mp3-0.2.3 bin/flac2mp3
flac2mp3-0.2.4 bin/flac2mp3
flac2mp3-0.2.5 bin/flac2mp3