SlideShare a Scribd company logo
The secrets of CRuby ecosystem
How to Begin to
Develop Ruby Core
Hiroshi SHIBATA / GMO PEPABO inc.
2016.09.24 Euruko 2016
Chief Engineer
Hiroshi SHIBATA @hsbt
https://www.hsbt.org
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
self.introduce
=>
{
name: “SHIBATA Hiroshi”,
nickname: “hsbt”,
title: “Chief engineer at GMO Pepabo, Inc.”,
commit_bits: [“ruby”, “rake”, “rubygems”, “rdoc”, “psych”, “syck”, “ruby-
build”, “railsgirls”, “railsgirls-jp”, …],
sites: [“hsbt.org”, “ruby-lang.org”, “rubyci.org”, “railsgirls.com”,
“railsgirls.jp”],
}
https://pepabo.com
CEO(@kentarow) and CTO(@kentaro) support me
What’s (C)Ruby?
1.
Variation of Ruby Interpreter
Implementation:
• Ruby(MRI, CRuby)
• JRuby
• Rubinius
• Opal
ISO/IEC 30170:2012:
• CRuby
• mruby
Basis of CRuby and YARV
“ Throughout most of this book we’ll learn about the original,
standard implementation of Ruby, known as Matz’s Ruby Interpreter
(MRI) after Yukihiro Matsumoto, who invented Ruby in 1993.”
Ruby Under a Microscope, p.4
“ With Ruby 1.9, Koichi Sasada and the Ruby core team introduced
Yet Another Ruby Virtual Machine (YARV), which actually executes
your Ruby code.”
Ruby Under a Microscope, p.33
Ruby 1.8
Ruby 1.9
Ruby Committer
Heroku
• Matz
• ko1
• n0kada
$ cat ~svn/.ssh/authorized_keys | awk '{print $5}' | sort | uniq | wc -l
93
Total 91 people + 2 bot
MoneyForward
• shyouhei
Full-time commiters
Branch maintainers
trunk known as 2.4
nurse: Release manager
2.3
nagachika: Stable branch maintainer
2.2, 2.1
unak: Old stable branch maintainer
Linux
•akr
•normalperson
•n0kada
and others
Windows
•unak
•n0kada
Platform maintainers
BSD
•nurse
Solaris
•ngoto
OS X
•n0kada
•mrkn
Ruby Core Maintenance scope policy
Language core features including security
Yukihiro Matsumoto (matz)
Ruby VM(YARV)
Koichi Sasada (ko1)
Core classes
Ruby Commiters
Ruby Core Maintenance Policy
Standard Libraries
Each maintainers
Bundled Libraries(default/bundled gems)
Hiroshi SHIBATA(hsbt), Nobuyoshi Nakada(nobu)
Documentation
Zachary Scott(zzak)
*.ruby-lang.org
www.ruby-lang.org
Official Website of Ruby language. It’s hosted by Heroku.
We welcomed to translate contribution.
see http://github.com/ruby/www.ruby-lang.org
svn.ruby-lang.org
Main repository of Ruby source.
bugs.ruby-lang.org
Official issue tracker of Ruby. It’s hosted by Heroku
*.ruby-lang.org
ftp.ruby-lang.org
Site of distribute official package
docs.ruby-lang.org
Hosted document generated from RDoc and rubima project.
CDN
Our site and package distribution were supported by fastly.
• www.ruby-lang.org
• cache.ruby-lang.org
Statistics of our CDN:
• Access ratio: USA: 37.9%, EU: 17.8%, Asia: 39.0%, Others: 5.3%
• Bandwidth: 6181 GB/month
• Requests: 12,296,848 req/month = 4 req/sec
What does mean “official”?
“official” means “Matz controllable”
Un-controllable examples:
• ruby-doc.org
• rubygems.org
• bundler.io
• rvm/rbenv/chruby
Licenses of Ruby language
• 2-clause BSDL
• Ruby License
see details of `COPYING` file in ruby source code.
Ruby is OSS
Do submit your patch
to OSS
2.
Contributing of OSS
People say:
“Contributing to OSS is easy! Please write some documentation and
submit a patch!”
You say:
“Okay! I will contribute new documentation for Ruby!”
Documentation is hard
• No-one knows the true behavior of OSS
• Only author knows that.
• Documentation is tedious work :bow:
Because documentation is valuable work.
Testing and Running are easy
I always start code reading with the following commands
I pick out `before_script` and `script` code from .travis.yml and
invoke it. For example:
$ git clone https://github.com/some/gems
$ cd gems
$ less .travis.yml
$ bundle install
$ rake spec
$ rake spec:plugins
In the case of ruby
You will get…
$ git clone https://github.com/ruby/ruby
$ cd ruby
$ less .travis.yml
.travis.yml in ruby/ruby
before_script:
- "uname -a"
- "uname -r"
- "rm -fr .ext autom4te.cache"
- "echo $TERM"
- "make -f common.mk BASERUBY=ruby MAKEDIRS='mkdir -p' srcdir=. update-config_files"
- "autoconf"
- "mkdir config_1st config_2nd"
- "./configure -C --disable-install-doc --with-gcc=$CC $CONFIG_FLAG"
- "cp -pr config.status .ext/include config_1st"
- "make reconfig"
- "cp -pr config.status .ext/include config_2nd"
- "diff -ru config_1st config_2nd"
- "make after-update BASERUBY=ruby"
- "make -s $JOBS"
- "make update-rubyspec"
script:
- "make test TESTOPTS=--color=never"
- "make test-all TESTOPTS='-q -j3 --color=never --job-status=normal'"
- "make test-rubyspec MSPECOPT=-fm"
How to contribute
to OSS Ruby
Do submit your patch to ruby core
1. Write code :)
2. Run tests
3. Open bugs.ruby-lang.org and create new account
4. Open https://bugs.ruby-lang.org/projects/ruby-trunk/issues/new
5. Attach your code and write description of your proposal
6. Press “submit”
Do submit your patch to ruby core
1. Write code :)
2. Run tests
3. Open bugs.ruby-lang.org and create new account
4. Open https://bugs.ruby-lang.org/projects/ruby-trunk/issues/new
5. Attach your code and write description of your proposal
6. Press “submit”
Test ruby language
3.
Start to test Ruby language
$ git clone https://github.com/ruby/ruby
$ cd ruby
$ autoconf
$ ./configure —disable-install-doc
$ make -j
$ make check
You can invoke language tests with the following instructions:
% make check TESTS=‘-j4’
(snip)
PASS all 1010 tests
exec ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./bootstraptest/runner.rb" --ruby="ruby --disable-gems"
./KNOWNBUGS.rb
2016-06-18 15:42:02 +0900
Driver is ruby 2.4.0dev (2016-06-18 trunk 55440) [x86_64-darwin15]
Target is ruby 2.4.0dev (2016-06-18 trunk 55440) [x86_64-darwin15]
last_commit=* test/rubygems/test_gem_installer.rb: Fixed broken test with extension build. https://github.com/rubygems/rubygems/pull/1645
KNOWNBUGS.rb PASS 0
No tests, no problem
test succeeded
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
# Running tests:
Finished tests in 2.513254s, 87.9338 tests/s, 177.4592 assertions/s.
221 tests, 446 assertions, 0 failures, 0 errors, 0 skips
ruby -v: ruby 2.4.0dev (2016-06-18 trunk 55440) [x86_64-darwin15]
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name=!/
memory_leak/ --exclude=/testunit/ --exclude=/minitest/ -j4
# Running tests:
[ 89/803] 4625=test_bigdecimal 4626=test_table 4627=test_encodings 4628=test_bug_reporter
common.mk
• check/check-ruby
• btest/btest-ruby
• test-basic/test-knownbug
• test-testframework
• test
• test-all
• test-almost
• test-ruby
• test-rubyspec
make test
• btest-ruby
• snip for next slides
• test-basic
• invoke `basictest/runner.rb` with target ruby
• test-knownbug
• invoke `KNOWNBUGS.rb`
• It’s empty a lot of the time.
make btest-ruby
% ls bootstraptest
pending.rb runner.rb* test_attr.rb test_autoload.rb test_block.rb test_class.rb test_eval.rb test_exception.rb
test_finalizer.rb test_flip.rb test_flow.rb test_fork.rb test_gc.rb test_io.rb test_jump.rb test_literal.rb test_literal_suffix.rb
test_load.rb test_marshal.rb test_massign.rb test_method.rb test_objectspace.rb test_proc.rb test_string.rb test_struct.rb
test_syntax.rb test_thread.rb
What’s `bootstraptest/runner.rb` ?
• load test files and invoke them
• define assertion methods like `assert_equal` etc.
`cat bootstraptest/test_class.rb`
assert_equal 'true', %q( class C; end
Object.const_defined?(:C) )
assert_equal 'Class', %q( class C; end
C.class )
(snip)
assert_equal 'Class', %q( class A; end
class C < A; end
C.class )
(snip)
assert_equal 'M', %q( module M; end
M.name )
(snip)
assert_equal 'A::B', %q( class A; end
class A::B; end
A::B )
test-basic
a, = nil; test_ok(a == nil)
a, = 1; test_ok(a == 1)
a, = []; test_ok(a == nil)
(snip)
def r; return *[]; end; a = r(); test_ok(a == [])
def r; return *[1]; end; a = r(); test_ok(a == [1])
def r; return *[nil]; end; a = r(); test_ok(a == [nil])
(snip)
f = lambda { |a, b=42, *c| [a,b,c] }
test_ok(f.call(1 ) == [1,42,[ ]] )
test_ok(f.call(1,43 ) == [1,43,[ ]] )
test_ok(f.call(1,43,44) == [1,43,[44]] )
(snip)
These are for Developer
of
VM/GC/Syntax/etc
make test-all
test-all invokes test files under the `test` directory. test-all has some
options for testing:
• make test-all TESTS=“logger”
• test only files under `test/logger`
• make test-all TESTS=“-j4”
• it make parallel execution with 4 processes.
cat `test/ruby/test_array.rb`
% cat test/ruby/test_array.rb
# coding: US-ASCII
require 'test/unit'
class TestArray < Test::Unit::TestCase
(snip)
def test_percent_i
assert_equal([:foo, :bar], %i[foo bar])
assert_equal([:""foo"], %i["foo])
end
def test_0_literal
assert_equal([1, 2, 3, 4], [1, 2] + [3, 4])
assert_equal([1, 2, 1, 2], [1, 2] * 2)
assert_equal("1:2", [1, 2] * ":")
(snip)
cat `test/logger/test_logger.rb`
% cat test/logger/test_logger.rb
# coding: US-ASCII
require 'test/unit'
require 'logger'
require 'tempfile'
class TestLogger < Test::Unit::TestCase
(snip)
def test_add
logger = Logger.new(nil)
logger.progname = "my_progname"
assert(logger.add(INFO))
log = log_add(logger, nil, "msg")
assert_equal("ANY", log.severity)
assert_equal("my_progname", log.progname)
(snip)
cat `test/-ext-/array/test_resize.rb`
% cat ext/-test-/array/resize/resize.c
#include "ruby/ruby.h"
static VALUE
ary_resize(VALUE ary, VALUE len)
{
rb_ary_resize(ary, NUM2LONG(len));
return ary;
}
void
Init_resize(void)
{
rb_define_method(rb_cArray, "__resize__", ary_resize, 1);
}
require 'test/unit'
require '-test-/array/resize'
class TestArray < Test::Unit::TestCase
class TestResize < Test::Unit::TestCase
def test_expand
feature = '[ruby-dev:42912]'
ary = [*1..10]
ary.__resize__(10)
assert_equal(10, ary.size, feature)
assert_equal([*1..10], ary, feature)
ary.__resize__(100)
assert_equal(100, ary.size, feature)
(snip)
These are for “you”
make check
make check depends on the following definitions:
• main
• build encodings and extensions.
• test
• test-testframework
• run tests for `testunit` and `minitest`
• test-almost
• run tests under `test` excluding `testunit` and `minitest`
test-unit/minitest
Why separated the test framework?
The following libraries uses minitest directly in Ruby 2.3:
• rubygems
• rdoc
Other libraries uses test-unit. rubygems and rdoc are developed at
github.com/rubygems/rubygems and github.com/rdoc/rdoc. We need
to support these libraries and their tests.
How to merge upstream from others
I merged upstream into ruby/ruby periodically using following
instructions.
ruby and rubygems guarantee to work to test and code each other.
it’s the same situation for ruby and rdoc
$ git clone https://github.com/ruby/ruby
$ git clone https://github.com/rubygems/rubygems
$ cd ruby
$ rm -rf lib/rubygems test/rubygtems lib/rubygems.rb
$ cp -rf ../../rubygems/rubygems/lib/rubygems ./lib
$ cp -rf ../../rubygems/rubygems/lib/rubygems.rb ./lib
$ cp -rf ../../rubygems/rubygems/test/rubygems ./test
$ git checkout lib/rubygems/LICENSE.txt
backport is hard
rubygems still supports Ruby 1.8.
% g show a34fb569e41cd87866e644d92a9df4be89b3cad2 test/rubygems/test_gem_package.rb
commit a34fb569e41cd87866e644d92a9df4be89b3cad2
Author: Eric Hodel <drbrain@segment7.net>
(snip)
--- test/rubygems/test_gem_package.rb
+++ test/rubygems/test_gem_package.rb
@@ -638,7 +638,7 @@ class TestGemPackage < Gem::Package::TarTestCase
e.message
io
end
- tf.close!
+ tf.close! if tf.respond_to? :close!
end
def test_verify_empty
ruby/spec
RubySpec
Q. What’s rubyspec?
A. RubySpec is an executable specification for the Ruby
programming language.
“Matz's Ruby Developers Don't Use RubySpec and It's Hurting Ruby”
http://rubini.us/2014/12/31/matz-s-ruby-developers-don-t-use-rubyspec/
“ruby/spec” is not a “specification”. It’s actually a set of “test”. The
only real ruby specification is inside of Matz :)
make test-rubyspec
CRuby has `make update-rubyspec` and `make test-rubyspec` tasks.
•`make update-rubyspec`
• pulls ruby/rubyspec and ruby/mspec into the spec directory.
•`make test-rubyspec`
• invokes mspec with the ruby binary and the latest rubyspecs.
cat spec/rubyspec/core/string/append_spec.rb
% cat spec/rubyspec/core/string/concat_spec.rb
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/concat', __FILE__)
describe "String#<<" do
it_behaves_like :string_concat, :<<
it_behaves_like :string_concat_encoding, :<<
end
% cat spec/rubyspec/core/string/shared/concat.rb
describe :string_concat, shared: true do
it "concatenates the given argument to self and returns self" do
str = 'hello '
str.send(@method, 'world').should equal(str)
str.should == "hello world"
end
(snip)
Please check details: https://github.com/ruby/spec
rubyspec and mspec
We approved new or updated examples at github.com/ruby/spec.
@headius wrote: “So nice to see RubySpec getting a steady stream
of Ruby 2.3 specs.”
https://twitter.com/headius/status/667793518098673664
A lot of contributors submitted new specs for Ruby 2.3 and 2.4
features.
test coverage
% make update-coverage
updating simplecov ...
remote: Counting objects: 90, done.
(snip)
updating simplecov-html ...
updating doclie …
% COVERAGE=1 make test-all TESTS=webrick
I added a coverage task using simplecov
You can get coverage results for `webrick` under the coverage
directory.
How to Begin to Develop Ruby Core
Please contribute tests to ruby
$ git clone https://github.com/ruby/ruby
$ cd ruby
$ autoconf
$ ./configure —disable-install-doc
$ make -j
$ make check
You can invoke focused tests with coverage:
$ COVERAGE=1 make test-all TESTS=“logger”
$ open coverage/index.html
You can code new tests or update existing tests. and submit it.
Ruby (language) testing
is
so easy
How request Ruby core
4.
Feature request
• We need to focus “Use case” than “function”.
• We need to attach patch to feature request.
• We need Matz approval.
Acceptable requests without usecase
• Symmetrical:
`Array#shift`, `Array#unshift`
• POSIX
Socket.gethostbyname
• [BUG] [SEGV]
Bug report
• We need minimum reproduction code
• We need to describe expected/unexpected behavior
• We need to attach crash log
• We need to try different version of ruby
Issue tracker
Our official tracker is “bugs.ruby-lang.org”
Mailing list integration
•https://github.com/ruby/redmine_*
•This behavior is same as github
Continuous Upgrade Ruby and Rails to latest version.
Redmine vs GitHub
github.com/ruby/ruby is ok for ruby core team
[CAUTION] If you hope to ask new feature to Matz, You need to
submit bugs.ruby-lang.org . Matz is only available on redmine.
Why Ruby does not use GitHub?
• GitHub is proprietary service
• ruby committers do not have problem with redmine
• We start to consider issue of “Why Ruby does not use Git”
Monthly Developer Meeting
We hope to increase to transparency for Ruby development process.
One of our challenges is “Developer Meeting”. It’s open discussion
time for feature and issue of Ruby every months.
[ruby-core:69550]: https://bugs.ruby-lang.org/projects/ruby/wiki/
DevelopersMeeting20150728Japan
Gemification for stdlib
• We extract old or un-maintain status stdlibs like net-telnet, xmlrpc,
tk to bundled gems.
• These are extracted under the https://github.com/ruby/ . And
shipped on rubygems.org
• Date, CGI, Readline are also extracted at the future(It’s my ideas).
• OpenSSL is also extracted default gems. You can update it
separated ruby core releases same as rubygems, rdoc, bigdecimal
How develop Ruby core
5.
Ruby CI
What’s Ruby CI
Ruby CI is a CI results collector for alternative platforms
• http://rubyci.org
• https://github.com/nurse/rubyci
• https://github.com/ruby/chkbuild
Ruby CI goal is entirely supports all of Ruby platform. We can detect
a lot of build fails using Ruby CI. It has 2 or 3 versions every linux
distribution and BSD, Windows, OS X, Solaris Environments.
How to Begin to Develop Ruby Core
How to add a new server
You can add your server to rubyci.org
Requirements:
• not yet supported platforms.
• ex. linux with ARM, *BSD, icc with OSX, Windows
• periodically running every day
• It must be possible to access to AWS S3
You should check the following commands on your server
$ git clone https://github.com/akr/chkbuild
$ cd chkbuild
$ ruby start-build
Version number and release cycle
We plan to release every christmas.
• 2.1.0: 2013/12/25
• 2.2.0: 2014/12/25
• 2.3.0: 2015/12/25
• 2.4.0: 2016/12/25(TBD)
Ruby core backport model
trunk
ruby_2_1
ruby_2_0_0
trunk
ruby_2_1
ruby_2_0_0
We backport fixes to stable branch from trunk.
We do not merge fixes to trunk from stable branch
Release management
We will release new version of Ruby at “Release Day” by @narse
There is no exception to this rule.
• If we have incompletion issue or feature, we will revert it.
• If we don’t have enough discussion for some issue, we don’t
merge or implement it into new version of ruby.
• If we found some regression, we need to fix it or revert to related
code or issue.
Security release
We have “security@ruby-lang.org” for security report. We received
buffer overflow, memory leak, escape string etc etc…
We hard to fix and release these security issue. so all of release
maintainer are volunteer work.
Our release delayed by preparing new releases of stable and old
stable version.
HackerOne
We’ve been use
https://hackerone.com/ruby
It has bounty program provided by IBB.
We accepts to security report via
hackerone too.
How to Begin to Develop Ruby Core
Conclusion
CRuby secrets
•Who develop CRuby
•Where is official resource of CRuby
•How to develop CRuby
•What is important of feature request in CRuby
•When release new version of CRuby
and…
Why use Ruby?
“Ruby is designed to make
programmers happy.”

