Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

abc = :'a b c'
xyz = :"x y z"
__END__
% be rubocop --only Style/StringLiterals quoted_symbol.rb
Inspecting 1 file
.
1 file inspected, no offenses detected
# frozen_string_literal: true
def foo(*args, **kwargs)
end
foo(:a, :b, c: :d,
x: 1,
y: 2
)
using Module.new {
refine Enumerable do
alias :orig_sum :sum
end
}
module Enumerable
def sum(...)
p method(:orig_sum)
end
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails"
```bash
brew install postgresql
pg_config
mkdir -p /usr/local/var/postgres
initdb /usr/local/var/postgres -E utf8
vi /usr/local/var/postgres/postgresql.conf
@kamipo
kamipo / gist:7ed4ee23a8c879d68bc7c7acc02f43f4
Created May 9, 2020 22:25
Fix CI error with minitest 5.13
test_run_in_parallel_with_unmarshable_exception
test_run_in_parallel_with_unknown_object
% bin/test test/application/test_runner_test.rb -n test_run_in_parallel_with_unknown_object
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails"
puts RUBY_VERSION
module Rails
end
def Rails.root; :defined_root end
p defined?(Rails.root)
Rails.instance_eval { undef :root }
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails"
class Foo
def initialize(target)
@target = target
end
if RUBY_VERSION > "2.7"
def method_missing(method, *args, **kwargs, &block)
@target.send(method, *args, **kwargs, &block)
end
else