Skip to content

Commit

Permalink
Added Ruby 3.2 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
navarasu authored Oct 7, 2023
1 parent 9cf79f0 commit a50b23f
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
jobs:
build-and-test:
docker:
- image: cimg/ruby:2.7-node
- image: cimg/ruby:3.2-node
steps:
- checkout
- setup_remote_docker:
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ plugins:

provider:
name: aws
runtime: ruby2.5
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion docs/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ plugins:

provider:
name: aws
runtime: ruby2.5
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage_examples/bundler_require_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage_examples/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage_examples/exclude_dev_test_gems.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
4 changes: 2 additions & 2 deletions docs/usage_examples/include_exclude.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

custom:
rubyLayer:
Expand Down Expand Up @@ -96,7 +96,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

custom:
rubyLayer:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage_examples/use_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
8 changes: 5 additions & 3 deletions docs/usage_examples/use_docker_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand All @@ -36,8 +36,10 @@ functions:
#### ** Dockerfile **
```docker
FROM lambci/lambda:build-ruby2.7
FROM public.ecr.aws/sam/build-ruby3.2:latest-x86_64

RUN yum install -y amazon-linux-extras
RUN amazon-linux-extras enable postgresql10
RUN yum install -y postgresql-devel
RUN gem update bundler

Expand All @@ -48,7 +50,7 @@ CMD "/bin/bash"

```ruby
source 'https://rubygems.org'
gem 'pg', '1.2.3'
gem 'pg'
```

#### ** handler.rb **
Expand Down
2 changes: 1 addition & 1 deletion docs/usage_examples/use_local_bundler.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-ignore-gemfile-lock/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-with-gemfile-lock/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/bundler-require-all/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins:
- serverless-ruby-layer
provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

custom:
rubyLayer:
Expand Down
2 changes: 1 addition & 1 deletion examples/exclude-dev-test-gems/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/exclude-functions/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

custom:
rubyLayer:
Expand Down
2 changes: 1 addition & 1 deletion examples/include-functions/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

custom:
rubyLayer:
Expand Down
3 changes: 2 additions & 1 deletion examples/use-docker-file-with-environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM lambci/lambda:build-ruby2.7
FROM public.ecr.aws/sam/build-ruby3.2:latest-x86_64


RUN gem update bundler

Expand Down
2 changes: 1 addition & 1 deletion examples/use-docker-file-with-environment/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
4 changes: 3 additions & 1 deletion examples/use-docker-file/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM lambci/lambda:build-ruby2.7
FROM public.ecr.aws/sam/build-ruby3.2:latest-x86_64

RUN yum install -y amazon-linux-extras
RUN amazon-linux-extras enable postgresql10
RUN yum install -y postgresql-devel
RUN gem update bundler

Expand Down
2 changes: 1 addition & 1 deletion examples/use-docker-file/Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
source 'https://rubygems.org'
gem 'pg', '1.2.3'
gem 'pg'
2 changes: 1 addition & 1 deletion examples/use-docker-file/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/use-docker-ignore-gemfile-lock/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/use-docker-with-environment/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/use-docker-with-gemfile-lock/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
2 changes: 1 addition & 1 deletion examples/use-docker/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ custom:

provider:
name: aws
runtime: ruby2.7
runtime: ruby3.2

functions:
hello:
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,30 @@ let test_data = [
'/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2020.1104/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/'],
function_files: ['Gemfile', 'Gemfile.lock', 'handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

{ folder: 'use-docker-with-gemfile-lock', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/',
'/plugins/', '/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2020.1104/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/'],
function_files: ['Gemfile', 'Gemfile.lock', 'handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

{ folder: 'basic-ignore-gemfile-lock', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/',
'/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2021.0225/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/'],
function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

{ folder: 'use-docker-ignore-gemfile-lock', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/plugins/',
'/gems/', '/specifications/','/gems/httparty-0.20.0/', '/gems/mime-types-data-3.2022.0105/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.4.1/'],
function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

{ folder: 'bundler-require-all', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/plugins/',
'/gems/', '/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2020.1104/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/',
'/gems/nokogiri-1.11.3-x86_64-linux/', '/gems/racc-1.5.2/', '/extensions/x86_64-linux/', '/gems/mini_portile2-2.5.1/' ],
function_files: ['Gemfile', 'Gemfile.lock', 'handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

{ folder: 'use-docker-with-environment', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/', '/plugins/',
'/specifications/','/extensions/x86_64-linux/','/gems/httparty/', '/gems/mime-types-data/', '/gems/multi_xml/', '/gems/mime-types/',
'/gems/nokogiri/', '/gems/mini_portile2/'], function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[] },

{ folder: 'use-docker-file-with-environment', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/', '/plugins/',
'/specifications/','/extensions/x86_64-linux/','/gems/httparty/', '/gems/mime-types-data/', '/gems/multi_xml/', '/gems/mime-types/',
'/gems/nokogiri/', '/gems/mini_portile2/'], function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[] },
// { folder: 'use-docker-with-gemfile-lock', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/',
// '/plugins/', '/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2020.1104/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/'],
// function_files: ['Gemfile', 'Gemfile.lock', 'handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

// { folder: 'basic-ignore-gemfile-lock', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/',
// '/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2021.0225/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/'],
// function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

// { folder: 'use-docker-ignore-gemfile-lock', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/plugins/',
// '/gems/', '/specifications/','/gems/httparty-0.20.0/', '/gems/mime-types-data-3.2022.0105/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.4.1/'],
// function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

// { folder: 'bundler-require-all', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/plugins/',
// '/gems/', '/specifications/','/gems/httparty-0.18.1/', '/gems/mime-types-data-3.2020.1104/', '/gems/multi_xml-0.6.0/', '/gems/mime-types-3.3.1/',
// '/gems/nokogiri-1.11.3-x86_64-linux/', '/gems/racc-1.5.2/', '/extensions/x86_64-linux/', '/gems/mini_portile2-2.5.1/' ],
// function_files: ['Gemfile', 'Gemfile.lock', 'handler.rb'], include_functions: ['Hello'], exclude_functions:[], check_version: true },

// { folder: 'use-docker-with-environment', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/', '/plugins/',
// '/specifications/','/extensions/x86_64-linux/','/gems/httparty/', '/gems/mime-types-data/', '/gems/multi_xml/', '/gems/mime-types/',
// '/gems/nokogiri/', '/gems/mini_portile2/'], function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[] },

// { folder: 'use-docker-file-with-environment', gem_zip_dirs: ['/','/bin/','/build_info/','/doc/','/extensions/', '/gems/', '/plugins/',
// '/specifications/','/extensions/x86_64-linux/','/gems/httparty/', '/gems/mime-types-data/', '/gems/multi_xml/', '/gems/mime-types/',
// '/gems/nokogiri/', '/gems/mini_portile2/'], function_files: ['handler.rb'], include_functions: ['Hello'], exclude_functions:[] },
]

describe('serverless package', function () {
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('serverless package', function () {
.then(function(data){
assert.deepEqual(function_files,data)
})
run_time = '2.7'
run_time = folder.endsWith('pg-old')? '2.7': '3.2'
value = readZip(layer_zip_path)
.then(function(data){
if (!check_version) {
Expand Down

0 comments on commit a50b23f

Please sign in to comment.