More Related Content

What's hot (20)

PDF
How DSL works on Ruby
Hiroshi SHIBATA
 
PDF
The details of CI/CD environment for Ruby
Hiroshi SHIBATA
 
PDF
Gems on Ruby
Hiroshi SHIBATA
 
PDF
RubyGems 3 & 4
Hiroshi SHIBATA
 
PDF
RubyGems 3 & 4
Hiroshi SHIBATA
 
PDF
How to test code with mruby
Hiroshi SHIBATA
 
PDF
The Future of Dependency Management for Ruby
Hiroshi SHIBATA
 
PDF
How to distribute Ruby to the world
Hiroshi SHIBATA
 
PDF
20140918 ruby kaigi2014
Hiroshi SHIBATA
 
PDF
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
PDF
20140419 oedo rubykaigi04
Hiroshi SHIBATA
 
PDF
How to distribute Ruby to the world
Hiroshi SHIBATA
 
PDF
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
PDF
20140425 ruby conftaiwan2014
Hiroshi SHIBATA
 
PDF
What's new in RubyGems3
Hiroshi SHIBATA
 
PDF
How to develop the Standard Libraries of Ruby?
Hiroshi SHIBATA
 
PDF
Gems on Ruby
Hiroshi SHIBATA
 
KEY
tDiary annual report 2009 - Sapporo Ruby Kaigi02
Hiroshi SHIBATA
 
