rmega 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/rmega-dl +1 -1
- data/bin/rmega-up +1 -1
- data/lib/rmega/cli.rb +1 -1
- data/lib/rmega/nodes/downloadable.rb +2 -2
- data/lib/rmega/version.rb +1 -1
- data/spec/integration/resume_download_spec.rb +1 -1
- data/spec/integration_spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a9f179d9de0f1297edcedc8f80863f784390f7e0e481df108c733b81fae0b4d
|
4
|
+
data.tar.gz: dca55b7b3ea2b7699dd5e4e5bb3e946944b5429ba61394886f7d38846f69711a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0d5c78d11697066743e0ae189df51253511722d57ed642891d4e1cb477fb2790d77bf7b0eda64b1265770a7629a004170ee3954eef2a66723f01d3d7852d612
|
7
|
+
data.tar.gz: 91a3462a8deee6b6c932666caa9bfd6f4ae8006a4e420c4c1cf3f47187ba3916be2d36403d74ad7ad55c2e54ae21bfbd0a0deab916bddb8e00762a05848dcb0d
|
data/bin/rmega-dl
CHANGED
@@ -46,7 +46,7 @@ cli_rescue do
|
|
46
46
|
urls = [cli_options[:url]]
|
47
47
|
else
|
48
48
|
# A text file with a list of MEGA urls (considering only files < 1 Mb)
|
49
|
-
if File.
|
49
|
+
if File.exist?(cli_options[:url])
|
50
50
|
if File.size(cli_options[:url]) < 1_000_000
|
51
51
|
File.open(cli_options[:url], "rb") do |file|
|
52
52
|
file.each_line do |line|
|
data/bin/rmega-up
CHANGED
@@ -30,7 +30,7 @@ OptionParser.new do |opts|
|
|
30
30
|
end.parse!
|
31
31
|
|
32
32
|
cli_rescue do
|
33
|
-
raise("File not found - #{cli_options[:path]}") unless File.
|
33
|
+
raise("File not found - #{cli_options[:path]}") unless File.exist?(cli_options[:path])
|
34
34
|
|
35
35
|
user = cli_options[:user] || raise("User email is required")
|
36
36
|
session = Rmega::Session.new.login(user, cli_options[:pass] ||= cli_prompt_password)
|
data/lib/rmega/cli.rb
CHANGED
@@ -27,7 +27,7 @@ module Rmega
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def read_configuration_file
|
30
|
-
return {} unless File.
|
30
|
+
return {} unless File.exist?(configuration_filepath)
|
31
31
|
|
32
32
|
opts = YAML.load_file(configuration_filepath)
|
33
33
|
opts.keys.each { |k| opts[k.to_sym] = opts.delete(k) } # symbolize_keys!
|
@@ -22,7 +22,7 @@ module Rmega
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def allocated?(path)
|
25
|
-
::File.
|
25
|
+
::File.exist?(path) and ::File.size(path) == filesize
|
26
26
|
end
|
27
27
|
|
28
28
|
# Writes a buffer in the local file, starting from the start-n byte.
|
@@ -67,7 +67,7 @@ module Rmega
|
|
67
67
|
|
68
68
|
def download(path)
|
69
69
|
path = ::File.expand_path(path)
|
70
|
-
path = Dir.
|
70
|
+
path = Dir.exist?(path) ? ::File.join(path, name) : path
|
71
71
|
|
72
72
|
progress = Progress.new(filesize, caption: 'Allocate', filename: self.name)
|
73
73
|
pool = Pool.new
|
data/lib/rmega/version.rb
CHANGED
@@ -21,7 +21,7 @@ module Rmega
|
|
21
21
|
end
|
22
22
|
|
23
23
|
loop do
|
24
|
-
next unless File.
|
24
|
+
next unless File.exist?(destination_file)
|
25
25
|
content = nil
|
26
26
|
node.file_io_synchronize { content = File.read(destination_file) }
|
27
27
|
break if content.force_encoding("BINARY").strip.size > 2_000_000
|
@@ -11,7 +11,7 @@ end
|
|
11
11
|
def account
|
12
12
|
if ENV["MEGA_EMAIL"] and ENV["MEGA_PASSWORD"]
|
13
13
|
{'email' => ENV["MEGA_EMAIL"], 'password' => ENV["MEGA_PASSWORD"]}
|
14
|
-
elsif File.
|
14
|
+
elsif File.exist?(account_file_path)
|
15
15
|
YAML.load_file(account_file_path)
|
16
16
|
else
|
17
17
|
nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- topac
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pbkdf2-ruby
|