Sha256: 913b9b911ddca7a3617fe603f4149e5adc69fd3c300a3173422e63e5a8b83d60

Contents?: true

Size: 465 Bytes

Versions: 9

Compression:

Stored size: 465 Bytes

Contents

module Maid::Downloading
  class << self
    def downloading?(path)
      !!(downloading_file_regexps.any? { |re| path.match(re) } || firefox_extra?(path) || aria2_extra?(path))
    end

    def downloading_file_regexps
      [/\.crdownload$/, /\.download$/, /\.aria2$/, /\.td$/, /\.td.cfg$/, /\.part$/]
    end

    def firefox_extra?(path)
      File.exist?("#{path}.part")
    end

    def aria2_extra?(path)
      File.exist?("#{path}.aria2")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
maid-0.10.0 lib/maid/downloading.rb
maid-0.10.0.pre.alpha.3 lib/maid/downloading.rb
maid-0.10.0.pre.alpha.2 lib/maid/downloading.rb
maid-0.10.0.pre.alpha.1 lib/maid/downloading.rb
maid-0.9.0.alpha.2 lib/maid/downloading.rb
maid-0.9.0.alpha.1 lib/maid/downloading.rb
maid-0.8.0.alpha.4 lib/maid/downloading.rb
maid-0.8.0.alpha.3 lib/maid/downloading.rb
maid-0.8.0.alpha.2 lib/maid/downloading.rb