Skip to content

Instantly share code, notes, and snippets.

View r7kamura's full-sized avatar

Ryo Nakamura r7kamura

View GitHub Profile
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activerecord", "5.2.1", require: "active_record"
gem "sqlite3"
end
ActiveRecord::Base.establish_connection(
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activerecord", "5.2.0", require: "active_record"
gem "sqlite3"
end
ActiveRecord::Base.establish_connection(
module Fizz
def call(target, max, state)
if target % 3 == 0
state << "fizz"
end
super
end
end
module Buzz
# config/inirializers/rack_deflater.rb
Rails.configuration.middleware.use(Rack::Deflater)
jobs:
build:
machine:
docker_layer_caching: true
steps:
- checkout
- run:
command: docker-compose build
name: docker-compose build
- run:
FROM ruby:2.4.2
WORKDIR /app
COPY \
Gemfile \
Gemfile.lock \
/app/
RUN bundle install --jobs=4 --path=/bundle
module.exports = {
/* ... */
watchOptions: {
poll: true
},
};
Rails.application.configure do
config.file_watcher = ActiveSupport::FileUpdateChecker
end
version: "2"
services:
node:
build:
context: .
dockerfile: ./docker/node/Dockerfile
volumes:
- node_modules:/app/node_modules
rails:
build:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<% server_render_js("head = Helmet.rewind()") %>
<%= server_render_js("head.title.toString()") %>
<%= server_render_js("head.meta.toString()") %>
<%= server_render_js("head.link.toString()") %>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag webpack_asset_url("client.css"), media: "all" %>