![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ruby
文章平均质量分 51
ruby-power
这个作者很懒,什么都没留下…
展开
-
ruby中的Hash排序
ruby API中的sort和sort_by方法可以很好的帮助我们对Hash进行排序:For example:h={'a'=>2, 'c'=>1, 'b'=>3}sort 方法:key升序:h.sort { |a, b| a[0]b[0] }[["a", 2], ["b", 3], ["c", 1]]key降序:h.sort { |a, b| b[原创 2013-06-24 17:16:56 · 4284 阅读 · 0 评论 -
如何安装和升级sublime-text in ubuntu
在ubuntu安装Sublime Text2下列引述原英文文档内容: The easy way to install the sublime editor is use the following commandsThis command will add the sublime source to Ubuntu apt repository so that you can in转载 2013-07-15 10:16:13 · 1913 阅读 · 0 评论 -
ruby中load,require以及include,extend的区别
Load 和 require 的区别:二者的作用相似,都可以加载并执行指定的ruby源代码文件(立即执行),但是require比load常用。test.rb:puts " I am a developer!"execute.rb:require "./test"#load "./test.rb"puts " You are also a developer原创 2013-06-24 15:01:39 · 607 阅读 · 0 评论 -
rails面试题
1,验证电子邮件格式2,resources :users 会创建哪些路由3,rake的作用:rakerake db:migraterake routes4,rails 三种工作环境的区别(development, testing, and production)5,str="abcdef", str[0]=? 如何输出字符“a"6,['a1','a3'原创 2013-07-26 15:25:59 · 1209 阅读 · 0 评论