Permalink
Browse files

rename Scissor::Chunk to Scissor::Tape

  • Loading branch information...
1 parent 827ae56 commit 19a1b00a15b05c6a2b51d183a56f097d95982f42 @youpy committed Dec 2, 2011
Showing with 12 additions and 12 deletions.
  1. +3 −3 lib/scissor.rb
  2. +1 −1 lib/scissor/{chunk.rb → tape.rb}
  3. +5 −5 spec/scissor_spec.rb
  4. +3 −3 spec/sequence_spec.rb
View
@@ -1,15 +1,15 @@
require 'scissor/loggable'
-require 'scissor/chunk'
+require 'scissor/tape'
require 'scissor/fragment'
require 'scissor/sound_file'
require 'scissor/sequence'
require 'scissor/writer'
def Scissor(filename_or_url = nil)
if filename_or_url && filename_or_url =~ /^http/
- Scissor::Chunk.new_from_url(filename_or_url)
+ Scissor::Tape.new_from_url(filename_or_url)
else
- Scissor::Chunk.new(filename_or_url)
+ Scissor::Tape.new(filename_or_url)
end
end
@@ -2,7 +2,7 @@
require 'tempfile'
module Scissor
- class Chunk
+ class Tape
class Error < StandardError; end
class EmptyFragment < Error; end
class OutOfDuration < Error; end
View
@@ -26,7 +26,7 @@
mp3 = Scissor(url)
- mp3.should be_an_instance_of(Scissor::Chunk)
+ mp3.should be_an_instance_of(Scissor::Tape)
mp3.duration.should be_close(178.1, 0.1)
end
@@ -203,21 +203,21 @@
b = @mp3.slice(150, 20)
scissor = Scissor.mix([a, b], '/tmp/scissor-test/out.mp3')
- scissor.should be_an_instance_of(Scissor::Chunk)
+ scissor.should be_an_instance_of(Scissor::Tape)
scissor.duration.should be_close(120, 0.1)
scissor.fragments.size.should eql(1)
end
it "should raise error if replaced range is out of duration" do
lambda {
@mp3.slice(0, 100).replace(60, 41, @mp3.slice(0, 60))
- }.should raise_error(Scissor::Chunk::OutOfDuration)
+ }.should raise_error(Scissor::Tape::OutOfDuration)
end
it "should write to file and return new instance of Scissor" do
scissor = @mp3.slice(0, 120) + @mp3.slice(150, 20)
result = scissor.to_file('/tmp/scissor-test/out.mp3')
- result.should be_an_instance_of(Scissor::Chunk)
+ result.should be_an_instance_of(Scissor::Tape)
result.duration.should be_close(140, 0.1)
end
@@ -241,7 +241,7 @@
it "should write to file with many fragments" do
scissor = (@mp3.slice(0, 120) / 100).inject(Scissor()){|m, s| m + s } + @mp3.slice(10, 20)
result = scissor.to_file('/tmp/scissor-test/out.mp3')
- result.should be_an_instance_of(Scissor::Chunk)
+ result.should be_an_instance_of(Scissor::Tape)
result.duration.should be_close(140, 0.1)
end
View
@@ -13,11 +13,11 @@
seq.should be_an_instance_of(Scissor::Sequence)
end
- it "should apply chunk as instrument" do
+ it "should apply tape as instrument" do
seq = Scissor.sequence('ababaab ab', 0.5)
scissor = seq.apply(:a => @foo, :b => @bar)
- scissor.should be_an_instance_of(Scissor::Chunk)
+ scissor.should be_an_instance_of(Scissor::Tape)
scissor.duration.should eql(5.0)
scissor.fragments.size.should eql(10)
@@ -40,7 +40,7 @@
seq = Scissor.sequence('ababaab ab', 0.5)
scissor = seq.apply(:a => Proc.new { @foo }, :b => Proc.new { @bar })
- scissor.should be_an_instance_of(Scissor::Chunk)
+ scissor.should be_an_instance_of(Scissor::Tape)
scissor.duration.should eql(5.0)
scissor.fragments.size.should eql(10)

0 comments on commit 19a1b00

Please sign in to comment.