This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_savior | |
| # STAGE for bundle & yarn install | |
| FROM ruby:2.4.3-alpine3.7 as builder | |
| ENV CA_CERTS_PATH /etc/ssl/certs/ | |
| ENV RAILS_ENV production | |
| ENV RAILS_LOG_TO_STDOUT true | |
| ENV RAILS_SERVE_STATIC_FILES true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark/ips' | |
| require 'redis' | |
| class MethodProfiler | |
| def self.patch(klass, methods, name) | |
| patches = methods.map do |method_name| | |
| <<~RUBY | |
| unless defined?(#{method_name}__mp_unpatched) | |
| alias_method :#{method_name}__mp_unpatched, :#{method_name} | |
| def #{method_name}(*args, &blk) | |
| unless prof = Thread.current[:_method_profiler] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module xxx | |
| class Application < Rails::Application | |
| #(中略) | |
| config.middleware.swap ActiveRecord::ConnectionAdapters::ConnectionManagement, | |
| 'ActiveRecord::ConnectionAdapters::ReconnectOnErrorManagement' | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # if you want to render flamegraphs | |
| gem "stackprof", require: false # required by flamegraph | |
| gem "flamegraph", require: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module FactoryGirl | |
| module Doctor | |
| module FloatDuration | |
| refine Float do | |
| def duration | |
| t = self | |
| format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000) | |
| end | |
| end | |
| end |
NewerOlder