clientside_aws 0.0.24 → 0.0.25
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/Dockerfile +1 -1
- data/Gemfile +4 -4
- data/README.md +75 -70
- data/clientside_aws.gemspec +3 -3
- data/clientside_aws/elastic_transcoder.rb +29 -8
- data/examples/dockerized/README.md +21 -0
- data/examples/documentation/classic_model.png +0 -0
- data/examples/documentation/full_docker.png +0 -0
- data/examples/documentation/partial_docker.png +0 -0
- data/examples/local/README.md +11 -0
- data/index.rb +9 -0
- data/lib/clientside_aws/version.rb +1 -1
- metadata +13 -8
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8269c596909ba636737c30f536e8bf9b140360c7
         | 
| 4 | 
            +
              data.tar.gz: df95be118f5e808665fba5d17b6357667f3ff254
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f36b7bcf69a94c70d341af1d20c165810962ee192f72e9ab354efd62d1fe223da1a290053178d7fd578bd814ca79bac0f8a3210e55f9cf4cf8f498deab1b3a48
         | 
| 7 | 
            +
              data.tar.gz: f9ddeca0dbe59eba1cb861a7ce7f35c0a1db480bd484fd9823936230cc4009b6d2341e5e0050bc9167853ffb1bccca82608964724a1636a6a5ae40064e8cf8ae
         | 
    
        data/Dockerfile
    CHANGED
    
    | @@ -11,7 +11,7 @@ RUN mkdir /mnt/redis | |
| 11 11 |  | 
| 12 12 | 
             
            RUN apt-add-repository ppa:brightbox/ruby-ng -y
         | 
| 13 13 | 
             
            RUN apt-get update && apt-get install -y ruby2.4 ruby2.4-dev git-core build-essential zlib1g-dev
         | 
| 14 | 
            -
            RUN apt-get install -y wget curl
         | 
| 14 | 
            +
            RUN apt-get install -y wget curl telnet
         | 
| 15 15 |  | 
| 16 16 | 
             
            RUN cd /opt ; wget "http://download.redis.io/releases/redis-2.8.24.tar.gz"
         | 
| 17 17 | 
             
            RUN cd /opt ; gunzip redis-2.8.24.tar.gz ; tar -xvf redis-2.8.24.tar
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -4,19 +4,19 @@ source 'https://rubygems.org' | |
| 4 4 |  | 
| 5 5 | 
             
            # These are gem dependencies for our Docker image,
         | 
| 6 6 | 
             
            # not for our Gemfile which points clients to our docker image
         | 
| 7 | 
            -
            gem 'aws-sdk', '2 | 
| 8 | 
            -
            gem 'aws-sdk-v1' | 
| 7 | 
            +
            gem 'aws-sdk', '~> 2'
         | 
| 8 | 
            +
            gem 'aws-sdk-v1'
         | 
| 9 9 | 
             
            gem 'builder', '~> 3.2'
         | 
| 10 10 | 
             
            gem 'httparty', '0.15.6'
         | 
| 11 11 | 
             
            gem 'json', '1.8.6'
         | 
| 12 12 | 
             
            gem 'json_pure', '1.8.6'
         | 
| 13 13 | 
             
            gem 'monkey-lib', '0.5.4'
         | 
| 14 14 | 
             
            gem 'pry'
         | 
| 15 | 
            -
            gem 'rack', '1.5 | 
| 15 | 
            +
            gem 'rack', '~> 1.5'
         | 
| 16 16 | 
             
            gem 'rack-cors', '0.2.9', require: 'rack/cors'
         | 
| 17 17 | 
             
            gem 'rack-test', '0.5.7'
         | 
| 18 18 | 
             
            gem 'redis', '~> 4.0'
         | 
| 19 | 
            -
            gem 'rspec', '~> 3 | 
| 19 | 
            +
            gem 'rspec', '~> 3'
         | 
| 20 20 | 
             
            gem 'sinatra', '1.4.8'
         | 
| 21 21 | 
             
            gem 'sinatra-reloader', '0.5.0'
         | 
| 22 22 | 
             
            gem 'webmock', '3.1.0'
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,120 +1,125 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            ===================
         | 
| 1 | 
            +
            # Benefits
         | 
| 3 2 |  | 
| 4 | 
            -
             | 
| 3 | 
            +
            If you require the Internet to develop and test your next ruby application, then **your dev environment is broken**.
         | 
| 5 4 |  | 
| 6 | 
            -
             | 
| 5 | 
            +
            With Clientside AWS, you can:
         | 
| 7 6 |  | 
| 8 | 
            -
             | 
| 7 | 
            +
            - Write code on a plane: Interact with AWS services like S3, SQS and DynamoDb, without Internet access
         | 
| 8 | 
            +
            - Eliminate tedious configuration of WebMock-powered mock AWS responses in your unit tests
         | 
| 9 | 
            +
            - 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
         | 
| 10 | 
            +
            - Instantly restore your development and test environments to Known Good States
         | 
| 9 11 |  | 
| 10 | 
            -
             | 
| 12 | 
            +
            # Alternatives
         | 
| 11 13 |  | 
| 12 | 
            -
             | 
| 14 | 
            +
            ### [Fake S3](https://github.com/jubos/fake-s3)
         | 
| 13 15 |  | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 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
         | 
| 16 | 
            +
            Pro: Very complete implementation of the AWS S3 protocol.
         | 
| 17 | 
            +
            Cons: Nonstandard license; no support for running docker; only mocks S3 (not other services)
         | 
| 18 18 |  | 
| 19 | 
            -
             | 
| 19 | 
            +
            ### [DynamoDB local](https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/)
         | 
| 20 20 |  | 
| 21 | 
            +
            Pros: Complete implementation of the DynamoDB protocol
         | 
| 22 | 
            +
            Cons: Requires java installation locally; no docker support
         | 
| 21 23 |  | 
| 22 | 
            -
             | 
| 24 | 
            +
            ### [LocalStack](https://github.com/localstack/localstack)
         | 
| 23 25 |  | 
| 24 | 
            -
             | 
| 26 | 
            +
            Pros: Implementations of a large number of AWS services; uses docker; supported by Atlassian.
         | 
| 27 | 
            +
            Cons: Unclear licensing; probably not free in the long-run. Does not offer ruby bindings.
         | 
| 25 28 |  | 
| 26 | 
            -
             | 
| 29 | 
            +
            # Installation
         | 
| 27 30 |  | 
| 28 | 
            -
             | 
| 31 | 
            +
            There are two parts to installation: running a docker container that mocks the AWS services, and including the `clientside_aws` gem in your application.
         | 
| 29 32 |  | 
| 30 | 
            -
             | 
| 33 | 
            +
            ## Container configuration
         | 
| 31 34 |  | 
| 32 | 
            -
             | 
| 35 | 
            +
            From OSX, type:
         | 
| 33 36 |  | 
| 34 | 
            -
                 | 
| 35 | 
            -
            or
         | 
| 37 | 
            +
                gem install clientside_aws
         | 
| 36 38 |  | 
| 37 | 
            -
             | 
| 39 | 
            +
            This will install a gem and a script that lets you build the Clientside AWS docker image. Once the `clientside_aws` gem is installed locally on OSX, you will need to build the Clientside AWS docker image. Run:
         | 
| 38 40 |  | 
| 39 | 
            -
             | 
| 41 | 
            +
                clientside_aws_build
         | 
| 40 42 |  | 
| 41 | 
            -
             | 
| 42 | 
            -
            --------
         | 
| 43 | 
            +
            Once that docker image is built, it will be available for you to manually launch or include in `docker-compose.yml` files.
         | 
| 43 44 |  | 
| 44 | 
            -
             | 
| 45 | 
            +
                $ docker images
         | 
| 46 | 
            +
                REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
         | 
