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 Monkey | |
extend self | |
MODULE_NAME = Module.instance_method(:name) | |
MODULE_SINGLETON_CLASS_P = Module.instance_method(:singleton_class?) | |
MODULE_SINGLETON_CLASS = Module.instance_method(:singleton_class) | |
MODULE_INSTANCE_METHODS = Module.instance_method(:instance_methods) | |
MODULE_INSTANCE_METHOD = Module.instance_method(:instance_method) | |
CLASS_ATTACHED_OBJECT = Class.instance_method(:attached_object) rescue nil | |
IS_A = Object.instance_method(:is_a?) |
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
:grinning: 😀 | |
:grin: 😁 | |
:joy: 😂 | |
:rofl: 🤣 | |
:rolling_on_the_floor_laughing: 🤣 | |
:smiley: 😃 | |
:smile: 😄 | |
:sweat_smile: 😅 | |
:laughing: 😆 | |
:satisfied: 😆 |
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
title | link | |
---|---|---|
[JA] The future vision of Ruby Parser / Yuichiro Kaneko @spikeolaf | https://www.youtube.com/watch?v=IhfDsLx784g&list=PLbFmgWm555yYvWS7VGTFipF7ckduvSeT-&index=2&pp=iAQB | |
[EN] RuboCop's baddest cop / Genadi Samokovarov @gsamokovarov | https://www.youtube.com/watch?v=n-D9uPOo_kc&list=PLbFmgWm555yYvWS7VGTFipF7ckduvSeT-&index=3&pp=iAQB | |
[EN] Generating RBIs for dynamic mixins with Sorbet and Tapioca / Emily Samp @egiurleo | https://www.youtube.com/watch?v=UpbVZ4Gqk3c&list=PLbFmgWm555yYvWS7VGTFipF7ckduvSeT-&index=4&pp=iAQB | |
[JA] Make Regexp#match much faster / Hiroya FUJINAMI @makenowjust | https://www.youtube.com/watch?v=IbMFHxeqpN4&list=PLbFmgWm555yYvWS7VGTFipF7ckduvSeT-&index=5&pp=iAQB | |
[EN] Understanding the Ruby Global VM Lock by observing it / Ivo Anjo @KnuX | https://www.youtube.com/watch?v=rI4XlFvMNEw&list=PLbFmgWm555yYvWS7VGTFipF7ckduvSeT-&index=6&pp=iAQB | |
[JA] develop chrome extension with ruby.wasm / Yuma Sawai @aaaa777 | https://www.youtube.com/watch?v=A2ziP8V9muE&list=PLbFmgWm555yYvWS7VGTFipF7ckduvSeT-&inde |
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
# Devise | |
extension ApplicationController (Devise) | |
def current_user: () -> User | |
end | |
class DeviseController < ApplicationController | |
end | |
class Devise::SessionsController < DeviseController |
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: | |
# # Open all releases between 6.1 and 7.0 | |
# $ ruby open-releases.rb 6.1 7.0 | |
tags = `git tag`.lines(chomp: true).map { _1[/^v(.+)$/, 1] }.compact.map { Gem::Version.new _1 rescue nil }.compact | |
s, e = ARGV.map { Gem::Version.new _1 } | |
vs = tags.select { s < _1 && _1 <= e } | |
vs.each do |v| |
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 'tmpdir' | |
require 'pathname' | |
Dir.mktmpdir('steep-playground-') do |dir| | |
dir = Pathname(dir) | |
dir.join('Steepfile').write(<<~END) | |
target :test do | |
signature "." | |
check "test.rb" | |
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
namespace :model_from_schema do | |
desc 'Generate model files from db schema' | |
task gen: :environment do | |
module ModelGenerator | |
Models = {} | |
module Evaluator | |
module_function | |
def create_table(table_name, *) |
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 'parser/current' | |
class Parser::Lexer | |
methods.grep(/^lex_en/).each do |m| | |
if m.end_with?('=') | |
singleton_class.undef_method m | |
else | |
v = __send__ m | |
singleton_class.undef_method m | |
eval <<~RUBY |
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
# Print gems that contains `test_files` in gemspec with disk consumed order. | |
# | |
# Usage: | |
# bundle install --path /path/to/somewhere | |
# cd /path/to/somewhere/ruby/VERSION/gems | |
# ruby THIS_SCRIPT.rb | |
# | |
# Pro tip: The following links are useful when you open a PR to remove test_files. | |
# * https://github.com/rubygems/guides/issues/90 | |
# * https://github.com/rubygems/bundler/pull/3207 |
NewerOlder