yotsuba 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cebbf4e4596c2d1ba5105d93b01d08f217973d18
4
- data.tar.gz: 248551e062b33657f79bcfe217c726790780a096
3
+ metadata.gz: 48d3289804f7c84c1eed41d3bf2fb32b1531a05a
4
+ data.tar.gz: b6a84c8f189a424e2a5b5d180c686a6db9b9f023
5
5
  SHA512:
6
- metadata.gz: 50deeea2270c036f0206f5c30511c39fa507b714ee900e8cc6e36a951135d9e31b267aa907d817ba45d62f8db0cdba425ca6b9a2763fbd02a4cfea345a02f495
7
- data.tar.gz: 1d30a778451ff5f89f32d00e2d69d3cb0ea385e5323f57e2deb64667eb4531da4050eca95cdeaa0570c299267ec64bcfdde240e9639eef350c12762bfd700dc0
6
+ metadata.gz: 3ec3be4b889ef85639bd6d4466186011d84753008a946db110d6edfdbd5aa4fc422d3614d0d0f4edb94ca072cb16a65ab6fd9caf18701ad63dc5c1f3fc8a335f
7
+ data.tar.gz: f298bf48eb88c324974732bd55137ecdabc568fae5626d8f7d530ebc539532d95490d65fa00308d67a86260f2840f141b2419aca300cd6ccb41aad238d301a18
@@ -43,6 +43,7 @@ module Yotsuba
43
43
  match = check_property(anime, :id, hash) || check_property(anime, :title, hash)
44
44
  return match if match
45
45
  end
46
+ return nil
46
47
  end
47
48
 
48
49
  def self.find(id)
@@ -29,7 +29,7 @@ module Yotsuba
29
29
  end
30
30
 
31
31
  def run
32
- @path = @multiple ? File.join(@output_dir, @filename+".zip") : @path = File.join(@output_dir, @filename)
32
+ @path = @multiple ? File.join(@output_dir, @file.name+".zip") : @path = File.join(@output_dir, @file.name)
33
33
 
34
34
  FileUtils.mkdir_p @output_dir
35
35
 
@@ -48,8 +48,16 @@ module Yotsuba
48
48
  self.async.run
49
49
  end
50
50
 
51
+ def abort
52
+ finish_request
53
+ @status = "Aborted"
54
+ end
55
+
51
56
  def delete
57
+ abort if @status != "Aborted"
52
58
  File.delete(@path) if @path
59
+ @@all_downloads -= [self]
60
+ return true
53
61
  end
54
62
 
55
63
  def bytes_written
@@ -81,6 +89,7 @@ module Yotsuba
81
89
 
82
90
  return match if match
83
91
  end
92
+ return nil
84
93
  end
85
94
 
86
95
  def self.find(id)
@@ -1,3 +1,3 @@
1
1
  module Yotsuba
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yotsuba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suchipi Izumi