PDF
The Future of library dependency management of Ruby
Hiroshi SHIBATA
 
PDF
20140626 red dotrubyconf2014
Hiroshi SHIBATA
 
How DSL works on Ruby
Hiroshi SHIBATA
 
The details of CI/CD environment for Ruby
Hiroshi SHIBATA
 
Gems on Ruby
Hiroshi SHIBATA
 
RubyGems 3 & 4
Hiroshi SHIBATA
 
RubyGems 3 & 4
Hiroshi SHIBATA
 
How to test code with mruby
Hiroshi SHIBATA
 
The Future of Dependency Management for Ruby
Hiroshi SHIBATA
 
How to distribute Ruby to the world
Hiroshi SHIBATA
 
20140918 ruby kaigi2014
Hiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
20140419 oedo rubykaigi04
Hiroshi SHIBATA
 
How to distribute Ruby to the world
Hiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
20140425 ruby conftaiwan2014
Hiroshi SHIBATA
 
What's new in RubyGems3
Hiroshi SHIBATA
 
How to develop the Standard Libraries of Ruby?
Hiroshi SHIBATA
 
Gems on Ruby
Hiroshi SHIBATA
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
Hiroshi SHIBATA
 
The Future of library dependency management of Ruby
Hiroshi SHIBATA
 
