2014年7月4日
摘要: http://stackoverflow.com/questions/23258921/rails-generate-rspecinstall-config-environments-development-rb1in-top-requ 的解决方式: 阅读全文
posted @ 2014-07-04 01:16 秋叶leaf 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 在Rails项目里,使用PostgrelSQL时(gem 'pg', '0.15.1' ),安装有时候会报错:最后通过先安装PostgreSQL解决:brew install postgresqlbundle updatebundle install 阅读全文
posted @ 2014-07-04 00:38 秋叶leaf 阅读(259) 评论(0) 推荐(0) 编辑
  2014年5月22日
摘要: #建立一个222.rb文件并且输入字符file = File.open("222.rb","w+")file.puts "123\nwadwa\n12124124\ndwdw"file.close#输出222.rb的内容File.open("222.rb","r+") do |file|while ... 阅读全文
posted @ 2014-05-22 17:17 秋叶leaf 阅读(2111) 评论(0) 推荐(0) 编辑
摘要: /bin binary缩写,存放着使用者经常使用命令例cp、ls、cat等等 /sbin (SuperUser bin)系统管理员所用的系统管理程序;/etc 存放所有的系统管理所需要的配置文件及子目录;/lib 存放系统最基本的动态链接共享库,类似于Windows下的DLL文件;/dev ... 阅读全文
posted @ 2014-05-22 15:53 秋叶leaf 阅读(206) 评论(0) 推荐(0) 编辑
  2014年5月9日
摘要: 1 def quick_sort(a) 2 3 return a if a.size x}) : [] 6 7 end 8 9 array = [72,6,57,88,60,42,83,73,42,48,85] 10 11 p quick_sort(array) #=> [6... 阅读全文
posted @ 2014-05-09 10:08 秋叶leaf 阅读(404) 评论(0) 推荐(0) 编辑
  2014年5月8日
摘要: 1 object.methods() # 列出对象的类的实例方法。即该实例的可用方法列表。puts [].methods.grep /^re/ #列出Array以re开头的实例方法列表2 object.instance_variables() #列出对象(Module或Class)的实例变量cl... 阅读全文
posted @ 2014-05-08 15:17 秋叶leaf 阅读(176) 评论(0) 推荐(0) 编辑
  2014年5月7日
摘要: 1 def bubble_sort(array) 2 return array if array.size = array[j+1] 7 end 8 end 9 10 return array11 end12 13 a = [12,42,1,25,32,63... 阅读全文
posted @ 2014-05-07 17:01 秋叶leaf 阅读(229) 评论(0) 推荐(0) 编辑
  2014年4月3日
摘要: require 'delegate'class Assistantdef initialize(name)@name = nameenddef read_emailputs "(#{@name}) It's mostly spam."enddef check_scheduleputs "(#{@name}) You have a meeting today."endendclass Manager please hold my callsanne.read_email #=>(Frank) It's mostly s 阅读全文
posted @ 2014-04-03 16:02 秋叶leaf 阅读(304) 评论(0) 推荐(0) 编辑
  2014年3月26日
摘要: 1 在本地新建一个目录four, 在此目录执行指令: npm init2 在/four/lib/目录里放js代码 : inlib.jsmodule.exports = function(message){ return message;}3 在/four/bin/里放指令文件: inbin.js#! /usr/bin/env nodevar libsth = require("../lib/inlib.js");console.log(libsth("gsky"));4 编辑/four/package.json,其中:{ “name” : “four”, 阅读全文
posted @ 2014-03-26 14:26 秋叶leaf 阅读(234) 评论(0) 推荐(0) 编辑
  2014年3月25日
摘要: BDDThe BDD styles areexpectandshould. Both use the same chainable language to construct assertions, but they differ in the way an assertion is initially constructed. Check out theStyle Guidefor a comparison.API ReferenceLanguage ChainsThe following are provided as chainable getters to improve the re 阅读全文
posted @ 2014-03-25 23:56 秋叶leaf 阅读(266) 评论(0) 推荐(0) 编辑