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
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 |
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
# frozen_string_literal: true | |
def foo(*args, **kwargs) | |
end | |
foo(:a, :b, c: :d, | |
x: 1, | |
y: 2 | |
) |
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
using Module.new { | |
refine Enumerable do | |
alias :orig_sum :sum | |
end | |
} | |
module Enumerable | |
def sum(...) | |
p method(:orig_sum) | |
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
# 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" |
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
```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 |
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
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 | |
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
# 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" |
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
puts RUBY_VERSION | |
module Rails | |
end | |
def Rails.root; :defined_root end | |
p defined?(Rails.root) | |
Rails.instance_eval { undef :root } |
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
# 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" |
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
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 |
NewerOlder