clientside_aws 0.0.20 → 0.0.21

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: 00fbd69fc0139f687b26e462c9aba853ac120cc9
4
- data.tar.gz: 1ac07ca852c45395d6401efc23d9d5eba49240ba
3
+ metadata.gz: c57dd0c8d8d94dfcaa0ee7849b332371c660baab
4
+ data.tar.gz: 2eac8b8a64913b551feecb28efab278560a32a3c
5
5
  SHA512:
6
- metadata.gz: 13b4e58a2b77f3f39c1d51fc416bac7f88b8e9ec1af22cf1a5002fc1de053e4905c2ca34ba61740ae542ad7380a392ae6a7f85bbb214727f81dca32ff251b161
7
- data.tar.gz: 972660feaa27830c0969c30e4fae938bdf6e42b5ab94afe1dcdb3f164e2a051e0316453fa92a14131e70ae282bd3f9123cdd86b8f91dce648b33c78f82b9afd4
6
+ metadata.gz: 16441859625795c173345d4f5c43d36e52fee3819c53ce4e3f33d75eeefdd2a7b852ec56b607e1d78319a080222edb850c5bd2880551bdfd01b5a06318abfb8a
7
+ data.tar.gz: 881bb8e29fc22d45a23c383ff80fd795ac5919200de58458d1814e854d6f3b19f870b0c768db4a99cdf41e232d830ef624fad8a9acc386b6c6667df470a92327
@@ -1,6 +1,7 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env bash
2
2
 
3
- path = File.dirname(__FILE__)
4
- dockerfile_path = File.join(path, '../')
3
+ # https://stackoverflow.com/a/246128/61072
4
+ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5
+ PARENTDIR="$(dirname "$DIR")"
5
6
 
6
- puts `docker build -t=clientside_aws:latest #{dockerfile_path}`
7
+ docker build -t=clientside_aws:latest $PARENTDIR
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env ruby
2
-
3
- cmd = "docker run -d --rm -p 5567:4567 --name clientside_aws clientside_aws:latest"
4
- puts `#{cmd}`
1
+ #!/usr/bin/env bash
5
2
 
3
+ docker run -d --rm -p 5567:4567 --name clientside_aws clientside_aws:latest
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env bash
2
2
 
3
- cmd = "docker run -it --rm -p 6567:4567 -v ~/scruff/clientside_aws:/opt/clientside_aws --name clientside_aws_test clientside_aws bash"
4
- puts cmd
3
+ docker exec -it clientside_aws rspec spec
data/clientside_aws/s3.rb CHANGED
@@ -203,21 +203,21 @@ delete %r{/(.*?)\.s3\.(.*?\.amazonaws\.com)?/(.+)} do
203
203
  status 200
204
204
  end
205
205
 
206
- # post %r{/s3(.*?\.amazonaws\.com)?/([^/]+)/?} do
207
- # # upload the file (chunking not implemented) to fake S3
208
- # bucket = params[:captures][1]
209
- # file_name = params[:key]
210
- # if file_name
211
- # file_name = file_name[1..-1] if file_name.start_with? '/'
212
- # body_send = params[:file]
213
- # body_send = body_send[:tempfile].read unless AWS::Core.testing
214
- #
215
- # AWS_REDIS.hset "s3:bucket:#{bucket}:#{file_name}", 'body', body_send
216
- # if env.key?('content-type')
217
- # AWS_REDIS.hset "s3:bucket:#{bucket}:#{file_name}", 'content-type', env['content-type']
218
- # elsif env.key?('CONTENT_TYPE')
219
- # AWS_REDIS.hset "s3:bucket:#{bucket}:#{file_name}", 'content-type', env['CONTENT_TYPE']
220
- # end
221
- # end
222
- # status 200
223
- # end
206
+ post %r{/s3(.*?\.amazonaws\.com)?/([^/]+)/?} do
207
+ # upload the file (chunking not implemented) to fake S3
208
+ bucket = params[:captures][1]
209
+ file_name = params[:key]
210
+ if file_name
211
+ file_name = file_name[1..-1] if file_name.start_with? '/'
212
+ body_send = params[:file]
213
+ body_send = body_send[:tempfile].read
214
+
215
+ AWS_REDIS.hset "s3:bucket:#{bucket}:#{file_name}", 'body', body_send
216
+ if env.key?('content-type')
217
+ AWS_REDIS.hset "s3:bucket:#{bucket}:#{file_name}", 'content-type', env['content-type']
218
+ elsif env.key?('CONTENT_TYPE')
219
+ AWS_REDIS.hset "s3:bucket:#{bucket}:#{file_name}", 'content-type', env['CONTENT_TYPE']
220
+ end
221
+ end
222
+ status 200
223
+ end
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
- spec.executables = %w[clientside_aws_build clientside_aws_run]
17
+ spec.executables = %w[clientside_aws_build clientside_aws_run clientside_aws_test]
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
@@ -1,3 +1,3 @@
1
1
  module ClientsideAws
2
- VERSION = '0.0.20'.freeze
2
+ VERSION = '0.0.21'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clientside_aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perry Street Software, Inc.
@@ -157,6 +157,7 @@ email:
157
157
  executables:
158
158
  - clientside_aws_build
159
159
  - clientside_aws_run
160
+ - clientside_aws_test
160
161
  extensions: []
161
162
  extra_rdoc_files: []
162
163
  files: