atlas 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Rakefile +0 -9
- data/atlas.gemspec +3 -8
- data/lib/atlas/box_provider.rb +13 -5
- data/lib/atlas/version.rb +1 -1
- metadata +10 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 546b060a3609f4b83b4948d7b688873e4d0a318a
|
4
|
+
data.tar.gz: b06feea0a34e6e6dbcc82a9cad2538661641a40e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7067a265025989f0039ba21a1560cea2fa5588e92fb077578842dede55cec8151ead1639f5cdc8d54285ac763dd64a6f870bd4e27f184b63b80142ddbd22ec59
|
7
|
+
data.tar.gz: 554207c239b7721a080cd9cc15a64b54879029d9c9ad08f1d61aa620fa4c5fc33b5c10aa26ef8a358ebc114701526f24af12bdf5ac10e9eae1f87db0d7bc6f24
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## 1.
|
3
|
+
## 1.4.0 (16/10/2016)
|
4
|
+
|
5
|
+
* Allows providing a callback for file uploads so that it's possible to monitor
|
6
|
+
the upload progress ([#7][]).
|
7
|
+
|
8
|
+
## 1.3.0 (15/02/2016)
|
4
9
|
|
5
10
|
* Adds timestamps to `Box`, `BoxVersion` and `BoxProvider`.
|
6
11
|
|
@@ -29,3 +34,4 @@
|
|
29
34
|
|
30
35
|
[#1]: https://github.com/nickcharlton/atlas-ruby/issues/1
|
31
36
|
[#2]: https://github.com/nickcharlton/atlas-ruby/issues/2
|
37
|
+
[#7]: https://github.com/nickcharlton/atlas-ruby/pull/7
|
data/Rakefile
CHANGED
@@ -16,15 +16,6 @@ require 'rspec/core/rake_task'
|
|
16
16
|
|
17
17
|
RSpec::Core::RakeTask.new
|
18
18
|
|
19
|
-
##
|
20
|
-
# RuboCop
|
21
|
-
##
|
22
|
-
require 'rubocop/rake_task'
|
23
|
-
|
24
|
-
RuboCop::RakeTask.new do |task|
|
25
|
-
task.requires << 'rubocop-rspec'
|
26
|
-
end
|
27
|
-
|
28
19
|
##
|
29
20
|
# By default, just run the tests.
|
30
21
|
##
|
data/atlas.gemspec
CHANGED
@@ -20,13 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
22
|
spec.add_dependency 'excon', '~> 0.45'
|
23
|
-
spec.add_dependency 'json', '~> 1.8'
|
24
23
|
|
25
|
-
spec.add_development_dependency '
|
26
|
-
spec.add_development_dependency '
|
27
|
-
spec.add_development_dependency '
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.2'
|
29
|
-
spec.add_development_dependency 'rubocop', '~> 0.32'
|
30
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.3'
|
31
|
-
spec.add_development_dependency 'pry'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'vcr'
|
26
|
+
spec.add_development_dependency 'rspec'
|
32
27
|
end
|
data/lib/atlas/box_provider.rb
CHANGED
@@ -67,13 +67,21 @@ module Atlas
|
|
67
67
|
# Upload a .box file for this provider.
|
68
68
|
#
|
69
69
|
# @param [File] file a File object for the file.
|
70
|
-
def upload(file)
|
71
|
-
# get the path for upload
|
70
|
+
def upload(file, chunk_size = nil)
|
72
71
|
response = Atlas.client.get("#{url_builder.box_provider_url}/upload")
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
chunk_size ||= Excon.defaults[:chunk_size]
|
74
|
+
progress = 0
|
75
|
+
|
76
|
+
chunker = lambda do
|
77
|
+
progress += chunk_size
|
78
|
+
yield(progress, file.size) if block_given?
|
79
|
+
|
80
|
+
file.read(chunk_size).to_s
|
81
|
+
end
|
82
|
+
|
83
|
+
upload_url = response["upload_path"]
|
84
|
+
Excon.put(upload_url, request_block: chunker)
|
77
85
|
end
|
78
86
|
|
79
87
|
# Delete the provider.
|
data/lib/atlas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Charlton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -24,106 +24,36 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.45'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: json
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.8'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.8'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.9'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.9'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: rake
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
|
-
- - "
|
31
|
+
- - ">="
|
60
32
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
33
|
+
version: '0'
|
62
34
|
type: :development
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
|
-
- - "
|
38
|
+
- - ">="
|
67
39
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
40
|
+
version: '0'
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
42
|
name: vcr
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
72
44
|
requirements:
|
73
|
-
- - "
|
45
|
+
- - ">="
|
74
46
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
47
|
+
version: '0'
|
76
48
|
type: :development
|
77
49
|
prerelease: false
|
78
50
|
version_requirements: !ruby/object:Gem::Requirement
|
79
51
|
requirements:
|
80
|
-
- - "
|
52
|
+
- - ">="
|
81
53
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
54
|
+
version: '0'
|
83
55
|
- !ruby/object:Gem::Dependency
|
84
56
|
name: rspec
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '3.2'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '3.2'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.32'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0.32'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop-rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.3'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.3'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: pry
|
127
57
|
requirement: !ruby/object:Gem::Requirement
|
128
58
|
requirements:
|
129
59
|
- - ">="
|