| 47 | 
            +
                clientside_aws                       latest              fec78caf81be        just now            881MB
         | 
| 48 | 
            +
                mysql                                5.7                 e27c7a14671f        20 months ago       361MB
         | 
| 49 | 
            +
                redis                                latest              93a08017b97e        22 months ago       151MB
         | 
| 50 | 
            +
                memcached                            latest              355142d48ea3        22 months ago       132MB
         | 
| 45 51 |  | 
| 46 | 
            -
             | 
| 52 | 
            +
            To manually launch a docker container running Clientside AWS, run:
         | 
| 47 53 |  | 
| 48 | 
            -
             | 
| 49 | 
            -
            ---------------------------
         | 
| 54 | 
            +
                docker run -d --rm -p <YOUR_PREFERRED_PORT>:4567 --name clientside_aws clientside_aws:latest
         | 
| 50 55 |  | 
| 51 | 
            -
             | 
| 56 | 
            +
            Or, run:
         | 
| 52 57 |  | 
| 53 | 
            -
             | 
| 58 | 
            +
                clientside_aws_run
         | 
| 54 59 |  | 
| 55 | 
            -
             | 
| 56 | 
            -
                ruby index.rb -p 4568
         | 
| 60 | 
            +
            To include in a `docker-compose.yml` file, see [the example](/examples/dockerized/docker-compose.yml).
         | 
| 57 61 |  | 
| 58 | 
            -
             | 
| 62 | 
            +
            ## Application configuration
         | 
| 59 63 |  | 
| 60 | 
            -
             | 
| 64 | 
            +
            In your gemfile:
         | 
| 61 65 |  | 
| 62 | 
            -
                 | 
| 63 | 
            -
                  require 'clientside_aws'  
         | 
| 64 | 
            -
                  DYNAMODB = AWS::DynamoDB.new(
         | 
| 65 | 
            -
                    :access_key_id => "...",
         | 
| 66 | 
            -
                    :secret_access_key => "...")
         | 
| 67 | 
            -
                  # more config
         | 
| 68 | 
            -
                end
         | 
| 66 | 
            +
                gem 'clientside_aws', require: 'clientside_aws'
         | 
| 69 67 |  | 
| 70 | 
            -
             | 
| 71 | 
            -
            http://rubydoc.info/github/amazonwebservices/aws-sdk-for-ruby/master/AWS/DynamoDB
         | 
| 68 | 
            +
            Then, at the top of your application where you are configuring global services, type:
         | 
| 72 69 |  | 
| 73 | 
            -
             | 
| 70 | 
            +
                config = { region: 'us-mockregion-1',
         | 
| 71 | 
            +
                           access_key_id: '...',
         | 
| 72 | 
            +
                           secret_access_key: '...' }
         | 
| 74 73 |  | 
| 75 | 
            -
                 | 
| 76 | 
            -
             | 
| 77 | 
            -
                  :secret_access_key => "...")
         | 
| 74 | 
            +
                Aws.config.update(config)
         | 
| 75 | 
            +
                AWS.config(config)
         | 
| 78 76 |  | 
| 79 | 
            -
             | 
| 80 | 
            -
                    :hash_key => { :creator_id => :number },
         | 
| 81 | 
            -
                    :range_key => {:date => :number})
         | 
| 77 | 
            +
            You can see that you do not need to specify a valid access_key_id nor secret_access_key, but you must set the region to be `us-mockregion-1` -- this is how Clientside AWS identifies and redirects requests to AWS services.
         | 
| 82 78 |  | 
| 83 | 
            -
             | 
| 84 | 
            -
                visitors_table.range_key = [:date, :number]
         | 
