Skip to content

Instantly share code, notes, and snippets.

@dmichael
Created June 2, 2009 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmichael/122610 to your computer and use it in GitHub Desktop.
Save dmichael/122610 to your computer and use it in GitHub Desktop.
class SoundFile
attr_reader :binaries
delegate :info, :to => :binaries
def initialize
@binaries = Binaries.instance
end
end
module Binaries
class <<self
def instance
@instance ||=
if windows?
Windows.new
else
Nix.new
end
end
end
class Windows
def info
`./bin/sndfile-info.exe`
end
end
class Nix
def info
`./bin/sndfile-info`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment