youpy-scissor-echonest 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -5
- data/Rakefile +3 -2
- data/lib/scissor/echonest.rb +27 -8
- data/spec/fixtures/get_segments.xml +2 -0
- data/spec/scissor-echonest_spec.rb +17 -1
- data/spec/spec.opts +2 -1
- metadata +25 -5
@@ -23,7 +23,23 @@ describe Scissor do
|
|
23
23
|
beats = scissor.beats
|
24
24
|
beats.size.should eql(384)
|
25
25
|
beats[0].should be_an_instance_of(Scissor::Chunk)
|
26
|
-
beats[0].duration.should eql(0.
|
26
|
+
beats[0].duration.should eql(0.47604)
|
27
27
|
beats[0].fragments.first.filename.to_s.should eql(fixture('sample.mp3'))
|
28
28
|
end
|
29
|
+
|
30
|
+
it 'should get segments' do
|
31
|
+
Scissor.echonest_api_key = 'XXX'
|
32
|
+
|
33
|
+
api = Echonest::Api.new('XXX')
|
34
|
+
api.connection.stub!(:request).and_return(open(fixture('get_segments.xml')).read)
|
35
|
+
|
36
|
+
scissor = Scissor(fixture('sample.mp3'))
|
37
|
+
scissor.stub!(:echonest).and_return(api)
|
38
|
+
|
39
|
+
segments = scissor.segments
|
40
|
+
segments.size.should eql(830)
|
41
|
+
segments[0].should be_an_instance_of(Scissor::Chunk)
|
42
|
+
segments[0].duration.should eql(0.30327)
|
43
|
+
segments[0].fragments.first.filename.to_s.should eql(fixture('sample.mp3'))
|
44
|
+
end
|
29
45
|
end
|
data/spec/spec.opts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
-c
|
2
|
+
-fs
|
metadata
CHANGED
@@ -1,18 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: youpy-scissor-echonest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- youpy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: scissor
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.19
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: ruby-echonest
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.3
|
34
|
+
version:
|
16
35
|
description: Scissor extension to use Echo Nest Developers API
|
17
36
|
email: youpy@buycheapviagraonlinenow.com
|
18
37
|
executables: []
|
@@ -28,6 +47,7 @@ files:
|
|
28
47
|
- Rakefile
|
29
48
|
- spec/fixtures
|
30
49
|
- spec/fixtures/get_beats.xml
|
50
|
+
- spec/fixtures/get_segments.xml
|
31
51
|
- spec/fixtures/sample.mp3
|
32
52
|
- spec/scissor-echonest_spec.rb
|
33
53
|
- spec/spec.opts
|