SlideShare a Scribd company logo
The future of Rake
Hiroshi SHIBATA / GMO PEPABO inc.
2016.09.08 RubyKaigi 2016
How DSL works on Ruby
Chief Engineer
Hiroshi SHIBATA @hsbt
https://www.hsbt.org
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”, “tdiary”, “hiki”…],
sites: [“hsbt.org”, “ruby-lang.org”, “rubyci.org”, “railsgirls.com”,
“railsgirls.jp”],
}
My work in Ruby 2.4
•Maintain *.ruby-lang.org. Applied to Site Reliability Engineering.
•Gemify standard library (xmlrpc, tk)
•Update bundled library such as rubygems, rdoc, psych, json
•Maintain ruby-build
•Maintain Psych 2.0, 2.1, also Syck
•Maintain RDoc 4.2, 5.0
•Maintain Rake 10.5, 11.2 and 12.0(TBD)
Rake
1.
Make in Ruby
Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
specified in standard Ruby syntax.
task :awesome do
puts :bar
end
task beat: [:awesome] do
puts :buzz
end
task default: :beat
Rake features
•Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby
syntax.
•Users can specify tasks with prerequisites.
•Supports parallel execution of tasks.
$ rake -j
Rake::FileList
•It’s also declaration named `Filelist` on Toplevel.
•It has utility class for File listing.
file_list = FileList.new('lib/**/*.rb', ‘test/test*.rb')
FileList['a.c', 'b.c'].exclude("a.c") => [‘b.c']
Rake::TestTask
Minitest and Test::Unit integration task of Rake
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/**/test_*.rb']
end
It is only task for outside library. Task for rdoc, bundler, and more is stored their
gems.
First SemVer
•Rake is a first famous gem adopted semantic versioning in rubygems
•probably…
•Rake 0.9 bump to 10.0 for next version.
•Rake follows this release policy now.
ruby/rake
•Rake was originally created by Jim Weirich, who unfortunately passed away in
February 2014.
•This repository was originally hosted at github.com/jimweirich/rake, It has been
moved to ruby/rake by @drbrain
•@drbrain and @hsbt maintain ruby/rake
Download Ranking
Rake is most downloaded gem in the ruby world.
What’s DSL
2.
DSL is Domain Specific Language
In the situation of Ruby language
•Ruby is readable language. Because we often use internal DSL.
•Ruby has a lot of functions for building internal DSL. It uses meta-programming
technic.
“A domain-specific language (DSL) is a computer language specialized to a particular
application domain”
https://en.wikipedia.org/wiki/Domain-specific_language
Pattern: Class method
Slightly simple DSL on standalone class
class User
has_many :foo
end
Pattern: Class method
Slightly simple DSL on standalone class
class User
has_many :foo
end
class User
def self.has_many(foo)
puts foo
end
end
Pattern: Module and Class ancestors
You can build simple DSL used Ruby’s module and class
class User < ARBase
has_many :blogs
end
Pattern: Module and Class ancestors
You can build simple DSL used Ruby’s module and class
module DSL
def has_many(bar = nil)
puts bar
end
end
class ARBase
extend DSL
end
class User < ARBase
has_many :blogs
end
Pattern: Method define
You can define method via eval for simple DSL
class User < ARBase
has_many :blogs
blogs_foo
end
Pattern: Method define
module DSL
def has_many(bar = nil)
self.class.module_eval <<-CODE, __FILE__, __LINE__
def #{bar}_foo
puts :foo
end
CODE
end
end
(snip)
You can define method via eval for simple DSL
class User < ARBase
has_many :blogs
blogs_foo
end
Pattern: Implicit code block
We need to prepare to configuration for gem behavior changes.
Foo.configure do |c|
c.bar = :buzz
end
Pattern: Implicit code block
We need to prepare to configuration for gem behavior changes.
module Foo
def self.configure
yield self
end
class << self
attr_accessor :bar
end
end
Foo.configure do |c|
c.bar = :buzz
end
Pattern: Decrative setter
We can implement `Explicit code block` used instance_eval.
Foo.configure do
bar :buzz
end
Pattern: Decrative setter
We can implement `Explicit code block` used instance_eval.
module Foo
def self.configure(&block)
instance_eval(&block)
end
class << self
def bar(v = nil)
v ? @bar = v : @bar
end
end
end
Foo.configure do
bar :buzz
end
Pattern: instance_eval
You can provide class scoped DSL via instance_eval
gemfile = <<-GEM
gem 'foo'
GEM
Foo.new.eval_gemfile(gemfile)
Pattern: instance_eval
You can provide class scoped DSL via instance_eval
class Foo
def gem(name)
p name
end
def eval_gemfile(file)
instance_eval(file)
end
end
gemfile = <<-GEM
gem 'foo'
GEM
Foo.new.eval_gemfile(gemfile)
DSL in Rubygems
3.
DSL in Ruby language
•Rake
•Capistrano
•Thor
•Bundler
Rake and Rake.application
•rake_module.rb: defined `Rake.application` for Rake singleton instance.
•Rake.application returns `Rake::Application` instance.
•`rake` command invoke `Rake.application.run`
def run
standard_exception_handling do
init
load_rakefile
top_level
end
end
Rake::Application#init , Rake::Application#load_rakefile
•`init` method handles…
•detect invoking task: “rake -j foo” -> detecting “foo”
•parse given option: “rake -j foo” -> detecting “-j”
•`load_rakefile` read default rakefile named `%w(rakefile Rakefile rakefile.rb
Rakefile.rb)`
Rake::Application#top_level
•If you add `-T` options, top_level shows list of tasks on Rakefile
•If you add `-P` options, top_level shows dependencies of target task.
•top_level invokes tasks given command line. Example for `rake foo bar buzz`.
top_level invokes three tasks.
•top_level methods are under the thread pool on Rake.
Object#task
•load_rakefile simply load Rakefile used by `load` method provided by Ruby.
•Your Rakefile DSL provided by `Rake::DSL` filed dsl_definition.rb
module Rake
module DSL
(snip)
def task(*args, &block) # :doc:
Rake::Task.define_task(*args, &block)
end
end
end
self.extend Rake::DSL
Rake::Task
•`Rake::Task` instance is defined by `Rake::TaskManager#define_task`
•`Rake::Task` have manipulation tasks on class methods like clear, tasks, [], and
more.
•Class method of `Rake::Task` call `Rake::TaskManager` via `Rake.application`
instance.
Rake::Task
•`Rake::TaskManager#define_task` build actions, dependencies and scope for task.
actions are stored code blocks.
•`Rake::Task#invoke` invoke tasks of dependencies and @actions for Proc#call
•Invoked task marked @already_invoked flag. If you clear this flag, you need to run
`Rake::Task#reenable`
def enhance(deps=nil, &block)
@prerequisites |= deps if deps
@actions << block if block_given?
self
end
Capistrano
•Capistrano is a framework for building automated deployment scripts.
•Capistrano tasks on version 3 are simple rake task
task :restart_sidekiq do
on roles(:worker) do
execute :service, "sidekiq restart"
end
end
after "deploy:published", "restart_sidekiq"
•`Capistrano::Application` inherited `Rake::Application`
Thor
Thor is a simple and efficient tool for building self-documenting command line
utilities.
class App < Thor
desc "list [SEARCH]", "list all of the available apps, limited by SEARCH"
def list(search="")
# list everything
end
end
Thor provides inherited pattern DSL for their CLI. You can invoke it used `Thor.start`
Bundler
•`Bundler::CLI` inherited Thor class. It’s simple thor command.
• Bundler provides Gemfile DSL used DSL class and instance_eval
def eval_gemfile(gemfile, contents = nil)
expanded_gemfile_path = Pathname.new(gemfile).expand_path
original_gemfile = @gemfile
@gemfile = expanded_gemfile_path
contents ||= Bundler.read_file(gemfile.to_s)
instance_eval(contents.dup.untaint, gemfile.to_s, 1)
(snip)
CM
https://pepabo.com
もっとおもしろくできる
http://www.apple.com/jp/apple-pay/
https://www.youtube.com/watch?v=BdQVd1uybCg
We are hiring!!1
Please follow our account @pb_recruit
Long live the Rake
4.
Rake 10.x
•My first maintained version of Rake
•I triaged issues and fixed broken test at first
JRuby compatible issues
•`Dir.chdir` change behavior of `sh()` on JRuby
•https://github.com/ruby/rake/pull/101
•https://github.com/jruby/jruby/issues/3653
•https://github.com/hsbt/rake-issue-chdir
Reproduction code
def sh(*cmd)
res = system(*cmd)
status = $?
p [res, status]
end
RUBY = ENV['RUBY'] || File.join(
RbConfig::CONFIG['bindir'],
RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT'])
ENV['RAKE_TEST_SH'] = 'someval'
sh RUBY, 'check_no_expansion.rb', '$RAKE_TEST_SH', 'someval'
Dir.chdir 'test'
sh RUBY, 'check_no_expansion.rb', '$RAKE_TEST_SH', 'someval'
Results - Ruby 2.3.0
% ruby rake_issue.rb
["$RAKE_TEST_SH", "someval"]
[true, #<Process::Status: pid 24928 exit 0>]
["$RAKE_TEST_SH", "someval"]
[true, #<Process::Status: pid 24929 exit 0>]
Results - JRuby 9.0.5.0 and 1.7.24
% ruby rake_issue.rb
["$RAKE_TEST_SH", "someval"]
[true, #<Process::Status: pid 21844 exit 0>]
["someval", "someval"]
[false, #<Process::Status: pid 21845 exit 1>]
JRuby 9.0.5.0
% ruby rake_issue.rb
["$RAKE_TEST_SH", "someval"]
[true, #<Process::Status: pid=22397,exited(0)>]
["$RAKE_TEST_SH", "someval"]
[true, #<Process::Status: pid=22398,exited(0)>]
JRuby 1.7.24
Another compatible issues on JRuby
•`Exception#cause` is difference behavior with CRuby 2.3.0
•https://github.com/jruby/jruby/issues/3654
•Missing stdout using `Open3.popen` after `Dir.chdir`
•https://github.com/jruby/jruby/issues/3655
Rake 11
5.
Rake 11.x
•My first major release version of Rake
•It have some of breaking changes
•It uses modern ecosystem on ruby language
Removed deprecated code
•I removed deprecated code commented by Jim
•Some historical gems like yard and rspec used `TaskManager#last_comment`
•I reverted to delete `last_comment` at Rake 11
•I’m sorry to inconvenience experience for above breaking changes.
Rewrite hoe to bundler
•You may invoke to `bundle` when to see Gemfile
•Without bundler, you need to install hoe and their plugins.
•I sometimes rewrite gem release tasks at rake, psych, syck…etc.
Unexpected behavior for rake - verbose
•I misunderstand to behavior of `verbose` option on Rake#Testtask
•expected: verbose option of rake task same as Ruby’s `-W` option. So you can get
additional debug/warn message with your ruby code.
•actual: verbose option on rake displays details of command runner. and minitest has
another `verbose` option. It shows test name and results for test suites.
Unexpected behavior for rake - deps
I added deps option for `Rake::TestTask`
task :setup do
end
Rake::TestTask.new do |t|
t.deps = :setup
end
task :setup do
end
Rake::TestTask.new(:test) => [:setup] do
end
But It’s same behavior this.
Rake 12
6.
Rake 12.x?
•I works to develop to Rake 12
•Release date is tentative
•This is major version-up. I have plan to some breaking changes.
Drop to support old Ruby
•Rake have concurrent task runner
•Current implementation detects core number used by system utilities like `sysctl`.
•But Ruby 2.2 provides `Etc.nprocessor` for detects core number natively.
•I like ruby core function. Rake 12 only supports Ruby 2.2 or later same as Rails 5.
minimize/minirake
•Rake have a lot of functions. I hope to reduce code for fast invocation when We run
rake task.
•Idea 1: Reduce code without core function like `rake-contrib`
•Idea 2: minirake - mruby have minimum implementation of rake
default task
I will add default method for difine default task
task :default => [:foo, :bar]
default [:foo, :bar]
to
Do not use main(Object class)
•Rake defined task method under main instance provided the Object class.
•We cant use name of `task` on irb/rails console when you use Rake gem.
•I hope to solve it.
Conclusion
•Summarize Rake history and basis.
•Introduce DSL pattern of Ruby language
•Learn Rake internal
•Show Rake 10 and 11 works
•Propose Rake 12 future.
Let’s fan to maintain big OSS

More Related Content

What's hot

How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
Hiroshi SHIBATA
 
20140925 rails pacific
20140925 rails pacific20140925 rails pacific
20140925 rails pacific
Hiroshi SHIBATA
 
Dependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesDependency Resolution with Standard Libraries
Dependency Resolution with Standard Libraries
Hiroshi SHIBATA
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
Hiroshi SHIBATA
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
Hiroshi SHIBATA
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
Hiroshi SHIBATA
 
20140626 red dotrubyconf2014
20140626 red dotrubyconf201420140626 red dotrubyconf2014
20140626 red dotrubyconf2014
Hiroshi SHIBATA
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
Hiroshi SHIBATA
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
Hiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
20140425 ruby conftaiwan2014
20140425 ruby conftaiwan201420140425 ruby conftaiwan2014
20140425 ruby conftaiwan2014
Hiroshi SHIBATA
 
Improve extension API: C++ as better language for extension
Improve extension API: C++ as better language for extensionImprove extension API: C++ as better language for extension
Improve extension API: C++ as better language for extension
Kouhei Sutou
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
Hiroshi SHIBATA
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
Hiroshi SHIBATA
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Hiroshi SHIBATA
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
Hiroshi SHIBATA
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
Hiroshi SHIBATA
 
Gate of Agile Web Development
Gate of Agile Web DevelopmentGate of Agile Web Development
Gate of Agile Web Development
Koichi ITO
 
20140419 oedo rubykaigi04
20140419 oedo rubykaigi0420140419 oedo rubykaigi04
20140419 oedo rubykaigi04
Hiroshi SHIBATA
 
20140918 ruby kaigi2014
20140918 ruby kaigi201420140918 ruby kaigi2014
20140918 ruby kaigi2014
Hiroshi SHIBATA
 

What's hot (20)

How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
20140925 rails pacific
20140925 rails pacific20140925 rails pacific
20140925 rails pacific
 
Dependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesDependency Resolution with Standard Libraries
Dependency Resolution with Standard Libraries
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
 
20140626 red dotrubyconf2014
20140626 red dotrubyconf201420140626 red dotrubyconf2014
20140626 red dotrubyconf2014
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
20140425 ruby conftaiwan2014
20140425 ruby conftaiwan201420140425 ruby conftaiwan2014
20140425 ruby conftaiwan2014
 
Improve extension API: C++ as better language for extension
Improve extension API: C++ as better language for extensionImprove extension API: C++ as better language for extension
Improve extension API: C++ as better language for extension
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
Gate of Agile Web Development
Gate of Agile Web DevelopmentGate of Agile Web Development
Gate of Agile Web Development
 
20140419 oedo rubykaigi04
20140419 oedo rubykaigi0420140419 oedo rubykaigi04
20140419 oedo rubykaigi04
 
20140918 ruby kaigi2014
20140918 ruby kaigi201420140918 ruby kaigi2014
20140918 ruby kaigi2014
 

Viewers also liked

How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby Core
Hiroshi SHIBATA
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
Toru Kawamura
 
High Performance tDiary
High Performance tDiaryHigh Performance tDiary
High Performance tDiary
Hiroshi SHIBATA
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
 
GitHub Enterprise with GMO Pepabo
GitHub Enterprise with GMO PepaboGitHub Enterprise with GMO Pepabo
GitHub Enterprise with GMO Pepabo
Hiroshi SHIBATA
 
PHP AST 徹底解説(補遺)
PHP AST 徹底解説(補遺)PHP AST 徹底解説(補遺)
PHP AST 徹底解説(補遺)
do_aki
 
成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略
Hiroshi SHIBATA
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなし
Hiroshi SHIBATA
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby Core
Hiroshi SHIBATA
 
signal の話 或いは Zend Signals とは何か
signal の話 或いは Zend Signals とは何かsignal の話 或いは Zend Signals とは何か
signal の話 或いは Zend Signals とは何か
do_aki
 
Practical ngx_mruby
Practical ngx_mrubyPractical ngx_mruby
Practical ngx_mruby
Hiroshi SHIBATA
 
The story of language development
The story of language developmentThe story of language development
The story of language development
Hiroshi SHIBATA
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutes
Hiroshi SHIBATA
 
このPHP拡張がすごい!2017
このPHP拡張がすごい!2017このPHP拡張がすごい!2017
このPHP拡張がすごい!2017
sasezaki
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
Hiroshi SHIBATA
 
技術的負債との付き合い方
技術的負債との付き合い方技術的負債との付き合い方
技術的負債との付き合い方
Hiroshi SHIBATA
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using ruby
Kazuho Oku
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
SATOSHI TAGOMORI
 

Viewers also liked (18)

How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby Core
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
 
High Performance tDiary
High Performance tDiaryHigh Performance tDiary
High Performance tDiary
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
GitHub Enterprise with GMO Pepabo
GitHub Enterprise with GMO PepaboGitHub Enterprise with GMO Pepabo
GitHub Enterprise with GMO Pepabo
 
PHP AST 徹底解説(補遺)
PHP AST 徹底解説(補遺)PHP AST 徹底解説(補遺)
PHP AST 徹底解説(補遺)
 
成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなし
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby Core
 
signal の話 或いは Zend Signals とは何か
signal の話 或いは Zend Signals とは何かsignal の話 或いは Zend Signals とは何か
signal の話 或いは Zend Signals とは何か
 
Practical ngx_mruby
Practical ngx_mrubyPractical ngx_mruby
Practical ngx_mruby
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutes
 
このPHP拡張がすごい!2017
このPHP拡張がすごい!2017このPHP拡張がすごい!2017
このPHP拡張がすごい!2017
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
 
技術的負債との付き合い方
技術的負債との付き合い方技術的負債との付き合い方
技術的負債との付き合い方
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using ruby
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 

Similar to How DSL works on Ruby

TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
bobmcwhirter
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
Mark Menard
 
Ruby
RubyRuby
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
Lance Ball
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
Manoj Kumar
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
Espen Brækken
 
Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02
sagaroceanic11
 
2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb
awwaiid
 
Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2
Henry S
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
Hiroshi SHIBATA
 
Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9
David Calavera
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
Brian Sam-Bodden
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Rack
sickill
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation
platico_dev
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
Wen-Tien Chang
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
Thomas Asikis
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
Hiroshi SHIBATA
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
Burke Libbey
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
Charles Nutter
 

Similar to How DSL works on Ruby (20)

TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
Ruby
RubyRuby
Ruby
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02
 
2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb
 
Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
 
Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Rack
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 

More from Hiroshi SHIBATA

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

More from Hiroshi SHIBATA (15)

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

Recently uploaded

Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
Matthias Neugebauer
 
Amul milk launches in US: Key details of its new products ...
Amul milk launches in US: Key details of its new products ...Amul milk launches in US: Key details of its new products ...
Amul milk launches in US: Key details of its new products ...
chetankumar9855
 
Salesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot WorkshopSalesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot Workshop
CEPTES Software Inc
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
SynapseIndia
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
alexjohnson7307
 
CiscoIconsLibrary cours de réseau VLAN.ppt
CiscoIconsLibrary cours de réseau VLAN.pptCiscoIconsLibrary cours de réseau VLAN.ppt
CiscoIconsLibrary cours de réseau VLAN.ppt
moinahousna
 
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
digitalxplive
 
Google I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged SlidesGoogle I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged Slides
Google Developer Group - Harare
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Kunal Gupta
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
Safe Software
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024
aakash malhotra
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
WhatsApp Spy Online Trackers and Monitoring Apps
WhatsApp Spy Online Trackers and Monitoring AppsWhatsApp Spy Online Trackers and Monitoring Apps
WhatsApp Spy Online Trackers and Monitoring Apps
HackersList
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
bhumivarma35300
 

Recently uploaded (20)

Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
 
Amul milk launches in US: Key details of its new products ...
Amul milk launches in US: Key details of its new products ...Amul milk launches in US: Key details of its new products ...
Amul milk launches in US: Key details of its new products ...
 
Salesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot WorkshopSalesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot Workshop
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
 
CiscoIconsLibrary cours de réseau VLAN.ppt
CiscoIconsLibrary cours de réseau VLAN.pptCiscoIconsLibrary cours de réseau VLAN.ppt
CiscoIconsLibrary cours de réseau VLAN.ppt
 
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
 
Google I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged SlidesGoogle I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged Slides
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
WhatsApp Spy Online Trackers and Monitoring Apps
WhatsApp Spy Online Trackers and Monitoring AppsWhatsApp Spy Online Trackers and Monitoring Apps
WhatsApp Spy Online Trackers and Monitoring Apps
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
 

How DSL works on Ruby

  • 1. The future of Rake Hiroshi SHIBATA / GMO PEPABO inc. 2016.09.08 RubyKaigi 2016 How DSL works on Ruby
  • 2. Chief Engineer Hiroshi SHIBATA @hsbt https://www.hsbt.org
  • 3. 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”, “tdiary”, “hiki”…], sites: [“hsbt.org”, “ruby-lang.org”, “rubyci.org”, “railsgirls.com”, “railsgirls.jp”], }
  • 4. My work in Ruby 2.4 •Maintain *.ruby-lang.org. Applied to Site Reliability Engineering. •Gemify standard library (xmlrpc, tk) •Update bundled library such as rubygems, rdoc, psych, json •Maintain ruby-build •Maintain Psych 2.0, 2.1, also Syck •Maintain RDoc 4.2, 5.0 •Maintain Rake 10.5, 11.2 and 12.0(TBD)
  • 6. Make in Ruby Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax. task :awesome do puts :bar end task beat: [:awesome] do puts :buzz end task default: :beat
  • 7. Rake features •Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax. •Users can specify tasks with prerequisites. •Supports parallel execution of tasks. $ rake -j
  • 8. Rake::FileList •It’s also declaration named `Filelist` on Toplevel. •It has utility class for File listing. file_list = FileList.new('lib/**/*.rb', ‘test/test*.rb') FileList['a.c', 'b.c'].exclude("a.c") => [‘b.c']
  • 9. Rake::TestTask Minitest and Test::Unit integration task of Rake require 'rake/testtask' Rake::TestTask.new(:test) do |t| t.libs << "test" t.verbose = true t.test_files = FileList['test/**/test_*.rb'] end It is only task for outside library. Task for rdoc, bundler, and more is stored their gems.
  • 10. First SemVer •Rake is a first famous gem adopted semantic versioning in rubygems •probably… •Rake 0.9 bump to 10.0 for next version. •Rake follows this release policy now.
  • 11. ruby/rake •Rake was originally created by Jim Weirich, who unfortunately passed away in February 2014. •This repository was originally hosted at github.com/jimweirich/rake, It has been moved to ruby/rake by @drbrain •@drbrain and @hsbt maintain ruby/rake
  • 12. Download Ranking Rake is most downloaded gem in the ruby world.
  • 14. DSL is Domain Specific Language In the situation of Ruby language •Ruby is readable language. Because we often use internal DSL. •Ruby has a lot of functions for building internal DSL. It uses meta-programming technic. “A domain-specific language (DSL) is a computer language specialized to a particular application domain” https://en.wikipedia.org/wiki/Domain-specific_language
  • 15. Pattern: Class method Slightly simple DSL on standalone class class User has_many :foo end
  • 16. Pattern: Class method Slightly simple DSL on standalone class class User has_many :foo end class User def self.has_many(foo) puts foo end end
  • 17. Pattern: Module and Class ancestors You can build simple DSL used Ruby’s module and class class User < ARBase has_many :blogs end
  • 18. Pattern: Module and Class ancestors You can build simple DSL used Ruby’s module and class module DSL def has_many(bar = nil) puts bar end end class ARBase extend DSL end class User < ARBase has_many :blogs end
  • 19. Pattern: Method define You can define method via eval for simple DSL class User < ARBase has_many :blogs blogs_foo end
  • 20. Pattern: Method define module DSL def has_many(bar = nil) self.class.module_eval <<-CODE, __FILE__, __LINE__ def #{bar}_foo puts :foo end CODE end end (snip) You can define method via eval for simple DSL class User < ARBase has_many :blogs blogs_foo end
  • 21. Pattern: Implicit code block We need to prepare to configuration for gem behavior changes. Foo.configure do |c| c.bar = :buzz end
  • 22. Pattern: Implicit code block We need to prepare to configuration for gem behavior changes. module Foo def self.configure yield self end class << self attr_accessor :bar end end Foo.configure do |c| c.bar = :buzz end
  • 23. Pattern: Decrative setter We can implement `Explicit code block` used instance_eval. Foo.configure do bar :buzz end
  • 24. Pattern: Decrative setter We can implement `Explicit code block` used instance_eval. module Foo def self.configure(&block) instance_eval(&block) end class << self def bar(v = nil) v ? @bar = v : @bar end end end Foo.configure do bar :buzz end
  • 25. Pattern: instance_eval You can provide class scoped DSL via instance_eval gemfile = <<-GEM gem 'foo' GEM Foo.new.eval_gemfile(gemfile)
  • 26. Pattern: instance_eval You can provide class scoped DSL via instance_eval class Foo def gem(name) p name end def eval_gemfile(file) instance_eval(file) end end gemfile = <<-GEM gem 'foo' GEM Foo.new.eval_gemfile(gemfile)
  • 28. DSL in Ruby language •Rake •Capistrano •Thor •Bundler
  • 29. Rake and Rake.application •rake_module.rb: defined `Rake.application` for Rake singleton instance. •Rake.application returns `Rake::Application` instance. •`rake` command invoke `Rake.application.run` def run standard_exception_handling do init load_rakefile top_level end end
  • 30. Rake::Application#init , Rake::Application#load_rakefile •`init` method handles… •detect invoking task: “rake -j foo” -> detecting “foo” •parse given option: “rake -j foo” -> detecting “-j” •`load_rakefile` read default rakefile named `%w(rakefile Rakefile rakefile.rb Rakefile.rb)`
  • 31. Rake::Application#top_level •If you add `-T` options, top_level shows list of tasks on Rakefile •If you add `-P` options, top_level shows dependencies of target task. •top_level invokes tasks given command line. Example for `rake foo bar buzz`. top_level invokes three tasks. •top_level methods are under the thread pool on Rake.
  • 32. Object#task •load_rakefile simply load Rakefile used by `load` method provided by Ruby. •Your Rakefile DSL provided by `Rake::DSL` filed dsl_definition.rb module Rake module DSL (snip) def task(*args, &block) # :doc: Rake::Task.define_task(*args, &block) end end end self.extend Rake::DSL
  • 33. Rake::Task •`Rake::Task` instance is defined by `Rake::TaskManager#define_task` •`Rake::Task` have manipulation tasks on class methods like clear, tasks, [], and more. •Class method of `Rake::Task` call `Rake::TaskManager` via `Rake.application` instance.
  • 34. Rake::Task •`Rake::TaskManager#define_task` build actions, dependencies and scope for task. actions are stored code blocks. •`Rake::Task#invoke` invoke tasks of dependencies and @actions for Proc#call •Invoked task marked @already_invoked flag. If you clear this flag, you need to run `Rake::Task#reenable` def enhance(deps=nil, &block) @prerequisites |= deps if deps @actions << block if block_given? self end
  • 35. Capistrano •Capistrano is a framework for building automated deployment scripts. •Capistrano tasks on version 3 are simple rake task task :restart_sidekiq do on roles(:worker) do execute :service, "sidekiq restart" end end after "deploy:published", "restart_sidekiq" •`Capistrano::Application` inherited `Rake::Application`
  • 36. Thor Thor is a simple and efficient tool for building self-documenting command line utilities. class App < Thor desc "list [SEARCH]", "list all of the available apps, limited by SEARCH" def list(search="") # list everything end end Thor provides inherited pattern DSL for their CLI. You can invoke it used `Thor.start`
  • 37. Bundler •`Bundler::CLI` inherited Thor class. It’s simple thor command. • Bundler provides Gemfile DSL used DSL class and instance_eval def eval_gemfile(gemfile, contents = nil) expanded_gemfile_path = Pathname.new(gemfile).expand_path original_gemfile = @gemfile @gemfile = expanded_gemfile_path contents ||= Bundler.read_file(gemfile.to_s) instance_eval(contents.dup.untaint, gemfile.to_s, 1) (snip)
  • 38. CM
  • 43. We are hiring!!1 Please follow our account @pb_recruit
  • 44. Long live the Rake 4.
  • 45. Rake 10.x •My first maintained version of Rake •I triaged issues and fixed broken test at first
  • 46. JRuby compatible issues •`Dir.chdir` change behavior of `sh()` on JRuby •https://github.com/ruby/rake/pull/101 •https://github.com/jruby/jruby/issues/3653 •https://github.com/hsbt/rake-issue-chdir
  • 47. Reproduction code def sh(*cmd) res = system(*cmd) status = $? p [res, status] end RUBY = ENV['RUBY'] || File.join( RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']) ENV['RAKE_TEST_SH'] = 'someval' sh RUBY, 'check_no_expansion.rb', '$RAKE_TEST_SH', 'someval' Dir.chdir 'test' sh RUBY, 'check_no_expansion.rb', '$RAKE_TEST_SH', 'someval'
  • 48. Results - Ruby 2.3.0 % ruby rake_issue.rb ["$RAKE_TEST_SH", "someval"] [true, #<Process::Status: pid 24928 exit 0>] ["$RAKE_TEST_SH", "someval"] [true, #<Process::Status: pid 24929 exit 0>]
  • 49. Results - JRuby 9.0.5.0 and 1.7.24 % ruby rake_issue.rb ["$RAKE_TEST_SH", "someval"] [true, #<Process::Status: pid 21844 exit 0>] ["someval", "someval"] [false, #<Process::Status: pid 21845 exit 1>] JRuby 9.0.5.0 % ruby rake_issue.rb ["$RAKE_TEST_SH", "someval"] [true, #<Process::Status: pid=22397,exited(0)>] ["$RAKE_TEST_SH", "someval"] [true, #<Process::Status: pid=22398,exited(0)>] JRuby 1.7.24
  • 50. Another compatible issues on JRuby •`Exception#cause` is difference behavior with CRuby 2.3.0 •https://github.com/jruby/jruby/issues/3654 •Missing stdout using `Open3.popen` after `Dir.chdir` •https://github.com/jruby/jruby/issues/3655
  • 52. Rake 11.x •My first major release version of Rake •It have some of breaking changes •It uses modern ecosystem on ruby language
  • 53. Removed deprecated code •I removed deprecated code commented by Jim •Some historical gems like yard and rspec used `TaskManager#last_comment` •I reverted to delete `last_comment` at Rake 11 •I’m sorry to inconvenience experience for above breaking changes.
  • 54. Rewrite hoe to bundler •You may invoke to `bundle` when to see Gemfile •Without bundler, you need to install hoe and their plugins. •I sometimes rewrite gem release tasks at rake, psych, syck…etc.
  • 55. Unexpected behavior for rake - verbose •I misunderstand to behavior of `verbose` option on Rake#Testtask •expected: verbose option of rake task same as Ruby’s `-W` option. So you can get additional debug/warn message with your ruby code. •actual: verbose option on rake displays details of command runner. and minitest has another `verbose` option. It shows test name and results for test suites.
  • 56. Unexpected behavior for rake - deps I added deps option for `Rake::TestTask` task :setup do end Rake::TestTask.new do |t| t.deps = :setup end task :setup do end Rake::TestTask.new(:test) => [:setup] do end But It’s same behavior this.
  • 58. Rake 12.x? •I works to develop to Rake 12 •Release date is tentative •This is major version-up. I have plan to some breaking changes.
  • 59. Drop to support old Ruby •Rake have concurrent task runner •Current implementation detects core number used by system utilities like `sysctl`. •But Ruby 2.2 provides `Etc.nprocessor` for detects core number natively. •I like ruby core function. Rake 12 only supports Ruby 2.2 or later same as Rails 5.
  • 60. minimize/minirake •Rake have a lot of functions. I hope to reduce code for fast invocation when We run rake task. •Idea 1: Reduce code without core function like `rake-contrib` •Idea 2: minirake - mruby have minimum implementation of rake
  • 61. default task I will add default method for difine default task task :default => [:foo, :bar] default [:foo, :bar] to
  • 62. Do not use main(Object class) •Rake defined task method under main instance provided the Object class. •We cant use name of `task` on irb/rails console when you use Rake gem. •I hope to solve it.
  • 63. Conclusion •Summarize Rake history and basis. •Introduce DSL pattern of Ruby language •Learn Rake internal •Show Rake 10 and 11 works •Propose Rake 12 future.
  • 64. Let’s fan to maintain big OSS