- Mastering Chef
- Mayank Joshi
- 187字
- 2021-07-16 14:02:24
IRB
IRB is an acronym for "interactive Ruby". It's a tool that provided alongside Ruby interpreter, which allows for the interactive execution of Ruby expressions. These expressions are delivered to IRB using standard input.
Let's quickly see IRB in action:
~ irb 2.1-head :001 >
When we enter the irb
command, it throws a shell at us. The format of the shell prompt is as follows:
$RUBY_VERSION :$LINE_NUMBER >
You can customize this prompt to your liking. However, for now, just remember that whatever expression you enter at the prompt is interpreted as a Ruby expression and is evaluated right away.
Consider the following as an example:
irb 2.1-head :001 > 2+3 => 5
As you can see, we entered an arithmetic expression to compute the sum of two numbers, 2 and 3, and in return IRB returned us the output of computation.
To exit out of IRB, just issue the quit
or exit
command at the prompt.
To learn more about IRB and how to customize it to your liking, read the IRB documentation at http://ruby-doc.org/stdlib-2.1.5/libdoc/irb/rdoc/IRB.html. Replace 2.1.5
with the Ruby version installed on your machine.
- 密碼學(xué)原理與Java實(shí)現(xiàn)
- CMDB分步構(gòu)建指南
- Python for Secret Agents:Volume II
- 程序員面試筆試寶典
- 三維圖形化C++趣味編程
- Spring Boot+Spring Cloud+Vue+Element項(xiàng)目實(shí)戰(zhàn):手把手教你開(kāi)發(fā)權(quán)限管理系統(tǒng)
- 微信公眾平臺(tái)開(kāi)發(fā):從零基礎(chǔ)到ThinkPHP5高性能框架實(shí)踐
- 軟件項(xiàng)目管理實(shí)用教程
- Learning ArcGIS for Desktop
- ASP.NET Core 2 Fundamentals
- Python+Tableau數(shù)據(jù)可視化之美
- C# and .NET Core Test Driven Development
- Spring 5 Design Patterns
- HTML5+CSS3+JavaScript 從入門到項(xiàng)目實(shí)踐(超值版)
- Xamarin Blueprints