rmega 0.1.7 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/TODO.md +3 -5
- data/bin/rmega-dl +47 -0
- data/bin/rmega-up +31 -0
- data/lib/rmega.rb +35 -3
- data/lib/rmega/api_response.rb +80 -0
- data/lib/rmega/cli.rb +121 -0
- data/lib/rmega/crypto.rb +20 -0
- data/lib/rmega/crypto/aes_cbc.rb +46 -0
- data/lib/rmega/crypto/aes_ctr.rb +15 -84
- data/lib/rmega/crypto/aes_ecb.rb +25 -0
- data/lib/rmega/crypto/rsa.rb +21 -12
- data/lib/rmega/errors.rb +3 -51
- data/lib/rmega/loggable.rb +0 -3
- data/lib/rmega/net.rb +56 -0
- data/lib/rmega/nodes/deletable.rb +0 -3
- data/lib/rmega/nodes/downloadable.rb +73 -30
- data/lib/rmega/nodes/expandable.rb +14 -10
- data/lib/rmega/nodes/factory.rb +30 -17
- data/lib/rmega/nodes/file.rb +0 -4
- data/lib/rmega/nodes/folder.rb +4 -14
- data/lib/rmega/nodes/inbox.rb +0 -2
- data/lib/rmega/nodes/node.rb +48 -25
- data/lib/rmega/nodes/node_key.rb +44 -0
- data/lib/rmega/nodes/root.rb +0 -4
- data/lib/rmega/nodes/trash.rb +0 -3
- data/lib/rmega/nodes/uploadable.rb +42 -33
- data/lib/rmega/not_inspectable.rb +10 -0
- data/lib/rmega/options.rb +22 -5
- data/lib/rmega/pool.rb +18 -7
- data/lib/rmega/progress.rb +53 -13
- data/lib/rmega/session.rb +125 -52
- data/lib/rmega/storage.rb +25 -21
- data/lib/rmega/utils.rb +23 -183
- data/lib/rmega/version.rb +2 -1
- data/rmega.gemspec +3 -5
- data/spec/integration/file_download_spec.rb +14 -32
- data/spec/integration/file_integrity_spec.rb +41 -0
- data/spec/integration/file_upload_spec.rb +11 -57
- data/spec/integration/folder_download_spec.rb +17 -0
- data/spec/integration/folder_operations_spec.rb +30 -30
- data/spec/integration/login_spec.rb +3 -3
- data/spec/integration/resume_download_spec.rb +53 -0
- data/spec/integration_spec_helper.rb +9 -4
- data/spec/rmega/lib/cli_spec.rb +12 -0
- data/spec/rmega/lib/session_spec.rb +31 -0
- data/spec/rmega/lib/storage_spec.rb +27 -0
- data/spec/rmega/lib/utils_spec.rb +16 -78
- data/spec/spec_helper.rb +1 -4
- metadata +30 -40
- data/lib/rmega/crypto/aes.rb +0 -35
- data/lib/rmega/crypto/crypto.rb +0 -107
- data/lib/rmega/crypto/rsa_mega.js +0 -455
- data/spec/rmega/lib/crypto/aes_spec.rb +0 -12
- data/spec/rmega/lib/crypto/crypto_spec.rb +0 -27
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Rmega::Crypto::Aes do
|
4
|
-
describe '#encrypt' do
|
5
|
-
it 'returns the expect result' do
|
6
|
-
data = [447236115, -1585310199, -1864656235, -1137211605]
|
7
|
-
key = [1380895471, 1656741118, 372674858, 886637722]
|
8
|
-
result = [-1780228062, 945709550, 1098116349, -1813988988]
|
9
|
-
described_class.encrypt(key, data).should == result
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Rmega::Crypto do
|
4
|
-
describe '#prepare_key' do
|
5
|
-
it 'returns the expected value' do
|
6
|
-
data = [1684081408, -1313687523, 845282884, -1735274811]
|
7
|
-
result = [1380895471, 1656741118, 372674858, 886637722]
|
8
|
-
described_class.prepare_key(data).should == result
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '#prepare_key_pw' do
|
13
|
-
it 'returns the expected value' do
|
14
|
-
password = "my kingdom 4 a horse"
|
15
|
-
result = [-24267049, 354638668, -845953520, 1348163508]
|
16
|
-
described_class.prepare_key_pw(password).should == result
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe '#stringhash' do
|
21
|
-
it 'returns the expected value' do
|
22
|
-
string = 'sjobs@apple.com'
|
23
|
-
key = [-812846736, -655070268, -844240819, 1006009750]
|
24
|
-
described_class.stringhash(key, string).should == 'snWuwnlz45w'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|