scissor 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ DESCRIPTION = "utility to chop sound files"
17
17
  RUBYFORGE_PROJECT = "scissor"
18
18
  HOMEPATH = "http://github.com/youpy/scissor"
19
19
  BIN_FILES = %w( )
20
- VERS = "0.0.24"
20
+ VERS = "0.0.25"
21
21
 
22
22
  REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
23
23
  CLEAN.include ['**/.*.sw?', '*.gem', '.config']
@@ -57,9 +57,9 @@ spec = Gem::Specification.new do |s|
57
57
  s.homepage = HOMEPATH
58
58
  s.test_files = Dir["test/test_*.rb"]
59
59
 
60
- s.add_dependency('open4')
60
+ s.add_dependency('open4', '<= 1.0.1')
61
61
  s.add_dependency('ruby-mp3info')
62
- s.add_dependency('riff')
62
+ s.add_dependency('riff', '<= 0.3.0')
63
63
  s.add_dependency('tempdir')
64
64
  #s.required_ruby_version = '>= 1.8.2'
65
65
 
data/lib/scissor/chunk.rb CHANGED
@@ -179,5 +179,9 @@ module Scissor
179
179
  def >>(filename)
180
180
  to_file(filename, :overwrite => true)
181
181
  end
182
+
183
+ def silence
184
+ Scissor.silence(duration)
185
+ end
182
186
  end
183
187
  end
@@ -38,7 +38,7 @@ module Scissor
38
38
 
39
39
  fragment_outfile =
40
40
  fragment_filename.extname.downcase == '.wav' ? fragment_filename :
41
- tmpdir + (Digest::MD5.hexdigest(fragment_filename) + '.wav')
41
+ tmpdir + (Digest::MD5.hexdigest(fragment_filename.to_s) + '.wav')
42
42
 
43
43
  unless fragment_outfile.exist?
44
44
  run_command("ffmpeg -i \"#{fragment_filename}\" \"#{fragment_outfile}\"")
@@ -116,12 +116,9 @@ module Scissor
116
116
  def run_command(cmd)
117
117
  logger.debug("run_command: #{cmd}")
118
118
 
119
- result = ''
120
- status = Open4.popen4(cmd) do |pid, stdin, stdout, stderr|
121
- stdin.close
122
- logger.debug(stderr.read)
123
- result = stdout.read
124
- end
119
+ result, error = '', ''
120
+ status = Open4.spawn cmd, 'stdout' => result, 'stderr' => error
121
+ logger.debug(error)
125
122
 
126
123
  if status.exitstatus != 0
127
124
  raise CommandFailed.new(cmd)
data/lib/scissor.rb CHANGED
@@ -53,3 +53,19 @@ module Scissor
53
53
  end
54
54
  end
55
55
  end
56
+
57
+ # for ruby 1.9
58
+ if IO.instance_methods.include? :getbyte
59
+ class << Riff::Reader::Chunk
60
+ alias :read_bytes_to_int_original :read_bytes_to_int
61
+ def read_bytes_to_int file, bytes
62
+ require 'delegate'
63
+ file_delegate = SimpleDelegator.new(file)
64
+ def file_delegate.getc
65
+ getbyte
66
+ end
67
+ read_bytes_to_int_original file_delegate, bytes
68
+ end
69
+ end
70
+ end
71
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 24
9
- version: 0.0.24
8
+ - 25
9
+ version: 0.0.25
10
10
  platform: ruby
11
11
  authors:
12
12
  - youpy
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-28 00:00:00 +09:00
17
+ date: 2010-12-22 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -22,11 +22,13 @@ dependencies:
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - <=
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
+ - 1
28
29
  - 0
29
- version: "0"
30
+ - 1
31
+ version: 1.0.1
30
32
  type: :runtime
31
33
  version_requirements: *id001
32
34
  - !ruby/object:Gem::Dependency
@@ -46,11 +48,13 @@ dependencies:
46
48
  prerelease: false
47
49
  requirement: &id003 !ruby/object:Gem::Requirement
48
50
  requirements:
49
- - - ">="
51
+ - - <=
50
52
  - !ruby/object:Gem::Version
51
53
  segments:
52
54
  - 0
53
- version: "0"
55
+ - 3
56
+ - 0
57
+ version: 0.3.0
54
58
  type: :runtime
55
59
  version_requirements: *id003
56
60
  - !ruby/object:Gem::Dependency