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 'net/http' | |
| require 'json' | |
| TEAM = ENV['TEAM'] or raise 'TEAM env is required' | |
| TOKEN = ENV['KIBELA_ACCESS_TOKEN'] or raise 'KIBELA_ACCESS_TOKEN env is required' | |
| def req(query) | |
| http = Net::HTTP.new("#{TEAM}.kibe.la", 443) | |
| http.use_ssl = true | |
| header = { |
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
| # Devise | |
| extension ApplicationController (Devise) | |
| def current_user: () -> User | |
| end | |
| class DeviseController < ApplicationController | |
| end | |
| class Devise::SessionsController < DeviseController |
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 ActiveRecord | |
| def self.eager_load!: () -> untyped | |
| def self.gem_version: () -> untyped | |
| def self.version: () -> untyped | |
| end | |
| class ActiveRecord::ActiveRecordError < StandardError | |
| 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
| rules: | |
| - id: sample.delete_all | |
| pattern: | |
| - delete_all | |
| - update_all | |
| message: | | |
| これらはvalidationやcallbackをスキップするので危険かもしれません。 | |
| justification: | |
| - どうしても高速に update/destroy したい場合 |
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
| using Module.new { | |
| refine ThreadGroup do | |
| attr_accessor :fake_ractor | |
| end | |
| } | |
| class FakeRactor | |
| def initialize(*args, name: nil, &block) | |
| @name = name | |
| @incoming = Thread::Queue.new |
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
| class C | |
| def self.new: (String) -> untyped | |
| end | |
| class C2 < C | |
| end | |
| module M | |
| def initialize: (String, Integer) -> void | |
| 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
| # frozen_string_literal: true | |
| require "bundler/inline" | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
| # Activate the gem you are reporting the issue against. |
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
| # 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 |
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 '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 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 '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 |