文章来源:http://www.ibm.com/developerworks/cn/opensource/os-cn-rubysbl/Symbol 是什么Ruby 是一个强大的面向对象脚本语言(本文所用 Ruby 版本为1.8.6),在 Ruby 中 Symbol 表示“名字”,比如字符串的名字,标识符的名字。创建一个 Symbol 对象的方法是在名字或者字符串前面加上冒号:创建 symbol 对...【阅读全文】
PHP与Ruby on Rails两大阵营均拥有大量各自的忠实粉丝。拿两者作比较,本身就是难以取舍。无论谁赢了,都会引来对方粉丝的口水。受此影响,在两者选其一这个问题上,开发者通常会显得犹豫不决。这篇文章的出发点虽然是比较,但并不是一边倒式地唱盛唱衰,而是辩证式的综合对比。没有好坏,适合自己的...【阅读全文】
Ruby中的字符串占位符的替换值是操作字符串的常用方法,使用#进行变量或者ruby代码的求值,从而替换结果插入字符串中#/usr/bin/env rubybook_mark = "znw123"# following replace and insertputs "The book mark is #{book_mark}"#following run ruby code, string length and insertputs "The book mark len...【阅读全文】
he scripts I posted above are those I used for TotalSpaces. Here are them converted for TotalSpaces2.Get current space:#!/usr/bin/env rubyrequire 'rubygems'require 'totalspaces2'current_space = TotalSpaces2.current_spaceputs "#{current_space}"Switch to space:...【阅读全文】