clientside_aws 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/README.md +18 -0
- data/clientside_aws/mock/ses.rb +0 -2
- data/clientside_aws.gemspec +1 -1
- data/examples/dockerized/Dockerfile +24 -0
- data/examples/dockerized/app/Gemfile +6 -0
- data/examples/dockerized/app/index.rb +32 -0
- data/examples/dockerized/app/views/index.erb +19 -0
- data/examples/dockerized/app-run +2 -0
- data/examples/dockerized/docker-compose.yml +22 -0
- data/{spec/test_client → examples/local}/test.rb +0 -0
- data/index.rb +0 -1
- data/lib/clientside_aws/version.rb +1 -1
- data/lib/clientside_aws.rb +2 -0
- metadata +23 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 212e6dd842f718ed8cd4e1601348f2705dfbae0b
|
4
|
+
data.tar.gz: cd0fcf3aad613d98713d0e974dd3d999ddb4a72c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f8380aab2765db7790d046d34a09dd1d76167779d2af57f2602256950671c4e039ede96724787c34259ed30bee8340183129c4632316f163033c7445ab8eaee
|
7
|
+
data.tar.gz: a3ea6a6eecbfdc8e94ac6f8e1e2181d9b2442f4802becab0f613f635cfa855f2f619a162759175dc0e4004c38e6b74fa0d6d8cd71e1d26b9baef29de37e9a415
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,24 @@
|
|
1
1
|
clientside_aws
|
2
2
|
===================
|
3
3
|
|
4
|
+
Run selected AWS services via a docker container locally, for more effective development and testing.
|
5
|
+
|
6
|
+
## Install
|
7
|
+
|
8
|
+
In your gemfile:
|
9
|
+
|
10
|
+
gem 'clientside_aws', require: 'clientside_aws'
|
11
|
+
|
12
|
+
## Features
|
13
|
+
|
14
|
+
- Write code on a plane: Interact with AWS services like S3, SQS and DynamoDb, without internet access
|
15
|
+
- No more tedious configuration of mocked responses in your unit tests
|
16
|
+
- Save time and money by avoiding the need for a 'test' account in AWS where you upload S3 files and interact with DynamoDb databases along with other developers on your team
|
17
|
+
- Instantly restore your development and test environments to known good states
|
18
|
+
|
19
|
+
Think about how
|
20
|
+
|
21
|
+
|
4
22
|
This code is meant to be used by developers who are attempting to build web applications on AWS but wish to run client-side testing and validation. Presently, this project mocks DynamoDB and SQS.
|
5
23
|
|
6
24
|
While creating and tearing down "free-tier" SQS and DynamoDB databases may be an acceptable solution for some, the time required (tens of seconds or minutes) quickly makes TDD (test-driven development) impractical. Just like we can use an in-memory sqlite3-based solution for mocking Mysql databases with ActiveRecord, we can now mock SQS and DynamoDB databases in memory using Redis.
|
data/clientside_aws/mock/ses.rb
CHANGED
data/clientside_aws.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency 'rake', '10.1.0'
|
22
22
|
spec.add_development_dependency 'rack-test', '0.5.7'
|
23
|
-
spec.add_development_dependency 'rspec', '2.14.1'
|
24
23
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
24
|
spec.add_dependency 'aws-sdk-v1', '1.66.0'
|
26
25
|
spec.add_dependency 'aws-sdk', '~> 2.0'
|
@@ -28,4 +27,5 @@ Gem::Specification.new do |spec|
|
|
28
27
|
spec.add_dependency 'httparty', '~> 0.15'
|
29
28
|
spec.add_dependency 'json', '~> 1.8'
|
30
29
|
spec.add_dependency 'webmock', '~> 3.1'
|
30
|
+
spec.add_dependency 'rspec', '~> 2.14'
|
31
31
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
FROM phusion/baseimage:0.9.22
|
2
|
+
ENV HOME /root
|
3
|
+
|
4
|
+
# Use baseimage-docker's init system.
|
5
|
+
CMD ["/sbin/my_init"]
|
6
|
+
|
7
|
+
# Install ruby
|
8
|
+
RUN apt-add-repository ppa:brightbox/ruby-ng -y
|
9
|
+
RUN apt-get update && apt-get install -y ruby2.4 ruby2.4-dev git-core build-essential zlib1g-dev
|
10
|
+
RUN apt-get install -y wget curl
|
11
|
+
|
12
|
+
# Install app code
|
13
|
+
RUN gem install bundler
|
14
|
+
RUN cd /opt
|
15
|
+
COPY app/ /opt/app/
|
16
|
+
RUN cd /opt/app ; bundle install
|
17
|
+
|
18
|
+
# Use runit to start the app
|
19
|
+
RUN mkdir /etc/service/app
|
20
|
+
ADD app-run /etc/service/app/run
|
21
|
+
RUN chmod 755 /etc/service/app/run
|
22
|
+
|
23
|
+
EXPOSE 4567
|
24
|
+
WORKDIR /opt/app
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'clientside_aws'
|
3
|
+
require 'sinatra'
|
4
|
+
|
5
|
+
config = { region: 'us-mockregion-1',
|
6
|
+
access_key_id: '...',
|
7
|
+
secret_access_key: '...' }
|
8
|
+
|
9
|
+
Aws.config.update(config)
|
10
|
+
AWS.config(config)
|
11
|
+
|
12
|
+
get '/' do
|
13
|
+
erb :index
|
14
|
+
end
|
15
|
+
|
16
|
+
post '/image' do
|
17
|
+
s3 = Aws::S3::Client.new
|
18
|
+
s3.create_bucket(bucket: 'test')
|
19
|
+
|
20
|
+
bucket = Aws::S3::Resource.new.bucket('test')
|
21
|
+
|
22
|
+
# Now, store a JSON document
|
23
|
+
object = bucket.object('image')
|
24
|
+
object.put(body: params['data'], content_type: 'image/jpeg')
|
25
|
+
end
|
26
|
+
|
27
|
+
get '/image' do
|
28
|
+
object = bucket.object('image')
|
29
|
+
|
30
|
+
content_type 'image/jpeg'
|
31
|
+
object.get.body.read
|
32
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Clientside AWS Test</title>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
<p>
|
7
|
+
Upload an image
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
<form method='post' action='/image' enctype='multipart/form-data'>
|
11
|
+
File: <input type="file" name="image" id="image"/>
|
12
|
+
<input type="submit" value="Upload Image" name="submit"/>
|
13
|
+
</form>
|
14
|
+
</p>
|
15
|
+
<hr>
|
16
|
+
<p>Here is the image:</p>
|
17
|
+
<image src='/image' />
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
version: '2'
|
2
|
+
services:
|
3
|
+
app:
|
4
|
+
image: clientside_aws_test_app
|
5
|
+
container_name: clientside_aws_test_app
|
6
|
+
links:
|
7
|
+
- aws
|
8
|
+
build:
|
9
|
+
context: ./
|
10
|
+
dockerfile: ./Dockerfile
|
11
|
+
command:
|
12
|
+
/sbin/my_init
|
13
|
+
aws:
|
14
|
+
image: clientside_aws:latest
|
15
|
+
container_name: clientside_aws_test_aws
|
16
|
+
build:
|
17
|
+
context: ../../
|
18
|
+
dockerfile: ./Dockerfile
|
19
|
+
command: /sbin/my_init
|
20
|
+
ports:
|
21
|
+
- '4567'
|
22
|
+
|
File without changes
|
data/index.rb
CHANGED
data/lib/clientside_aws.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clientside_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perry Street Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.5.7
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 2.14.1
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 2.14.1
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: bundler
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +136,20 @@ dependencies:
|
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '3.1'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.14'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '2.14'
|
153
153
|
description: This code is meant to be used by developers who are attempting to build
|
154
154
|
web applications on AWS but wish to run client-side testing and validation.
|
155
155
|
email:
|
@@ -187,6 +187,13 @@ files:
|
|
187
187
|
- clientside_aws/sqs.rb
|
188
188
|
- docker/clientside-aws-run
|
189
189
|
- docker/redis-server-run
|
190
|
+
- examples/dockerized/Dockerfile
|
191
|
+
- examples/dockerized/app-run
|
192
|
+
- examples/dockerized/app/Gemfile
|
193
|
+
- examples/dockerized/app/index.rb
|
194
|
+
- examples/dockerized/app/views/index.erb
|
195
|
+
- examples/dockerized/docker-compose.yml
|
196
|
+
- examples/local/test.rb
|
190
197
|
- index.rb
|
191
198
|
- lib/clientside_aws.rb
|
192
199
|
- lib/clientside_aws/configuration.rb
|
@@ -203,7 +210,6 @@ files:
|
|
203
210
|
- spec/sns_spec.rb
|
204
211
|
- spec/spec_helper.rb
|
205
212
|
- spec/sqs_spec.rb
|
206
|
-
- spec/test_client/test.rb
|
207
213
|
- spec/transcoder_spec.rb
|
208
214
|
homepage: https://github.com/perrystreetsoftware/clientside_aws
|
209
215
|
licenses:
|
@@ -238,5 +244,4 @@ test_files:
|
|
238
244
|
- spec/sns_spec.rb
|
239
245
|
- spec/spec_helper.rb
|
240
246
|
- spec/sqs_spec.rb
|
241
|
-
- spec/test_client/test.rb
|
242
247
|
- spec/transcoder_spec.rb
|