This file contains 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 DotSpringRb | |
MONITOR_INTERVAL = 10*60 | |
SERVER_KEEP_PERIOD = 30*60 | |
module_function | |
def env | |
@env ||= Spring::Env.new | |
end |
This file contains 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
let test#runners = {'Ruby': ['TestUnit']} |
This file contains 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
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require 'time' | |
require 'optparse' | |
require 'ostruct' | |
require 'fileutils' | |
class Index | |
reqid_regexp = /\h{8}-\h{4}-\h{4}-\h{4}-\h{12}/ |
This file contains 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 'shellwords' | |
class MiniMagickCommandExecutionTrace | |
OUTPUT = $stderr | |
TERM = { | |
green: "\e[32m", | |
red: "\e[31m", | |
yellow: "\e[33m", | |
reset: "\e[m", | |
}.freeze |
This file contains 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
# Usage: | |
# | |
# RUBYOPT='-r ./to_rouge' RI_ROUGE=monokai.sublime \ | |
# ri --format=rouge Class.methods | |
require 'rdoc' | |
require 'rouge' | |
module RDoc | |
class Markup |
This file contains 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
# macOSでのrb-readline使用時の"\C-y"サスペンド問題の回避 | |
if defined?(::RbReadline) && $".grep(/\/rbreadline.rb\z/) | |
stty = `stty -a` | |
stty_ccs = { 'dsusp' => '^Y', 'lnext' => '^V' } | |
stty_ccs.delete_if {|cc, key| /\b#{Regexp.quote("#{cc} = #{key}")};/ !~ stty } | |
unless stty_ccs.empty? | |
system('stty', *stty_ccs.keys.inject([]) {|opts, cc| opts << cc << 'undef' }) | |
IRB.conf[:AT_EXIT] << proc do |
This file contains 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' | |
class Runner | |
def self.create(obj, method_name) | |
Class.new(self).class_eval do | |
eval <<-E | |
def run | |
@obj.#{method_name} | |
end | |
E |
This file contains 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 GemDepPatch_ | |
def to_specs | |
#super.select {|spec| spec.full_name != 'activesupport-5.1.2' } | |
super.sort_by {|spec| spec.activated? ? -1 : 1 } | |
end | |
end | |
Gem::Dependency.prepend(GemDepPatch_) |
This file contains 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
R rubygems | |
` rubygems | |
A middleman-cli-4.2.1 | |
: A thor-0.19.4 | |
: + thor-0.19.4 | |
+ middleman-cli-4.2.1 | |
R middleman-core/profiling | |
| A middleman-core-4.2.1 | |
| : A bundler-1.15.1 | |
| : + bundler-1.15.1 |
This file contains 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
def ___trace_push mark | |
Thread.current[:__prefix] ||= '' | |
Thread.current[:__prefix] << "#{mark} " | |
end | |
def ___trace_pop | |
Thread.current[:__prefix].slice!(-3, 3) | |
end | |
def ___trace_puts mark, *msgs |