Implement track/stream

* Add Streamer class
* Use FactoryGirl for factories
* Add sha256 field to tracks
* Add mime_type field to tracks
This commit is contained in:
Thibault Jouan
2011-07-23 16:30:51 +00:00
parent 47fa969617
commit 2f6a447416
18 changed files with 166 additions and 51 deletions

12
lib/streamer.rb Normal file
View File

@@ -0,0 +1,12 @@
class Streamer
def initialize(file)
@file = file
end
def each
f = File.new(@file, 'r')
while data = f.read(4096) do
yield data
end
end
end