20140626 red dotrubyconf2014
Hiroshi SHIBATA
 

Viewers also liked (9)

PDF
RSpec Performance Turning
Go Sueyoshi (a.k.a sue445)
 
PDF
Test::Kantan - Perl and Testing
Tokuhiro Matsuno
 
PPTX
やさしいGemパッチの作り方
Maki Toshio
 
PDF
Quine・難解プログラミングについて
mametter
 
PDF
Cookpad 17 day Tech internship 2017 言語処理系入門 Rubyをコンパイルしよう
Koichi Sasada
 
PDF
Esoteric, Obfuscated, Artistic Programming in Ruby
mametter
 
ODP
Goのサーバサイド実装におけるレイヤ設計とレイヤ内実装について考える
pospome
 
PDF
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
PDF
Perfect Norikra 2nd Season
SATOSHI TAGOMORI
 
RSpec Performance Turning
Go Sueyoshi (a.k.a sue445)
 
Test::Kantan - Perl and Testing
Tokuhiro Matsuno
 
やさしいGemパッチの作り方
Maki Toshio
 
Quine・難解プログラミングについて
mametter
 
Cookpad 17 day Tech internship 2017 言語処理系入門 Rubyをコンパイルしよう
Koichi Sasada
 
Esoteric, Obfuscated, Artistic Programming in Ruby
mametter
 
Goのサーバサイド実装におけるレイヤ設計とレイヤ内実装について考える
pospome
 
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
Perfect Norikra 2nd Season
SATOSHI TAGOMORI
 
Ad

Similar to How to Begin to Develop Ruby Core (20)

PDF
The story of language development
Hiroshi SHIBATA
 
