易截截图软件、单文件、免安装、纯绿色、仅160KB

交互式 Ruby Shell irb

irb 是从命令行运行的
irb 的命令行选项(摘自 Porgramming Ruby 第二版)
-f
禁止读取~/.irbrc Suppress reading ~/.irbrc.
-m
数学模式(支持分数和矩阵) Math mode (fraction and matrix support is available).
-d
设置#DEBUG为true(同ruby -d一样)  Set $DEBUG to true (same as ``ruby -d'').
-r load-module
同ruby -r Same as ``ruby -r''.
--inspect
使用Object#inspect来格式化输出(默认方式,除数学模式外) Use ``inspect'' for output (the default, unless in math mode).
 
--noinspect
不使用inspect进行输出 Do not use inspect for output.
--readline
使用Readline扩展模块 Use Readline extension module.
--noreadline
不使用Readline扩展模块 Do not use Readline extension module.
--prompt prompt-mode
切换提示符。预定义的模式包括(null,default,simple,xmp以及inf-ruby) Switch prompt mode. Predefined prompt modes are ``default'', ``simple'', ``xmp'', and ``inf-ruby''.
--prompt-mode prompt-mode
Same as --prompt.
 
--inf-ruby-mode
设置irb以Emacs的inf-ruby-mode模式运行,更改提示符并废止-readline Sets up irb to run in inf-ruby-mode under Emacs. Changes the prompt and suppresses --readline.
 
--simple-prompt
使用简单的提示符 Simple prompt mode.
--noprompt
不显示提示符 Do not display a prompt.
--tracer
显示命令执行的跟踪 Display trace for execution of commands.
--back-trace-limit n
显示最顶部和尾部的n项回溯信息。默认值为16 Display backtrace information using the top n and last n entries. The default value is 16.
 
--irb_debug n
将内部调试级别设置为n(只对irb的开发有用) Set internal debug level to n (only for irb development).
 
-v, --version
显示irb的版本号 Print the version of irb.
命令行开始执行后,irb显示一个提示符并等待输入。
使用irb的默认提示符,它显示当前的绑定、缩进(嵌套)级别以及行号。
如:
C:\>irb
irb(main):001:0> elvuel="elvuel"
=> "elvuel"
irb(main):002:0> elvuel.class
=> String
 
可以通过exit 或 quit,或者通过输入一个文件结束符号(如果没有设置IGNORE_EOF模式)来退出


相关文档:

代码高亮,Ruby代码


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 680460288 22 0 262145 0;}
@font-face
{font-family:"Cambria Mat ......

Ruby 1.9不会杀死Python

      松本行宏如约于圣诞节发布了Ruby 1.9。根据Ruby的惯例,小数点后面第一位如果是单数,那么就表明这是一个实验版本,不推荐用于产品环境。所谓“产品环境”,对于目前的Ruby来说,基本上就是Ruby on Rails。从目前RoR社群的反映来看,确实有人正在尝试用Ruby 1.9配合RoR,但是尚属 ......

Ruby Shoes 的鼠标事件

因为一次偶然的机会接触了Ruby语言。然后下载了Ruby Shoes工具。
发现Ruby还是蛮有趣的。
花了一段时间熟悉了它的语法。
下面来试试它的鼠标功能。
Shoes.app do
  #图片初始化
  @img = image "http://www.google.cn/intl/zh-CN/images/logo_cn.gif"
  #图片关于鼠标的调用
 & ......

自动化测试之路(一) ruby初探

从今天起不再浪费时间,开始走向自动化测试这条光明的道路,并以搭建一个自动化测试平台为目标,并这个过程一点点的记录下来和大家分享
首先,是ruby环境的搭建
(1)到ruby的官网:http://www.ruby-lang.org/en/下载 ruby安装程序;
      PS :选择 ruby on windows,我下载的是Ruby 1.8.6 One ......

设计模式 观察者模式实现例子(ruby)

ruby中自带实现观察者模式的类observer。可以利用它来实现观察者模式。
代码例子:
# -*- coding: GB2312 -*-
require 'observer'
# 观察者模式(ruby)的使用例子
# 被观察者P
class PObservable
include Observable
end
# 观察者A
class AObserver
# update方法名是必须的要有的
def update(arg)
puts "AO ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号