youpy-scissor 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/lib/scissor/chunk.rb +6 -7
- data/lib/scissor/fragment.rb +1 -1
- metadata +12 -2
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ DESCRIPTION = "utility to chop sound files"
|
|
17
17
|
RUBYFORGE_PROJECT = "scissor"
|
18
18
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
19
19
|
BIN_FILES = %w( )
|
20
|
-
VERS = "0.0.
|
20
|
+
VERS = "0.0.19"
|
21
21
|
|
22
22
|
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
23
23
|
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
@@ -60,6 +60,7 @@ spec = Gem::Specification.new do |s|
|
|
60
60
|
s.add_dependency('open4')
|
61
61
|
s.add_dependency('ruby-mp3info')
|
62
62
|
s.add_dependency('riff')
|
63
|
+
s.add_dependency('tempdir')
|
63
64
|
#s.required_ruby_version = '>= 1.8.2'
|
64
65
|
|
65
66
|
s.files = %w(README.rdoc ChangeLog Rakefile) +
|
data/lib/scissor/chunk.rb
CHANGED
@@ -2,6 +2,7 @@ require 'digest/md5'
|
|
2
2
|
require 'pathname'
|
3
3
|
require 'open4'
|
4
4
|
require 'logger'
|
5
|
+
require 'temp_dir'
|
5
6
|
|
6
7
|
module Scissor
|
7
8
|
class Chunk
|
@@ -193,12 +194,12 @@ module Scissor
|
|
193
194
|
end
|
194
195
|
|
195
196
|
position = 0.0
|
196
|
-
tmpdir = Pathname.new('/tmp/scissor-' + $$.to_s)
|
197
|
-
tmpdir.mkpath
|
198
|
-
tmpfile = tmpdir + 'tmp.wav'
|
199
|
-
cmd = %w/ecasound/
|
200
197
|
|
201
|
-
|
198
|
+
TempDir.create do |dir|
|
199
|
+
tmpdir = Pathname.new(dir)
|
200
|
+
tmpfile = tmpdir + 'tmp.wav'
|
201
|
+
cmd = %w/ecasound/
|
202
|
+
|
202
203
|
@fragments.each_with_index do |fragment, index|
|
203
204
|
fragment_filename = fragment.filename
|
204
205
|
fragment_duration = fragment.duration
|
@@ -234,8 +235,6 @@ module Scissor
|
|
234
235
|
else
|
235
236
|
run_command("ffmpeg -i \"#{tmpfile}\" \"#{filename}\"")
|
236
237
|
end
|
237
|
-
ensure
|
238
|
-
tmpdir.rmtree
|
239
238
|
end
|
240
239
|
|
241
240
|
self.class.new(filename)
|
data/lib/scissor/fragment.rb
CHANGED
@@ -5,7 +5,7 @@ module Scissor
|
|
5
5
|
attr_reader :filename, :start, :duration
|
6
6
|
|
7
7
|
def initialize(filename, start, duration, reverse = false)
|
8
|
-
@filename = Pathname.new(filename)
|
8
|
+
@filename = Pathname.new(filename).realpath
|
9
9
|
@start = start
|
10
10
|
@duration = duration
|
11
11
|
@reverse = reverse
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: youpy-scissor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- youpy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-04 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -42,6 +42,16 @@ dependencies:
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: "0"
|
44
44
|
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: tempdir
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
45
55
|
description: utility to chop sound files
|
46
56
|
email: youpy@buycheapviagraonlinenow.com
|
47
57
|
executables: []
|