ODP
Ruby
Aizat Faiz
 
PPT
An Introduction to Ruby on Rails 20100506
Vu Hung Nguyen
 
PPT
An introduction-to-ruby-on-rails
vinicorp
 
PDF
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
Salesforce Marketing Cloud
 
PPTX
Toolbox of a Ruby Team
Arto Artnik
 
ODP
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
rivierarb
 
PDF
Rails Performance
Wen-Tien Chang
 
PDF
JRuby, Ruby, Rails and You on the Cloud
Hiro Asari
 
PDF
IJTC%202009%20JRuby
tutorialsruby
 
PDF
IJTC%202009%20JRuby
tutorialsruby
 
PPTX
TechDays - IronRuby
Ben Hall
 
PPTX
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
PDF
Hacking with ruby2ruby
Marc Chung
 
PPTX
Why Ruby?
IT Weekend
 
KEY
plackdo, plack-like web interface on perl6
Nobuo Danjou
 
PDF
Ruby on Rails Presentation
Michael MacDonald
 
KEY
Rails Presentation (Anton Dmitriyev)
True-Vision
 
KEY
Speedy TDD with Rails
PatchSpace Ltd
 
PDF
Practical Testing of Ruby Core
Hiroshi SHIBATA
 
The story of language development
Hiroshi SHIBATA
 
An Introduction to Ruby on Rails 20100506
Vu Hung Nguyen
 
An introduction-to-ruby-on-rails
vinicorp
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
Salesforce Marketing Cloud
 
Toolbox of a Ruby Team
Arto Artnik
 
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
rivierarb
 
Rails Performance
Wen-Tien Chang
 
JRuby, Ruby, Rails and You on the Cloud
Hiro Asari
 
IJTC%202009%20JRuby
tutorialsruby
 
IJTC%202009%20JRuby
tutorialsruby
 
TechDays - IronRuby
Ben Hall
 
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Hacking with ruby2ruby
Marc Chung
 
Why Ruby?
IT Weekend
 
plackdo, plack-like web interface on perl6
Nobuo Danjou
 
Ruby on Rails Presentation
Michael MacDonald
 
Rails Presentation (Anton Dmitriyev)
True-Vision
 
Speedy TDD with Rails
PatchSpace Ltd
 
Practical Testing of Ruby Core
Hiroshi SHIBATA
 
Ad

More from Hiroshi SHIBATA (16)

PDF
Introduction of Cybersecurity with Ruby at RedDotRubyConf 2024
Hiroshi SHIBATA
 
PDF
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
PDF
Long journey of Ruby Standard library at RubyKaigi 2024
Hiroshi SHIBATA
 
PDF
Long journey of Ruby standard library at RubyConf AU 2024
Hiroshi SHIBATA
 
PDF
Deep dive into Ruby's require - RubyConf Taiwan 2023
Hiroshi SHIBATA
 
PDF
How resolve Gem dependencies in your code?
Hiroshi SHIBATA
 
PDF
How resolve Gem dependencies in your code?
Hiroshi SHIBATA
 
PDF
Ruby コミッターと歩む Ruby を用いたプロダクト開発
Hiroshi SHIBATA
 
PDF
Why ANDPAD commit Ruby and RubyKaigi?
Hiroshi SHIBATA
 
PDF
RailsGirls から始める エンジニアリングはじめの一歩
Hiroshi SHIBATA
 
PDF
Roadmap for RubyGems 4 and Bundler 3
Hiroshi SHIBATA
 
PDF
Ruby Security the Hard Way
Hiroshi SHIBATA
 
PDF
OSS Security the hard way
Hiroshi SHIBATA
 
PDF
The Future of library dependency manageement of Ruby
Hiroshi SHIBATA
 
PDF
The Future of Bundled Bundler
Hiroshi SHIBATA
 
PDF
Productive Organization with Ruby
Hiroshi SHIBATA
 
Introduction of Cybersecurity with Ruby at RedDotRubyConf 2024
Hiroshi SHIBATA
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Long journey of Ruby Standard library at RubyKaigi 2024
Hiroshi SHIBATA
 
Long journey of Ruby standard library at RubyConf AU 2024
Hiroshi SHIBATA
 
Deep dive into Ruby's require - RubyConf Taiwan 2023
Hiroshi SHIBATA
 
How resolve Gem dependencies in your code?
Hiroshi SHIBATA
 
How resolve Gem dependencies in your code?
Hiroshi SHIBATA
 
Ruby コミッターと歩む Ruby を用いたプロダクト開発
Hiroshi SHIBATA
 
Why ANDPAD commit Ruby and RubyKaigi?
Hiroshi SHIBATA
 
RailsGirls から始める エンジニアリングはじめの一歩
Hiroshi SHIBATA
 
Roadmap for RubyGems 4 and Bundler 3
Hiroshi SHIBATA
 
Ruby Security the Hard Way
Hiroshi SHIBATA
 
OSS Security the hard way
Hiroshi SHIBATA
 
The Future of library dependency manageement of Ruby
Hiroshi SHIBATA
 
The Future of Bundled Bundler
Hiroshi SHIBATA
 
Productive Organization with Ruby
Hiroshi SHIBATA
 

Recently uploaded (20)

PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 

