Table > Chain > Rule
La primera regla que coincida es la que se aplica.
class ApplicationController < ActionController::Base | |
private | |
attr_reader :execution | |
def execute(action, params={}) | |
@execution = action.new(params.reverse_merge(default_execute_params).call | |
end | |
def default_execute_params |
class ActionBase | |
def self.call(*params) | |
new(*params).call | |
end | |
def self.on(event, *methods) | |
methods.each { |m| __on_listeners[event.to_sym] << m.to_sym } | |
end | |
def self.__on_listeners |
$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg lsb-release
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListBucket" | |
], | |
"Resource": [ | |
"arn:aws:s3:::bucket-name" |
#!/usr/bin/env bash | |
docker run \ | |
-d \ | |
--name "redis" \ | |
--restart unless-stopped \ | |
-p 6379:6379 \ | |
--mount 'type=volume,source=redis_storage,target=/data,volume-driver=local' \ | |
redis |
#!/usr/bin/env bash | |
docker run \ | |
-d \ | |
--name "mysql" \ | |
--restart unless-stopped \ | |
-p 3306:3306 \ | |
--mount 'type=volume,source=mysql_storage,target=/var/lib/mysql,volume-driver=local' \ | |
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ | |
mysql:5.7 |
#!/usr/bin/env bash | |
docker run \ | |
-d \ | |
--name "postgresql" \ | |
--restart unless-stopped \ | |
-p 5432:5432 \ | |
--mount 'type=volume,source=postgresql_storage,target=/var/lib/postgresql/data,volume-driver=local' \ | |
-e POSTGRES_USER=postgres \ | |
-e POSTGRES_DB=postgres \ |
$ bundle config build.pg --with-opt-dir="/usr/local/opt/libpq"
$ gem install mysql2 -- --with-mysql-dir=/opt/homebrew/opt/mysql-client