lib/termit/sound_response_handler.rb in termit-1.2.2 vs lib/termit/sound_response_handler.rb in termit-2.0.0

- old
+ new

@@ -1,14 +1,15 @@ +#encoding: UTF-8 require 'fileutils' module Termit class SoundResponseHandler def initialize data @data = data end def call - location = "#{File.expand_path('~')}/.Termit" + location = "#{File.expand_path('~')}/.termit" create_target_dir location File.open("#{location}/sound_response.mpeg", "wb") do |file| file.write(@data) end system "mpg123 -q #{location}/sound_response.mpeg"