lib/uricp/strategy/piped_local_decompress.rb in uricp-0.0.15 vs lib/uricp/strategy/piped_local_decompress.rb in uricp-0.0.16
- old
+ new
@@ -1,21 +1,17 @@
module Uricp::Strategy
-
class PipedLocalDecompress
-
include Uricp::Strategy::Common
def appropriate?
case from.scheme
when 'pipe'
- if raw_target? && lz4_source? && to.scheme == 'file'
- if always_write_sparse?
- return proposal
- else
- debug "#{self.class.name}: using safe sparse expansion via stream"
- end
- end
+ if raw_target? && lz4_source? && to.scheme == 'file'
+ return proposal if always_write_sparse?
+
+ debug "#{self.class.name}: using safe sparse expansion via stream"
+ end
end
debug "#{self.class.name}: not appropriate"
false
end
@@ -25,18 +21,16 @@
def proposal
@proposed_options = options.dup
@proposed_options.delete('source-format')
if @proposed_options['target-format']
- @proposed_options['source-format'] = :raw
- if @proposed_options['source-format'] == @proposed_options['target-format']
- @proposed_options.delete('source-format')
- @proposed_options.delete('target-format')
- end
+ @proposed_options['source-format'] = :raw
+ if @proposed_options['source-format'] == @proposed_options['target-format']
+ @proposed_options.delete('source-format')
+ @proposed_options.delete('target-format')
+ end
end
@proposed_options['from_uri'] = @proposed_options['to_uri']
self
end
-
end
-
end