| 79 | 
            +
            Clientside AWS is also capable of mocking requests from the v1 and v2 versions of the [aws-sdk-ruby](https://github.com/aws/aws-sdk-ruby) gem. It is not yet tested with v3.
         | 
| 85 80 |  | 
| 86 | 
            -
             | 
| 87 | 
            -
                  visitors_table.items.put(:creator_id => 1, :date => Time.now.to_f - (60 * idx), :target_id => 10 + idx)
         | 
| 88 | 
            -
                end
         | 
| 81 | 
            +
            See [the example](/examples/dockerized/app/index.rb) for how to configure Clientside AWS in your application.
         | 
| 89 82 |  | 
| 90 | 
            -
             | 
| 83 | 
            +
            # Classic development approach
         | 
| 91 84 |  | 
| 92 | 
            -
             | 
| 85 | 
            +
            
         | 
| 93 86 |  | 
| 94 | 
            -
             | 
| 87 | 
            +
            In the classic approach to development, you would install application services like mysql, redis and memcached locally on OSX. You would then install the ruby runtime, with tools like [rvm](https://rvm.io/). With luck, you wouldn't encounter OSX-specific bugs, [like this one](https://blog.phusion.nl/2017/10/13/why-ruby-app-servers-break-on-macos-high-sierra-and-what-can-be-done-about-it/).
         | 
| 95 88 |  | 
| 96 | 
            -
             | 
| 89 | 
            +
            When you needed to interact with AWS services, you would either use [WebMock](https://github.com/bblimke/webmock) to provide a known response to outbound requests (probably in your rspec tests), and for development you would create a test account on AWS that had empty S3 buckets and DynamoDb databases. This account might have been shared with other developers, and could (over time) get polluted with development data. It was flushed infrequently, if ever. It also cost money, even if a nominal amount.
         | 
| 97 90 |  | 
| 98 | 
            -
             | 
| 99 | 
            -
             | 
| 91 | 
            +
            # Clientside AWS approach
         | 
| 92 | 
            +
             | 
| 93 | 
            +
            With Clientside AWS, you have two approaches to configuring your application services: Partial or Full Docker.
         | 
| 94 | 
            +
             | 
| 95 | 
            +
            ## Partial docker
         | 
| 100 96 |  | 
| 101 | 
            -
             | 
| 97 | 
            +
            
         | 
| 102 98 |  | 
| 103 | 
            -
             | 
| 104 | 
            -
            * UpdateTable
         | 
| 105 | 
            -
            * BatchGetItem
         | 
| 99 | 
            +
            With the partial docker approach, you continue to install runtime environments locally on OSX like [rvm](https://rvm.io/), but you also install [Docker for Mac](https://www.docker.com/docker-mac), on which you launch a container running Clientside AWS. You then `require clientside_aws` in your application which redirects AWS requests to the container. You also may consider running other services, like mysql, memcached and redis, inside a docker container.
         | 
| 106 100 |  | 
| 107 | 
            -
             | 
| 101 | 
            +
            See [this example](/examples/local/) for how to configure a partial docker development approach.
         | 
| 108 102 |  | 
| 109 | 
            -
             | 
| 103 | 
            +
            ## Full docker
         | 
| 104 | 
            +
             | 
| 105 | 
            +
            
         | 
| 106 | 
            +
             | 
| 107 | 
            +
            With the full docker approach, you do 100% of your web application development from within Docker. Your OSX laptop only need to have a web browser, a text editor, and docker installed (and if you are doing mobile development, Xcode/Android Studio).
         | 
| 108 | 
            +
             | 
| 109 | 
            +
            When developing with the full docker approach, your application runtime it itself running in a container. However, because your application code will be changing and churning constantly, it doesn't make sense to run a COPY command and seal it up, as one normally does with docker containers that you are shipping to other places. Instead, you mount your local OSX filesystem into an Ubuntu container, on which you have also installed the ruby runtime. You also execute an interactive bash script on that container, so you can easily do things like stop and restart your web server. This container creates network links between itself and your other services, including Clientside AWS, mysql, redis, memcached, postgres, etc.
         | 
| 110 | 
            +
             | 
| 111 | 
            +
            See [this example](/examples/dockerized/) for how to figure a full docker development approach.
         | 
| 112 | 
            +
             | 
| 113 | 
            +
            TODO
         | 
| 114 | 
            +
            =======
         | 
| 115 | 
            +
            * Add support for V3 of the aws-sdk gem
         | 
| 110 116 |  | 
| 111 | 
            -
            * * *
         | 
| 112 117 |  | 
| 113 118 | 
             
            License
         | 
| 114 119 | 
             
            =======
         | 
| 115 | 
            -
            MIT License | 
| 120 | 
            +
            [MIT License](http://en.wikipedia.org/wiki/MIT_License). Some parts of this code were adapted from the [aws-sdk project](https://github.com/aws/aws-sdk-core-ruby), which is itself licensed under the Apache 2.0 license.
         | 
| 116 121 |  | 
| 117 | 
            -
            Copyright (C) 2012 Perry Street Software, Inc.
         | 
| 122 | 
            +
            Copyright (C) 2012-2017 Perry Street Software, Inc.
         | 
| 118 123 |  | 
| 119 124 | 
             
            Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
         | 
| 120 125 |  | 
    
        data/clientside_aws.gemspec
    CHANGED
    
    | @@ -21,11 +21,11 @@ Gem::Specification.new do |spec| | |
| 21 21 | 
             
              spec.add_development_dependency 'rake', '10.1.0'
         | 
| 22 22 | 
             
              spec.add_development_dependency 'rack-test', '0.5.7'
         | 
| 23 23 | 
             
              spec.add_development_dependency 'bundler', '~> 1.3'
         | 
| 24 | 
            -
              spec.add_dependency 'aws-sdk-v1', '1. | 
| 25 | 
            -
              spec.add_dependency 'aws-sdk', '~> 2 | 
| 24 | 
            +
              spec.add_dependency 'aws-sdk-v1', '1.67.0'
         | 
| 25 | 
            +
              spec.add_dependency 'aws-sdk', '~> 2'
         | 
| 26 26 | 
             
              spec.add_dependency 'builder', '~> 3.1'
         | 
| 27 27 | 
             
              spec.add_dependency 'httparty', '~> 0.15'
         | 
| 28 28 | 
             
              spec.add_dependency 'json', '~> 1.8'
         | 
| 29 29 | 
             
              spec.add_dependency 'webmock', '~> 3.1'
         | 
| 30 | 
            -
              spec.add_dependency 'rspec', '~> 3 | 
| 30 | 
            +
              spec.add_dependency 'rspec', '~> 3'
         | 
| 31 31 | 
             
            end
         | 
| @@ -1,17 +1,36 @@ | |
| 1 1 | 
             
            helpers do
         | 
| 2 | 
            +
              def read_s3_input(bucket:, path:)
         | 
| 3 | 
            +
                bucket = Aws::S3::Resource.new(S3_CONFIG).bucket(bucket)
         | 
| 4 | 
            +
                object = bucket.object(path)
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                object.get.body.read if object.exists?
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              def write_s3_output(bucket:, path:, data:, content_type:)
         | 
| 10 | 
            +
                bucket_obj = Aws::S3::Resource.new(S3_CONFIG).bucket(bucket)
         | 
| 11 | 
            +
                object = bucket_obj.object(path)
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                object.put(body: data,
         | 
| 14 | 
            +
                           content_type: content_type,
         | 
| 15 | 
            +
                           acl: 'private')
         | 
| 16 | 
            +
                puts "JUST WROTE #{bucket} path #{path} data #{data.length}"
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
             | 
| 2 19 | 
             
              def encode_video(source_key, dest_key, pipeline_id)
         | 
| 3 20 | 
             
                pipeline = JSON.parse(AWS_REDIS.get("pipeline:#{pipeline_id}"))
         | 
| 4 | 
            -
                 | 
| 21 | 
            +
                input_bucket = pipeline['InputBucket']
         | 
| 5 22 | 
             
                input_obj_name = source_key
         | 
| 6 | 
            -
                input_obj_key = "s3:bucket:#{bucket}:#{input_obj_name}"
         | 
| 7 23 |  | 
| 8 | 
            -
                 | 
| 24 | 
            +
                input_data = read_s3_input(bucket: input_bucket,
         | 
| 25 | 
            +
                                           path: input_obj_name)
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                output_bucket = pipeline['OutputBucket']
         | 
| 9 28 | 
             
                output_obj_name = dest_key
         | 
| 10 | 
            -
                output_obj_key = "s3:bucket:#{bucket}:#{output_obj_name}"
         | 
| 11 | 
            -
                input_obj_body = AWS_REDIS.hget input_obj_key, 'body'
         | 
| 29 | 
            +
                # output_obj_key = "s3:bucket:#{bucket}:#{output_obj_name}"
         | 
| 30 | 
            +
                # input_obj_body = AWS_REDIS.hget input_obj_key, 'body'
         | 
| 12 31 |  | 
| 13 32 | 
             
                tmp = Tempfile.new(source_key)
         | 
| 14 | 
            -
                tmp.write( | 
| 33 | 
            +
                tmp.write(input_data)
         | 
| 15 34 | 
             
                tmp.close
         | 
| 16 35 |  | 
| 17 36 | 
             
                # Setup paths
         | 
| @@ -37,8 +56,10 @@ helpers do | |
| 37 56 | 
             
                  video = file.read
         | 
| 38 57 | 
             
                  file.close
         | 
| 39 58 |  | 
| 40 | 
            -
                   | 
| 41 | 
            -
             | 
| 59 | 
            +
                  write_s3_output(bucket: output_bucket,
         | 
| 60 | 
            +
                                  path: output_obj_name,
         | 
| 61 | 
            +
                                  data: video,
         | 
| 62 | 
            +
                                  content_type: 'video/mp4')
         | 
| 42 63 |  | 
| 43 64 | 
             
                  begin
         | 
| 44 65 | 
             
                    File.delete(final_path) if File.exist?(final_path)
         | 
| @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            # Installation
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            To run this example, type
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                docker-compose up -d
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Once it has launched, run
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                docker ps
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            This should show you something like this:
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                                              NAMES
         | 
| 14 | 
            +
                ec9815828e64        clientside_aws_test_app   "/sbin/my_init"          3 seconds ago       Up 1 second         0.0.0.0:32847->4567/tcp                            clientside_aws_test_app
         | 
| 15 | 
            +
                b19233b502f8        clientside_aws:latest     "/sbin/my_init"          5 seconds ago       Up 2 seconds        0.0.0.0:32846->4567/tcp                            clientside_aws_test_aws
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            You can see that the `clientside_aws_test_app` container is running on port `32847`. Thus, from your local web browser, type in:
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                http://localhost:32847/
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            And you should see the example running there.
         | 
| Binary file | 
| Binary file | 
| Binary file | 
| @@ -0,0 +1,11 @@ | |
| 1 | 
            +
            # Installation
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            This example assumes you have a dockerized clientside_aws container already running. If you do not, after you have installed clientside_aws locally on OSX and built its image, run
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                clientside_aws_run
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            This will launch a container running on the correct port for this example to work. Then, simply run:
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                ruby test.rb
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            And you should see this example run successfully.
         | 
    
        data/index.rb
    CHANGED
    
    | @@ -11,6 +11,7 @@ require 'base64' | |
| 11 11 | 
             
            require 'rack'
         | 
| 12 12 | 
             
            require 'rack/cors'
         | 
| 13 13 | 
             
            require 'rack/protection'
         | 
| 14 | 
            +
            require 'aws-sdk'
         | 
| 14 15 |  | 
| 15 16 | 
             
            ENV['RACK_ENV'] = 'development' unless ENV['RACK_ENV']
         | 
| 16 17 |  | 
| @@ -51,6 +52,14 @@ end | |
| 51 52 |  | 
| 52 53 | 
             
            DYNAMODB_PREFIX = 'DynamoDBv20110924'.freeze
         | 
| 53 54 |  | 
| 55 | 
            +
            S3_CONFIG = {
         | 
| 56 | 
            +
              region: 'us-mockregion-1',
         | 
| 57 | 
            +
              access_key_id: '...',
         | 
| 58 | 
            +
              secret_access_key: '...',
         | 
| 59 | 
            +
              force_path_style: true,
         | 
| 60 | 
            +
              endpoint: 'http://app_rspec_localstack:4572'
         | 
| 61 | 
            +
            }.freeze
         | 
| 62 | 
            +
             | 
| 54 63 | 
             
            get '/' do
         | 
| 55 64 | 
             
              'hello'
         | 
| 56 65 | 
             
            end
         | 
    
        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.25
         | 
| 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:  | 
| 11 | 
            +
            date: 2018-03-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         | 
| @@ -58,28 +58,28 @@ dependencies: | |
| 58 58 | 
             
                requirements:
         | 
| 59 59 | 
             
                - - '='
         | 
| 60 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: 1. | 
| 61 | 
            +
                    version: 1.67.0
         | 
| 62 62 | 
             
              type: :runtime
         | 
| 63 63 | 
             
              prerelease: false
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 66 | 
             
                - - '='
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            -
                    version: 1. | 
| 68 | 
            +
                    version: 1.67.0
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 70 | 
             
              name: aws-sdk
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - "~>"
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            -
                    version: '2 | 
| 75 | 
            +
                    version: '2'
         | 
| 76 76 | 
             
              type: :runtime
         | 
| 77 77 | 
             
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| 80 80 | 
             
                - - "~>"
         | 
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            -
                    version: '2 | 
| 82 | 
            +
                    version: '2'
         | 
| 83 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 84 | 
             
              name: builder
         | 
| 85 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -142,14 +142,14 @@ dependencies: | |
| 142 142 | 
             
                requirements:
         | 
| 143 143 | 
             
                - - "~>"
         | 
| 144 144 | 
             
                  - !ruby/object:Gem::Version
         | 
| 145 | 
            -
                    version: '3 | 
| 145 | 
            +
                    version: '3'
         | 
| 146 146 | 
             
              type: :runtime
         | 
| 147 147 | 
             
              prerelease: false
         | 
| 148 148 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 149 149 | 
             
                requirements:
         | 
| 150 150 | 
             
                - - "~>"
         | 
| 151 151 | 
             
                  - !ruby/object:Gem::Version
         | 
| 152 | 
            -
                    version: '3 | 
| 152 | 
            +
                    version: '3'
         | 
| 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:
         | 
| @@ -188,11 +188,16 @@ files: | |
| 188 188 | 
             
            - docker/clientside-aws-run
         | 
| 189 189 | 
             
            - docker/redis-server-run
         | 
| 190 190 | 
             
            - examples/dockerized/Dockerfile
         | 
| 191 | 
            +
            - examples/dockerized/README.md
         | 
| 191 192 | 
             
            - examples/dockerized/app-run
         | 
| 192 193 | 
             
            - examples/dockerized/app/Gemfile
         | 
| 193 194 | 
             
            - examples/dockerized/app/index.rb
         | 
| 194 195 | 
             
            - examples/dockerized/app/views/index.erb
         | 
| 195 196 | 
             
            - examples/dockerized/docker-compose.yml
         | 
| 197 | 
            +
            - examples/documentation/classic_model.png
         | 
| 198 | 
            +
            - examples/documentation/full_docker.png
         | 
| 199 | 
            +
            - examples/documentation/partial_docker.png
         | 
| 200 | 
            +
            - examples/local/README.md
         | 
| 196 201 | 
             
            - examples/local/test.rb
         | 
| 197 202 | 
             
            - index.rb
         | 
| 198 203 | 
             
            - lib/clientside_aws.rb
         |