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:
12
lib/streamer.rb
Normal file
12
lib/streamer.rb
Normal 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
|
Reference in New Issue
Block a user