diff --git a/sample-apps/layer-ruby/function/lambda_function.rb b/sample-apps/layer-ruby/function/lambda_function.rb new file mode 100644 index 00000000..2c6d85d3 --- /dev/null +++ b/sample-apps/layer-ruby/function/lambda_function.rb @@ -0,0 +1,8 @@ +require 'json' +require 'tzinfo' + +def lambda_handler(event:, context:) + tz = TZInfo::Timezone.get('America/New_York') + { statusCode: 200, body: tz.to_local(Time.utc(2018, 2, 1, 12, 30, 0)) } +end + diff --git a/sample-apps/layer-ruby/layer/1-install.sh b/sample-apps/layer-ruby/layer/1-install.sh new file mode 100755 index 00000000..eaf29ac1 --- /dev/null +++ b/sample-apps/layer-ruby/layer/1-install.sh @@ -0,0 +1,3 @@ +bundle config set --local path 'vendor/bundle' +bundle install + diff --git a/sample-apps/layer-ruby/layer/2-package.sh b/sample-apps/layer-ruby/layer/2-package.sh new file mode 100755 index 00000000..305a5b7b --- /dev/null +++ b/sample-apps/layer-ruby/layer/2-package.sh @@ -0,0 +1,3 @@ +mkdir -p ruby/gems/3.3.0 +cp -r vendor/bundle/ruby/3.3.0/* ruby/gems/3.3.0/ +zip -r layer_content.zip ruby diff --git a/sample-apps/layer-ruby/layer/Gemfile b/sample-apps/layer-ruby/layer/Gemfile new file mode 100644 index 00000000..64ad6202 --- /dev/null +++ b/sample-apps/layer-ruby/layer/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem "tzinfo"