How to Begin to Develop Ruby Core

  • 1. The secrets of CRuby ecosystem How to Begin to Develop Ruby Core Hiroshi SHIBATA / GMO PEPABO inc. 2016.09.24 Euruko 2016
  • 2. Chief Engineer Hiroshi SHIBATA @hsbt https://www.hsbt.org
  • 5. self.introduce => { name: “SHIBATA Hiroshi”, nickname: “hsbt”, title: “Chief engineer at GMO Pepabo, Inc.”, commit_bits: [“ruby”, “rake”, “rubygems”, “rdoc”, “psych”, “syck”, “ruby- build”, “railsgirls”, “railsgirls-jp”, …], sites: [“hsbt.org”, “ruby-lang.org”, “rubyci.org”, “railsgirls.com”, “railsgirls.jp”], }
  • 8. Variation of Ruby Interpreter Implementation: • Ruby(MRI, CRuby) • JRuby • Rubinius • Opal ISO/IEC 30170:2012: • CRuby • mruby
  • 9. Basis of CRuby and YARV “ Throughout most of this book we’ll learn about the original, standard implementation of Ruby, known as Matz’s Ruby Interpreter (MRI) after Yukihiro Matsumoto, who invented Ruby in 1993.” Ruby Under a Microscope, p.4 “ With Ruby 1.9, Koichi Sasada and the Ruby core team introduced Yet Another Ruby Virtual Machine (YARV), which actually executes your Ruby code.” Ruby Under a Microscope, p.33 Ruby 1.8 Ruby 1.9
  • 10. Ruby Committer Heroku • Matz • ko1 • n0kada $ cat ~svn/.ssh/authorized_keys | awk '{print $5}' | sort | uniq | wc -l 93 Total 91 people + 2 bot MoneyForward • shyouhei Full-time commiters
  • 11. Branch maintainers trunk known as 2.4 nurse: Release manager 2.3 nagachika: Stable branch maintainer 2.2, 2.1 unak: Old stable branch maintainer
  • 13. Ruby Core Maintenance scope policy Language core features including security Yukihiro Matsumoto (matz) Ruby VM(YARV) Koichi Sasada (ko1) Core classes Ruby Commiters
  • 14. Ruby Core Maintenance Policy Standard Libraries Each maintainers Bundled Libraries(default/bundled gems) Hiroshi SHIBATA(hsbt), Nobuyoshi Nakada(nobu) Documentation Zachary Scott(zzak)
  • 15. *.ruby-lang.org www.ruby-lang.org Official Website of Ruby language. It’s hosted by Heroku. We welcomed to translate contribution. see http://github.com/ruby/www.ruby-lang.org svn.ruby-lang.org Main repository of Ruby source. bugs.ruby-lang.org Official issue tracker of Ruby. It’s hosted by Heroku
  • 16. *.ruby-lang.org ftp.ruby-lang.org Site of distribute official package docs.ruby-lang.org Hosted document generated from RDoc and rubima project.
  • 17. CDN Our site and package distribution were supported by fastly. • www.ruby-lang.org • cache.ruby-lang.org Statistics of our CDN: • Access ratio: USA: 37.9%, EU: 17.8%, Asia: 39.0%, Others: 5.3% • Bandwidth: 6181 GB/month • Requests: 12,296,848 req/month = 4 req/sec
  • 18. What does mean “official”? “official” means “Matz controllable” Un-controllable examples: • ruby-doc.org • rubygems.org • bundler.io • rvm/rbenv/chruby
  • 19. Licenses of Ruby language • 2-clause BSDL • Ruby License see details of `COPYING` file in ruby source code.
  • 21. Do submit your patch to OSS 2.
  • 22. Contributing of OSS People say: “Contributing to OSS is easy! Please write some documentation and submit a patch!” You say: “Okay! I will contribute new documentation for Ruby!”
  • 23. Documentation is hard • No-one knows the true behavior of OSS • Only author knows that. • Documentation is tedious work :bow: Because documentation is valuable work.
  • 24. Testing and Running are easy I always start code reading with the following commands I pick out `before_script` and `script` code from .travis.yml and invoke it. For example: $ git clone https://github.com/some/gems $ cd gems $ less .travis.yml $ bundle install $ rake spec $ rake spec:plugins
  • 25. In the case of ruby You will get… $ git clone https://github.com/ruby/ruby $ cd ruby $ less .travis.yml
  • 26. .travis.yml in ruby/ruby before_script: - "uname -a" - "uname -r" - "rm -fr .ext autom4te.cache" - "echo $TERM" - "make -f common.mk BASERUBY=ruby MAKEDIRS='mkdir -p' srcdir=. update-config_files" - "autoconf" - "mkdir config_1st config_2nd" - "./configure -C --disable-install-doc --with-gcc=$CC $CONFIG_FLAG" - "cp -pr config.status .ext/include config_1st" - "make reconfig" - "cp -pr config.status .ext/include config_2nd" - "diff -ru config_1st config_2nd" - "make after-update BASERUBY=ruby" - "make -s $JOBS" - "make update-rubyspec" script: - "make test TESTOPTS=--color=never" - "make test-all TESTOPTS='-q -j3 --color=never --job-status=normal'" - "make test-rubyspec MSPECOPT=-fm"
  • 28. Do submit your patch to ruby core 1. Write code :) 2. Run tests 3. Open bugs.ruby-lang.org and create new account 4. Open https://bugs.ruby-lang.org/projects/ruby-trunk/issues/new 5. Attach your code and write description of your proposal 6. Press “submit”
  • 29. Do submit your patch to ruby core 1. Write code :) 2. Run tests 3. Open bugs.ruby-lang.org and create new account 4. Open https://bugs.ruby-lang.org/projects/ruby-trunk/issues/new 5. Attach your code and write description of your proposal 6. Press “submit”
  • 31. Start to test Ruby language $ git clone https://github.com/ruby/ruby $ cd ruby $ autoconf $ ./configure —disable-install-doc $ make -j $ make check You can invoke language tests with the following instructions:
  • 32. % make check TESTS=‘-j4’ (snip) PASS all 1010 tests exec ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./bootstraptest/runner.rb" --ruby="ruby --disable-gems" ./KNOWNBUGS.rb 2016-06-18 15:42:02 +0900 Driver is ruby 2.4.0dev (2016-06-18 trunk 55440) [x86_64-darwin15] Target is ruby 2.4.0dev (2016-06-18 trunk 55440) [x86_64-darwin15] last_commit=* test/rubygems/test_gem_installer.rb: Fixed broken test with extension build. https://github.com/rubygems/rubygems/pull/1645 KNOWNBUGS.rb PASS 0 No tests, no problem test succeeded Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" # Running tests: Finished tests in 2.513254s, 87.9338 tests/s, 177.4592 assertions/s. 221 tests, 446 assertions, 0 failures, 0 errors, 0 skips ruby -v: ruby 2.4.0dev (2016-06-18 trunk 55440) [x86_64-darwin15] Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name=!/ memory_leak/ --exclude=/testunit/ --exclude=/minitest/ -j4 # Running tests: [ 89/803] 4625=test_bigdecimal 4626=test_table 4627=test_encodings 4628=test_bug_reporter
  • 33. common.mk • check/check-ruby • btest/btest-ruby • test-basic/test-knownbug • test-testframework • test • test-all • test-almost • test-ruby • test-rubyspec
  • 34. make test • btest-ruby • snip for next slides • test-basic • invoke `basictest/runner.rb` with target ruby • test-knownbug • invoke `KNOWNBUGS.rb` • It’s empty a lot of the time.
  • 35. make btest-ruby % ls bootstraptest pending.rb runner.rb* test_attr.rb test_autoload.rb test_block.rb test_class.rb test_eval.rb test_exception.rb test_finalizer.rb test_flip.rb test_flow.rb test_fork.rb test_gc.rb test_io.rb test_jump.rb test_literal.rb test_literal_suffix.rb test_load.rb test_marshal.rb test_massign.rb test_method.rb test_objectspace.rb test_proc.rb test_string.rb test_struct.rb test_syntax.rb test_thread.rb What’s `bootstraptest/runner.rb` ? • load test files and invoke them • define assertion methods like `assert_equal` etc.
  • 36. `cat bootstraptest/test_class.rb` assert_equal 'true', %q( class C; end Object.const_defined?(:C) ) assert_equal 'Class', %q( class C; end C.class ) (snip) assert_equal 'Class', %q( class A; end class C < A; end C.class ) (snip) assert_equal 'M', %q( module M; end M.name ) (snip) assert_equal 'A::B', %q( class A; end class A::B; end A::B )
  • 37. test-basic a, = nil; test_ok(a == nil) a, = 1; test_ok(a == 1) a, = []; test_ok(a == nil) (snip) def r; return *[]; end; a = r(); test_ok(a == []) def r; return *[1]; end; a = r(); test_ok(a == [1]) def r; return *[nil]; end; a = r(); test_ok(a == [nil]) (snip) f = lambda { |a, b=42, *c| [a,b,c] } test_ok(f.call(1 ) == [1,42,[ ]] ) test_ok(f.call(1,43 ) == [1,43,[ ]] ) test_ok(f.call(1,43,44) == [1,43,[44]] ) (snip)
  • 38. These are for Developer of VM/GC/Syntax/etc
  • 39. make test-all test-all invokes test files under the `test` directory. test-all has some options for testing: • make test-all TESTS=“logger” • test only files under `test/logger` • make test-all TESTS=“-j4” • it make parallel execution with 4 processes.
  • 40. cat `test/ruby/test_array.rb` % cat test/ruby/test_array.rb # coding: US-ASCII require 'test/unit' class TestArray < Test::Unit::TestCase (snip) def test_percent_i assert_equal([:foo, :bar], %i[foo bar]) assert_equal([:""foo"], %i["foo]) end def test_0_literal assert_equal([1, 2, 3, 4], [1, 2] + [3, 4]) assert_equal([1, 2, 1, 2], [1, 2] * 2) assert_equal("1:2", [1, 2] * ":") (snip)
  • 41. cat `test/logger/test_logger.rb` % cat test/logger/test_logger.rb # coding: US-ASCII require 'test/unit' require 'logger' require 'tempfile' class TestLogger < Test::Unit::TestCase (snip) def test_add logger = Logger.new(nil) logger.progname = "my_progname" assert(logger.add(INFO)) log = log_add(logger, nil, "msg") assert_equal("ANY", log.severity) assert_equal("my_progname", log.progname) (snip)
  • 42. cat `test/-ext-/array/test_resize.rb` % cat ext/-test-/array/resize/resize.c #include "ruby/ruby.h" static VALUE ary_resize(VALUE ary, VALUE len) { rb_ary_resize(ary, NUM2LONG(len)); return ary; } void Init_resize(void) { rb_define_method(rb_cArray, "__resize__", ary_resize, 1); } require 'test/unit' require '-test-/array/resize' class TestArray < Test::Unit::TestCase class TestResize < Test::Unit::TestCase def test_expand feature = '[ruby-dev:42912]' ary = [*1..10] ary.__resize__(10) assert_equal(10, ary.size, feature) assert_equal([*1..10], ary, feature) ary.__resize__(100) assert_equal(100, ary.size, feature) (snip)
  • 43. These are for “you”
  • 44. make check make check depends on the following definitions: • main • build encodings and extensions. • test • test-testframework • run tests for `testunit` and `minitest` • test-almost • run tests under `test` excluding `testunit` and `minitest`
  • 46. Why separated the test framework? The following libraries uses minitest directly in Ruby 2.3: • rubygems • rdoc Other libraries uses test-unit. rubygems and rdoc are developed at github.com/rubygems/rubygems and github.com/rdoc/rdoc. We need to support these libraries and their tests.
  • 47. How to merge upstream from others I merged upstream into ruby/ruby periodically using following instructions. ruby and rubygems guarantee to work to test and code each other. it’s the same situation for ruby and rdoc $ git clone https://github.com/ruby/ruby $ git clone https://github.com/rubygems/rubygems $ cd ruby $ rm -rf lib/rubygems test/rubygtems lib/rubygems.rb $ cp -rf ../../rubygems/rubygems/lib/rubygems ./lib $ cp -rf ../../rubygems/rubygems/lib/rubygems.rb ./lib $ cp -rf ../../rubygems/rubygems/test/rubygems ./test $ git checkout lib/rubygems/LICENSE.txt
  • 48. backport is hard rubygems still supports Ruby 1.8. % g show a34fb569e41cd87866e644d92a9df4be89b3cad2 test/rubygems/test_gem_package.rb commit a34fb569e41cd87866e644d92a9df4be89b3cad2 Author: Eric Hodel <[email protected]> (snip) --- test/rubygems/test_gem_package.rb +++ test/rubygems/test_gem_package.rb @@ -638,7 +638,7 @@ class TestGemPackage < Gem::Package::TarTestCase e.message io end - tf.close! + tf.close! if tf.respond_to? :close! end def test_verify_empty
  • 50. RubySpec Q. What’s rubyspec? A. RubySpec is an executable specification for the Ruby programming language. “Matz's Ruby Developers Don't Use RubySpec and It's Hurting Ruby” http://rubini.us/2014/12/31/matz-s-ruby-developers-don-t-use-rubyspec/ “ruby/spec” is not a “specification”. It’s actually a set of “test”. The only real ruby specification is inside of Matz :)
  • 51. make test-rubyspec CRuby has `make update-rubyspec` and `make test-rubyspec` tasks. •`make update-rubyspec` • pulls ruby/rubyspec and ruby/mspec into the spec directory. •`make test-rubyspec` • invokes mspec with the ruby binary and the latest rubyspecs.
  • 52. cat spec/rubyspec/core/string/append_spec.rb % cat spec/rubyspec/core/string/concat_spec.rb require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) require File.expand_path('../shared/concat', __FILE__) describe "String#<<" do it_behaves_like :string_concat, :<< it_behaves_like :string_concat_encoding, :<< end % cat spec/rubyspec/core/string/shared/concat.rb describe :string_concat, shared: true do it "concatenates the given argument to self and returns self" do str = 'hello ' str.send(@method, 'world').should equal(str) str.should == "hello world" end (snip) Please check details: https://github.com/ruby/spec
  • 53. rubyspec and mspec We approved new or updated examples at github.com/ruby/spec. @headius wrote: “So nice to see RubySpec getting a steady stream of Ruby 2.3 specs.” https://twitter.com/headius/status/667793518098673664 A lot of contributors submitted new specs for Ruby 2.3 and 2.4 features.
  • 54. test coverage % make update-coverage updating simplecov ... remote: Counting objects: 90, done. (snip) updating simplecov-html ... updating doclie … % COVERAGE=1 make test-all TESTS=webrick I added a coverage task using simplecov You can get coverage results for `webrick` under the coverage directory.
  • 56. Please contribute tests to ruby $ git clone https://github.com/ruby/ruby $ cd ruby $ autoconf $ ./configure —disable-install-doc $ make -j $ make check You can invoke focused tests with coverage: $ COVERAGE=1 make test-all TESTS=“logger” $ open coverage/index.html You can code new tests or update existing tests. and submit it.
  • 58. How request Ruby core 4.
  • 59. Feature request • We need to focus “Use case” than “function”. • We need to attach patch to feature request. • We need Matz approval.
  • 60. Acceptable requests without usecase • Symmetrical: `Array#shift`, `Array#unshift` • POSIX Socket.gethostbyname • [BUG] [SEGV]
  • 61. Bug report • We need minimum reproduction code • We need to describe expected/unexpected behavior • We need to attach crash log • We need to try different version of ruby
  • 62. Issue tracker Our official tracker is “bugs.ruby-lang.org” Mailing list integration •https://github.com/ruby/redmine_* •This behavior is same as github Continuous Upgrade Ruby and Rails to latest version.
  • 63. Redmine vs GitHub github.com/ruby/ruby is ok for ruby core team [CAUTION] If you hope to ask new feature to Matz, You need to submit bugs.ruby-lang.org . Matz is only available on redmine. Why Ruby does not use GitHub? • GitHub is proprietary service • ruby committers do not have problem with redmine • We start to consider issue of “Why Ruby does not use Git”
  • 64. Monthly Developer Meeting We hope to increase to transparency for Ruby development process. One of our challenges is “Developer Meeting”. It’s open discussion time for feature and issue of Ruby every months. [ruby-core:69550]: https://bugs.ruby-lang.org/projects/ruby/wiki/ DevelopersMeeting20150728Japan
  • 65. Gemification for stdlib • We extract old or un-maintain status stdlibs like net-telnet, xmlrpc, tk to bundled gems. • These are extracted under the https://github.com/ruby/ . And shipped on rubygems.org • Date, CGI, Readline are also extracted at the future(It’s my ideas). • OpenSSL is also extracted default gems. You can update it separated ruby core releases same as rubygems, rdoc, bigdecimal
  • 66. How develop Ruby core 5.
  • 68. What’s Ruby CI Ruby CI is a CI results collector for alternative platforms • http://rubyci.org • https://github.com/nurse/rubyci • https://github.com/ruby/chkbuild Ruby CI goal is entirely supports all of Ruby platform. We can detect a lot of build fails using Ruby CI. It has 2 or 3 versions every linux distribution and BSD, Windows, OS X, Solaris Environments.
  • 70. How to add a new server You can add your server to rubyci.org Requirements: • not yet supported platforms. • ex. linux with ARM, *BSD, icc with OSX, Windows • periodically running every day • It must be possible to access to AWS S3 You should check the following commands on your server $ git clone https://github.com/akr/chkbuild $ cd chkbuild $ ruby start-build
  • 71. Version number and release cycle We plan to release every christmas. • 2.1.0: 2013/12/25 • 2.2.0: 2014/12/25 • 2.3.0: 2015/12/25 • 2.4.0: 2016/12/25(TBD)
  • 72. Ruby core backport model trunk ruby_2_1 ruby_2_0_0 trunk ruby_2_1 ruby_2_0_0 We backport fixes to stable branch from trunk. We do not merge fixes to trunk from stable branch
  • 73. Release management We will release new version of Ruby at “Release Day” by @narse There is no exception to this rule. • If we have incompletion issue or feature, we will revert it. • If we don’t have enough discussion for some issue, we don’t merge or implement it into new version of ruby. • If we found some regression, we need to fix it or revert to related code or issue.
  • 74. Security release We have [email protected]” for security report. We received buffer overflow, memory leak, escape string etc etc… We hard to fix and release these security issue. so all of release maintainer are volunteer work. Our release delayed by preparing new releases of stable and old stable version.
  • 75. HackerOne We’ve been use https://hackerone.com/ruby It has bounty program provided by IBB. We accepts to security report via hackerone too.
  • 78. CRuby secrets •Who develop CRuby •Where is official resource of CRuby •How to develop CRuby •What is important of feature request in CRuby •When release new version of CRuby and…
  • 80. “Ruby is designed to make programmers happy.”