- 9/4 10:15 Guild Implementation
- 現Ractorについて
- 9/4 10:45 Type Profiler: a Progress Report of a Ruby 3 Type Analyzer
- 9/4 13:30 Don't Wait For Me! Scalable Concurrency for Ruby 3!
- 9/4 14:00 Ruby3 Typing, 2020
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
Person = Struct.new(:name, :age, :hoge, keyword_init: true) do | |
def initialize(**kw) | |
raise 'hoge は指定できへんで' if kw[:hoge] | |
super | |
self.hoge = :xxx | |
undef :hoge= | |
end | |
end | |
person = Person.new(name: 'foo', age: 10) |
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 'drb/drb' | |
require 'logger' | |
require_relative './user' | |
URL = 'druby://localhost:8787' | |
server = DRbObject.new_with_uri(URL) | |
logger = Logger.new(STDOUT) | |
3.times do | |
logger.info "call server" |
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 'benchmark/ips' | |
TIME = 10_00 | |
STR = "ruby" | |
puts RUBY_VERSION | |
Benchmark.ips do |bm| | |
bm.report "gsub" do | |
TIME.times do |
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
Person = Struct.new(:name, :age, keyword_init: true) do | |
def greet | |
puts "#{name} : #{age}" | |
end | |
end | |
person = Person.new(name: 'taro', age: 20) | |
person.greet #=> taro : 20 |
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
mail(param) do |format| | |
format.html { render 'user_mailer/welcome' } unless @text_dake_okuritai | |
format.text { render 'user_mailer/text/welcome' } # path/to/name | |
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
[alias] | |
browse = !"f() { open $(git remote get-url origin)/tree/$(git rev-parse HEAD)/${1}#L${2}; }; f" |
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
def bar(h, **kwargs) | |
p h, kwargs | |
end | |
# warning | |
bar(k: 42) | |
bar({k: 42}, {k2: 10}) | |
# ok | |
bar({k: 42}) |
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 Foo | |
attr_reader :bar | |
def initialize(bar) | |
@bar = bar | |
end | |
def hoge | |
puts "bar is #{bar}" | |
end | |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
) | |
const script = ` | |
#!ruby | |
puts "Hello, Ruby! VERSION = #{RUBY_VERSION}" |
NewerOlder