-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from navarasu/fix_28_document_exclude_test_dev…
…_gem #28 Added document and test case for exclude test development gems
- Loading branch information
Showing
10 changed files
with
132 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
## Exclude test and development related gems | ||
|
||
<!-- tabs:start --> | ||
|
||
#### ** Gemfile ** | ||
|
||
```ruby | ||
source 'https://rubygems.org' | ||
gem 'httparty' | ||
|
||
group :development do | ||
gem 'rubocop' | ||
end | ||
|
||
group :test do | ||
gem 'rspec' | ||
end | ||
|
||
``` | ||
|
||
#### ** serverless.yml ** | ||
|
||
```yml | ||
service: basic | ||
|
||
plugins: | ||
- serverless-ruby-layer | ||
|
||
provider: | ||
name: aws | ||
runtime: ruby2.5 | ||
|
||
functions: | ||
hello: | ||
handler: handler.hello | ||
``` | ||
#### ** handler.rb ** | ||
```ruby | ||
require 'httparty' | ||
|
||
def hello(event:, context:) | ||
body = HTTParty.get("https://github.com").body | ||
|
||
{ statusCode: 200, body: body } | ||
end | ||
|
||
``` | ||
|
||
<!-- tabs:end --> | ||
Running `sls deploy` automatically deploys the required gems as in Gemfile by excluding the test and development related gems by default to AWS lambda layer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
source 'https://rubygems.org' | ||
gem 'httparty' | ||
|
||
group :development do | ||
gem 'rubocop' | ||
end | ||
|
||
group :test do | ||
gem 'rspec' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'httparty' | ||
|
||
def hello(event:, context:) | ||
body = HTTParty.get("https://github.com").body | ||
|
||
{ statusCode: 200, body: body } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
service: exclude-dev-test-gems | ||
|
||
plugins: | ||
- serverless-ruby-layer | ||
|
||
provider: | ||
name: aws | ||
runtime: ruby2.5 | ||
|
||
functions: | ||
hello: | ||
handler: handler.hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters