rmega 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: ee612b39a7d211f89deb0c30044ec6d75ae231da61314e73432389f96e7f7a0b
4
- data.tar.gz: 1742781c48533cea360740dc14f9b3d67bec0933e671605e3df4e0d4d2608a68
3
+ metadata.gz: 9a9f179d9de0f1297edcedc8f80863f784390f7e0e481df108c733b81fae0b4d
4
+ data.tar.gz: dca55b7b3ea2b7699dd5e4e5bb3e946944b5429ba61394886f7d38846f69711a
5
5
  SHA512:
6
- metadata.gz: 5cf7d33fe73f7626160d4045f27e48b546943fc492dca38c8f528f7ec0b3c07ed341527a8c17305b8448c08efd2aea3d44ecf517a1aaf9684f172830b6586c4a
7
- data.tar.gz: f919c67bd100e4e94c7f3dd4c319d0df784173a3a7f90d45b24914b4b8fa474196b4a858f89e414abfaa3301eac2e9c0bf3602d1f3d870010ec1c8c8a1d1511f
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.exists?(cli_options[:url])
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.exists?(cli_options[:path])
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.exists?(configuration_filepath)
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.exists?(path) and ::File.size(path) == filesize
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.exists?(path) ? ::File.join(path, name) : path
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
@@ -1,4 +1,4 @@
1
1
  module Rmega
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  HOMEPAGE = "https://github.com/topac/rmega"
4
4
  end
@@ -21,7 +21,7 @@ module Rmega
21
21
  end
22
22
 
23
23
  loop do
24
- next unless File.exists?(destination_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.exists?(account_file_path)
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.1
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-02-01 00:00:00.000000000 Z
11
+ date: 2023-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbkdf2-ruby