Skip to content

Commit 629b920

Browse files
committed
Initial project.
0 parents  commit 629b920

28 files changed

+436
-0
lines changed

.github/workflows/cicd.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Test
2+
on: [push]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v1
9+
- name: Bootstrap
10+
run: |
11+
./bin/bootstrap
12+
- name: Setup
13+
run: |
14+
./bin/setup
15+
- name: Test
16+
run: |
17+
./bin/test

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/pkg/
6+
/spec/reports/
7+
/tmp/
8+
/vendor/bundle
9+
test/dummy_app/.gitignore
10+
test/dummy_app/app.rb
11+
test/dummy_app/template.yaml
12+
test/dummy_app/bin/build
13+
test/dummy_app/bin/deploy
14+
test/dummy_app/tmp
15+
test/dummy_app/log/**/*

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# Keep A Changelog!
3+
4+
See this http://keepachangelog.com link for information on how we want this documented formatted.
5+
6+
## v1.0.0
7+
8+
#### Added
9+
10+
* Initial release.

CODE_OF_CONDUCT.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM lambci/lambda:build-ruby2.7
2+
WORKDIR /var/task

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
source "https://rubygems.org"
2+
gemspec

Gemfile.lock

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
PATH
2+
remote: .
3+
specs:
4+
lambdakiq (1.0.0)
5+
activejob
6+
aws-sdk-sqs
7+
8+
GEM
9+
remote: https://rubygems.org/
10+
specs:
11+
activejob (6.0.3.4)
12+
activesupport (= 6.0.3.4)
13+
globalid (>= 0.3.6)
14+
activesupport (6.0.3.4)
15+
concurrent-ruby (~> 1.0, >= 1.0.2)
16+
i18n (>= 0.7, < 2)
17+
minitest (~> 5.1)
18+
tzinfo (~> 1.1)
19+
zeitwerk (~> 2.2, >= 2.2.2)
20+
aws-eventstream (1.1.0)
21+
aws-partitions (1.399.0)
22+
aws-sdk-core (3.109.3)
23+
aws-eventstream (~> 1, >= 1.0.2)
24+
aws-partitions (~> 1, >= 1.239.0)
25+
aws-sigv4 (~> 1.1)
26+
jmespath (~> 1.0)
27+
aws-sdk-sqs (1.34.0)
28+
aws-sdk-core (~> 3, >= 3.109.0)
29+
aws-sigv4 (~> 1.1)
30+
aws-sigv4 (1.2.2)
31+
aws-eventstream (~> 1, >= 1.0.2)
32+
coderay (1.1.3)
33+
concurrent-ruby (1.1.7)
34+
globalid (0.4.2)
35+
activesupport (>= 4.2.0)
36+
i18n (1.8.5)
37+
concurrent-ruby (~> 1.0)
38+
jmespath (1.4.0)
39+
method_source (1.0.0)
40+
minitest (5.14.2)
41+
minitest-focus (1.2.1)
42+
minitest (>= 4, < 6)
43+
mocha (1.11.2)
44+
pry (0.13.1)
45+
coderay (~> 1.1)
46+
method_source (~> 1.0)
47+
rake (13.0.1)
48+
thread_safe (0.3.6)
49+
tzinfo (1.2.8)
50+
thread_safe (~> 0.1)
51+
zeitwerk (2.4.2)
52+
53+
PLATFORMS
54+
ruby
55+
56+
DEPENDENCIES
57+
bundler
58+
lambdakiq!
59+
minitest
60+
minitest-focus
61+
mocha
62+
pry
63+
rake
64+
65+
BUNDLED WITH
66+
2.1.4

LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Ken Collins
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
# Lambdakiq
3+
4+
TODO ...
5+
6+
```ruby
7+
# TODO ...
8+
```
9+
10+
## Contributing
11+
12+
After checking out the repo, run:
13+
14+
```shell
15+
$ ./bin/bootstrap
16+
$ ./bin/setup
17+
$ ./bin/test
18+
```
19+
20+
Bug reports and pull requests are welcome on GitHub at https://github.com/customink/lambdakiq. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
21+
22+
## Code of Conduct
23+
24+
Everyone interacting in the Lambdakiq project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/customink/lambdakiq/blob/master/CODE_OF_CONDUCT.md).

Rakefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ENV['RUBYOPT'] = '-W:no-deprecated -W:no-experimental'
2+
require "bundler/gem_tasks"
3+
require "rake/testtask"
4+
5+
Rake::TestTask.new(:test) do |t|
6+
t.libs << "test"
7+
t.libs << "lib"
8+
t.test_files = FileList["test/**/*_test.rb"]
9+
t.verbose = false
10+
t.warning = false
11+
end
12+
13+
task :default => :test

bin/_setup

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo '== Installing dependencies =='
5+
bundle config set --local path 'vendor/bundle'
6+
bundle install

bin/_test

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
export RAILS_ENV="test"
5+
6+
bundle exec rake test

bin/bootstrap

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo '== Building containers =='
5+
docker pull lambci/lambda:build-ruby2.7
6+
docker-compose build

bin/console

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require "bundler/setup"
4+
require "lambdakiq"
5+
6+
# You can add fixtures and/or initialization code here to make experimenting
7+
# with your gem easier. You can also use a different console, if you like.
8+
9+
# (If you use this, don't forget to add pry to your Gemfile!)
10+
# require "pry"
11+
# Pry.start
12+
13+
require "irb"
14+
IRB.start(__FILE__)

bin/setup

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
docker-compose run \
5+
lambdakiqgem \
6+
./bin/_setup

bin/test

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
4+
export RAILS_ENV="test"
5+
6+
docker-compose run \
7+
lambdakiqgem \
8+
./bin/_test

bin/update

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
rm -rf ./vendor/bundle
6+
7+
./bin/setup

docker-compose.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.7'
2+
services:
3+
lambdakiqgem:
4+
build: .
5+
environment:
6+
- AWS_PROFILE=${AWS_PROFILE-default}
7+
- RAILS_ENV=${RAILS_ENV-test}
8+
volumes:
9+
- ${PWD}:/var/task:delegated
10+
- ${HOME}/.aws:/root/.aws:delegated

lamby.gemspec

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
lib = File.expand_path('../lib', __FILE__)
2+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3+
require 'lambdakiq/version'
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = "lambdakiq"
7+
spec.version = Lambdakiq::VERSION
8+
spec.authors = ["Ken Collins"]
9+
spec.email = ["[email protected]"]
10+
spec.summary = %q{Scalable Rails Background Processing with AWS Lambda & SQS.}
11+
spec.description = %q{Scalable Rails Background Processing with AWS Lambda & SQS.}
12+
spec.homepage = "https://github.com/customink/lambdakiq"
13+
spec.license = "MIT"
14+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
15+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16+
end
17+
spec.bindir = "exe"
18+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19+
spec.require_paths = ["lib"]
20+
spec.add_dependency 'activejob'
21+
spec.add_dependency 'aws-sdk-sqs'
22+
spec.add_development_dependency 'bundler'
23+
spec.add_development_dependency 'rake'
24+
spec.add_development_dependency 'minitest'
25+
spec.add_development_dependency 'minitest-focus'
26+
spec.add_development_dependency 'mocha'
27+
spec.add_development_dependency 'pry'
28+
end

lib/lambdakiq.rb

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require 'active_job'
2+
require 'aws-sdk-sqs'
3+
require 'lambdakiq/version'
4+
5+
# if defined?(Rails)
6+
# require 'rails/railtie'
7+
# require 'lambdakiq/railtie'
8+
# end
9+
10+
module Lambdakiq
11+
12+
extend self
13+
14+
# autoload :Xyz, 'lambdakiq/xyz'
15+
16+
end

lib/lambdakiq/railtie.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Lambdakiq
2+
class Railtie < ::Rails::Railtie
3+
config.lambdakiq = ActiveSupport::OrderedOptions.new
4+
end
5+
end

lib/lambdakiq/version.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Lambdakiq
2+
VERSION = '0.0.1'
3+
end

test/lambdakiq_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class HandlerTest < LambdakiqSpec
4+
it 'starting off' do
5+
expect('true').must_equal 'true'
6+
end
7+
end

0 commit comments

Comments
 (0)