boxlet 0.2.3 → 0.2.5
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/config.yml +1 -0
- data/lib/boxlet/app/controller.rb +13 -4
- data/lib/boxlet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30054052af4a54d69ba6580adf2ba09790426b7f
|
|
4
|
+
data.tar.gz: 2d045f5a3b4f252446ee7f9e7965d109b7c5bcda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 497d7d5f65687c6c840147b8272d9512dac81fd5296a456d7cc9d230402a5ba52d1f2799ad7e680853d4b56444b351f375f616a7815689d6e9b7e9c711ddf489
|
|
7
|
+
data.tar.gz: ef9b10ae3bc60fbfaca5d9c4c567ab3a36c1cf0c1b3e3deba29c8b29b88d8e43aadfb037b791d3f5f995159752c947531cadb0de5a9fb32660fec3663a8cd324
|
data/config.yml
CHANGED
|
@@ -77,7 +77,8 @@ module Boxlet
|
|
|
77
77
|
{
|
|
78
78
|
capacity: Boxlet::Util.app_space_capacity,
|
|
79
79
|
usage: Boxlet::Util.app_space_usage,
|
|
80
|
-
free_space: free_space
|
|
80
|
+
free_space: free_space?,
|
|
81
|
+
base_upload_path: base_upload_path
|
|
81
82
|
}
|
|
82
83
|
end
|
|
83
84
|
|
|
@@ -145,7 +146,7 @@ module Boxlet
|
|
|
145
146
|
@format = :json
|
|
146
147
|
|
|
147
148
|
uuid = @params[:uuid]
|
|
148
|
-
db.collection('assets').find({uuid: uuid}).to_a
|
|
149
|
+
stats.merge(assets: db.collection('assets').find({uuid: uuid}).to_a)
|
|
149
150
|
end
|
|
150
151
|
|
|
151
152
|
def file_info
|
|
@@ -171,13 +172,13 @@ module Boxlet
|
|
|
171
172
|
|
|
172
173
|
date = Date.parse(@params[:date])
|
|
173
174
|
uuid = @params[:uuid]
|
|
174
|
-
db.collection('assets').find({
|
|
175
|
+
stats.merge(assets: db.collection('assets').find({
|
|
175
176
|
uuid: uuid,
|
|
176
177
|
asset_date: {
|
|
177
178
|
'$gte' => date.to_time.strftime('%F'),
|
|
178
179
|
'$lt' => (date + 1).to_time.strftime('%F')
|
|
179
180
|
}
|
|
180
|
-
}).to_a
|
|
181
|
+
}).to_a)
|
|
181
182
|
end
|
|
182
183
|
|
|
183
184
|
|
|
@@ -215,5 +216,13 @@ module Boxlet
|
|
|
215
216
|
def free_space?
|
|
216
217
|
Boxlet::Util.free_space > 50
|
|
217
218
|
end
|
|
219
|
+
|
|
220
|
+
def base_upload_path
|
|
221
|
+
if Boxlet.config[:s3][:enabled]
|
|
222
|
+
"https://s3.amazonaws.com/#{Boxlet.config[:s3][:bucket]}/#{@params[:uuid]}"
|
|
223
|
+
else
|
|
224
|
+
"http://#{Boxlet.config[:public_url]}/#{Boxlet.config[:upload_dir]}/#{Digest::MD5.hexdigest(@params[:uuid])}"
|
|
225
|
+
end
|
|
226
|
+
end
|
|
218
227
|
end
|
|
219
228
|
end
|
data/lib/boxlet/version.rb
CHANGED