Module: Paste::Compress

Extended by:
ActiveSupport::Concern
Defined in:
lib/paste/compress.rb

Instance Method Summary collapse

Instance Method Details

#compress(result, options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/paste/compress.rb', line 20

def compress result, options = {}
  case options[:compress]
    when 'google'
      google_compress result, options.except(:compress)
    when nil, false
      # Compression not asked for
    else
      raise "Unknown compression technique: #{options[:compress]}"
  end
end

#rebuild_with_compression!(options = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/paste/compress.rb', line 12

def rebuild_with_compression! options = {}
  rebuild_without_compression!

  results.keys.each do |result|
    compress result, options
  end
end