blobsterix 0.0.27 → 0.0.28

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
  SHA1:
3
- metadata.gz: 68fb2005862b18ec60e73f2864bad3eb88b9bd4c
4
- data.tar.gz: 1ac5546d2811121064aaf564b30342dfb8b911a9
3
+ metadata.gz: 357a34133e4c01a7f32d527d2c4f2a5f0ec76cd2
4
+ data.tar.gz: 9bdafb457d14a11db5a986dc327ba506330a7fb6
5
5
  SHA512:
6
- metadata.gz: 40889006e4d459f5d62a9828175a37ffa804b96e14d8692f64cb91df9362e0d0f8a599df3b070f0f85866ce7901a95005431a71f9d921d50bd140ec0e76d64f9
7
- data.tar.gz: cf49a09033e107cf4070e8739c586ff4a2d4bb0e9bdb89812874a24102f45cd70aea6862bad495a2053e8eb686982e01d80c6662cb2cb28cac2201c560667876
6
+ metadata.gz: 20448a19acf25b425f329587ba24012a577c06f1b02543d44f22f3527f1e71cb9e7e62058e67d7e4dae80750255a761e9c199a99c4a4d37ffd0c00160862e01e
7
+ data.tar.gz: 769cf61e0dc5968d3032a56d1200d56c119baa4701b37c83663df72f418a40a7eb643eda9f9ec1691c6560e67078551293fa1075d41e315e5c210bfcc18d6086
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,5 @@
1
+ = 0.0.28
2
+ * added header bucket option for s3 upload, added base64 decode/encode
1
3
  = 0.0.27
2
4
  * added mimetype recognition by extension for zip files
3
5
  = 0.0.26
@@ -31,6 +31,7 @@ module Blobsterix
31
31
  end
32
32
 
33
33
  def bucket
34
+ return env['HTTP_X_AMZ_BUCKET'] if env['HTTP_X_AMZ_BUCKET']
34
35
  host = bucket_matcher(env['HTTP_HOST'])
35
36
  if host
36
37
  host[1]
@@ -49,7 +50,7 @@ module Blobsterix
49
50
 
50
51
  def bucket?
51
52
  host = bucket_matcher(env['HTTP_HOST'])
52
- host || env[nil][:bucket] || included_bucket
53
+ host || env[nil][:bucket] || included_bucket || env['HTTP_X_AMZ_BUCKET']
53
54
  end
54
55
  end
55
56
  end
@@ -163,6 +163,17 @@ module Blobsterix::Transformations::Impl
163
163
  raise StandardError.new($?) unless system("convert \"#{input_path}\" png:\"#{target_path}\"")
164
164
  end
165
165
 
166
+ create_simple_trafo("base642bin", "text/plain", "*/*", false) do |input_path, target_path, value|
167
+ File.open(target_path, "w") { |io| io.write(Base64.decode64(File.read(input_path).split("base64,")[1])) }
168
+ end
169
+
170
+ create_simple_trafo("tobase64", "*/*", "*/*", false) do |input_path, target_path, value|
171
+ File.open(target_path, "w") do |io|
172
+ io.write "data:#{MimeMagic.by_magic(File.open(input_path)).type};base64,"
173
+ io.write(Base64.encode64(File.read(input_path)))
174
+ end
175
+ end
176
+
166
177
  create_simple_trafo("jpg", "image/*", "image/jpeg", true) do |input_path, target_path, value|
167
178
  raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:\"#{target_path}\"")
168
179
  end
@@ -1,3 +1,3 @@
1
1
  module Blobsterix
2
- VERSION = "0.0.27"
2
+ VERSION = "0.0.28"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blobsterix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Sudmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json