lib/webtranslateit/safe/archive.rb in webtranslateit-safe-0.4.3 vs lib/webtranslateit/safe/archive.rb in webtranslateit-safe-0.4.4
- old
+ new
@@ -1,24 +1,29 @@
module WebTranslateIt
+
module Safe
+
class Archive < Source
def command
"tar -cf - #{config[:options]} #{tar_exclude_files} #{tar_files}"
end
- def extension; '.tar'; end
+ def extension = '.tar'
protected
def tar_exclude_files
- [*config[:exclude]].compact.map{|x| "--exclude=#{x}"}.join(' ')
+ [*config[:exclude]].compact.map { |x| "--exclude=#{x}" }.join(' ')
end
def tar_files
- raise RuntimeError, 'missing files for tar' unless config[:files]
- [*config[:files]].map{|s| s.strip}.join(' ')
+ raise 'missing files for tar' unless config[:files]
+
+ [*config[:files]].map(&:strip).join(' ')
end
end
+
end
+
end