• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Never give up


Commit MetaInfo

Révision7587a8d995a595809929aba41a8afe4c1f108e81 (tree)
l'heure2013-11-06 02:26:25
AuteurHMML <hmml3939@gmai...>
CommiterHMML

Message de Log

Lock rubyzip to 0.9.x temporary...

Change Summary

Modification

--- a/Gemfile
+++ b/Gemfile
@@ -58,7 +58,7 @@ gem 'client_side_validations-simple_form', git: 'git://github.com/saveritemedica
5858 gem 'responders'
5959 gem 'rspec-rails', group: [:development, :test]
6060 gem 'paperclip'
61-gem 'rubyzip', require: 'zip/zip'
61+gem 'rubyzip', '< 1.0.0', require: 'zip/zip'
6262 gem 'rails_admin', github: 'davebrace/rails_admin', branch: 'use-static-bootstrap-2'
6363 group :develpment do
6464 gem 'capistrano'
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -244,7 +244,7 @@ DEPENDENCIES
244244 rails_autolink (~> 1.1.5)
245245 responders
246246 rspec-rails
247- rubyzip
247+ rubyzip (< 1.0.0)
248248 sass-rails (~> 4.0.0)
249249 sdoc
250250 simple_form (~> 3.0.0.rc)
--- a/lib/paperclip_processors/voice_preview.rb
+++ b/lib/paperclip_processors/voice_preview.rb
@@ -15,26 +15,24 @@ class VoicePreview < Paperclip::Processor
1515
1616 begin
1717 tfiles = []
18- Zip::ZipFile.open src.path do |zf|
19- zf.each do |ze|
20- i = nil
21- case ze.name.downcase
22- when "7.ogg"
23- i = "01"
24- when "then.ogg"
25- i = "02"
26- when "12.ogg"
27- i = "03"
28- else
29- next
30- end
31- tfiles << (tf = "#{tmpdir}/#{i}.ogg")
32- open(tf, "w") do |of|
33- of.binmode
34- zs = zf.get_input_stream(ze)
35- while buf = zs.read(ZIP_BUFSIZE)
36- of << buf
37- end
18+ Zip::ZipFile.foreach(src.path) do |ze|
19+ i = nil
20+ case ze.name.downcase
21+ when "7.ogg"
22+ i = "01"
23+ when "then.ogg"
24+ i = "02"
25+ when "12.ogg"
26+ i = "03"
27+ else
28+ next
29+ end
30+ tfiles << (tf = "#{tmpdir}/#{i}.ogg")
31+ open(tf, "w") do |of|
32+ of.binmode
33+ zs = ze.get_input_stream
34+ while buf = zs.read(ZIP_BUFSIZE)
35+ of << buf
3836 end
3937 end
4038 end
@@ -53,7 +51,7 @@ class VoicePreview < Paperclip::Processor
5351 end
5452 system(*['sox', tfiles.sort, dst_path].flatten) or raise I18n.t("voice_preview.err_concat")
5553 rescue => e
56- Rails.logger.error "Error: Failed to generate preview voice: #{e.message}, last error is #{$?}"
54+ Rails.logger.error "Failed to generate preview voice: #{e.backtrace.first}: #{e.message}, last error is #{$?}"
5755 FileUtils.mkdir_p "#{Rails.root}/tmp/failed"
5856 failed_path = "#{Rails.root}/tmp/failed/#{Time.now.to_i}.zip"
5957 Rails.logger.error "Keeping failed archive to '#{failed_path}'"