posts - 262,  comments - 221,  trackbacks - 0
          posted @ 2012-02-18 18:57 Paul Lin 閱讀(649) | 評論 (0)編輯 收藏
               摘要: 換句話說,當你找到與天賦、個性完全匹配的工作,它恰好處在上升期的市場,公司又提供了必要的授權與資源,那么你就很容易成功。反之,若這三點中的任何一點不匹配,那么你就是個loser。  閱讀全文
          posted @ 2012-02-18 18:27 Paul Lin 閱讀(676) | 評論 (0)編輯 收藏
          posted @ 2012-02-18 18:09 Paul Lin 閱讀(584) | 評論 (0)編輯 收藏
               摘要: 這是一篇集百家之長的筆記,分別參考了《Rails3 in Action》和 RVM官方文檔,ninjahideout.com 之后的安裝文檔。


          這里使用到的各種軟件包括:



          • Ubuntu

          • Virtual Box

          • Vagrant

          • RVM

          • Capistrano

          • Passenger

          • Nginx

          • MySQL

          • PostgreSQL



          還涉及到Git、GitHub、SSH等技術   閱讀全文
          posted @ 2011-11-21 16:22 Paul Lin 閱讀(1698) | 評論 (0)編輯 收藏
               摘要:   閱讀全文
          posted @ 2011-11-13 23:29 Paul Lin 閱讀(11068) | 評論 (1)編輯 收藏
          終于花了將近4個月的時間,把《Learn Rails3 by example》的E文版看完了,心中那個成就感和滿足感啊~~

          繼續下一輪的針對性學習計劃,計劃包括:

          1. Rails應用的部署和性能監控

          2. Rails的MVC架構和Cache

          3. JS和JS與Rails的結合使用

          4. Ruby的語法和特性

          5. MySQL配置和調優

          6. 搜索引擎和推薦引擎的學習

          7. NoSQL專題
           
          posted @ 2011-11-03 00:17 Paul Lin 閱讀(754) | 評論 (0)編輯 收藏
          關于RVM + REE + Ngix + Passenger + Capistrano的安裝配置,非常詳細!強烈推薦

          http://blog.ninjahideout.com/posts/a-guide-to-a-nginx-passenger-and-rvm-server
          posted @ 2011-11-03 00:14 Paul Lin 閱讀(725) | 評論 (0)編輯 收藏
               摘要:   閱讀全文
          posted @ 2011-10-03 17:36 Paul Lin| 編輯 收藏

          在上一篇《自動化測試狂人的Rails測試優化之路》中,我演示了如何使用Guard-spork, Guard-rspec和Spork, Rspec來進行自動化測試和集成測試。

          今天發現存在一個bug,那就是當model文件被修改后,雖然會重新啟動rspec執行測試。但是測試的代碼不是最新的,而是繼續沿用已經加載到內存的model文件。網上搜索一番后,發現問題的原因是spork的預加載問題。于是在spork的spork.each_run方法中加入如下代碼,重啟sprok,解決問題

          Dir["#{Rails.root}/app/models/**/*.rb"].each do |model| 
            load model
          end

           

          posted @ 2011-09-06 14:21 Paul Lin 閱讀(704) | 評論 (0)編輯 收藏

          假如我們把attr_accessible設置成只有name是可以訪問的,然后在Console中執行如下命令:

          ruby-1.9.2-p180 :001 > user = User.create(:name => "Paul", :email => "pengpenglin@163.com")
           
          => #<User id: 1, name: "Paul", email: nil, created_at: "2011-09-03 04:42:59", updated_at: "2011-09-03 04:42:59"> 
          ruby-1.9.2-p180 :002 > user.email
           
          => nil 
          ruby-1.9.2-p180 :003 > user.email = "bob@163.com"
           
          => "bob@163.com" 
          ruby-1.9.2-p180 :004 > user.email
           
          => "bob@163.com" 
          ruby-1.9.2-p180 :005 > user.save
           
          => true 
          ruby-1.9.2-p180 :006 > user.reload.email
           
          => "bob@163.com" 
          ruby-1.9.2-p180 :007 > User.find(1)
           
          => #<User id: 1, name: "Paul", email: "bob@163.com", created_at: "2011-09-03 04:42:59", updated_at: "2011-09-03 04:43:31"> 

          不是not accessible 嗎?怎么email還是能夠改變?

          posted @ 2011-09-03 12:51 Paul Lin 閱讀(1244) | 評論 (1)編輯 收藏
               摘要: 我們要修改的文件會涉及到4個:
          A. Gemfile
          B. .rspec
          C. Guardfile
          D. rspec_helper.rb  閱讀全文
          posted @ 2011-08-31 00:44 Paul Lin 閱讀(1855) | 評論 (1)編輯 收藏
               摘要: 從RailsCast.com篩選出來的視頻  閱讀全文
          posted @ 2011-08-29 15:58 Paul Lin 閱讀(592) | 評論 (0)編輯 收藏
               摘要: NERDTree.vim:顯示目錄樹和標簽(特別有用)
          Rails.vim:這個不說了,Rails開發必備
          Snipmate.vim:代碼片段自動完成,Rails開發神器之一
          FuzzyFinder.vim:模糊查找,使用頻率最高的插件之一
          TabBar:BufferExpoloer的增強版,用來標識打開的文件的
          Supertab.vim:文本自動完成
          Rubytest.vim:vim下的集成測試工具  閱讀全文
          posted @ 2011-07-26 12:46 Paul Lin 閱讀(3419) | 評論 (0)編輯 收藏
          BDD style unit testing video and slides@RubyKaigi 2011

          How I Test

          watchr 靈活的Continuous Testing測試工具可替代autotest...

          不要盲目的 BDD / TDD,我對寫測試的看法
          posted @ 2011-07-19 20:06 Paul Lin 閱讀(365) | 評論 (0)編輯 收藏
               摘要: 針對這種情況,我們可以使用一個名為Guard的gem,來自動監控spork中預加載的文件發生變化后,自動重啟spork

          1).在Gemfile中增加gem 'guard-spork'
          2).在shell中gem install libnotify / gem install inotify
          3).bundle install
          4).guard init spork
          5).guard start  閱讀全文
          posted @ 2011-07-15 18:12 Paul Lin 閱讀(431) | 評論 (0)編輯 收藏
               摘要: 首先我們來理解Autotest的觸發機制:

          1. 要有一套測試的框架和工具(Console,GUI)

          2. 要有可以感知被測試對象發生變化的機制

          3. 要有自動加載被測試對象和環境數據的機制

          4. 要有將測試結果展示給用戶的機制  閱讀全文
          posted @ 2011-07-15 00:14 Paul Lin 閱讀(649) | 評論 (0)編輯 收藏
               摘要: 網上google了一下,發覺又是一個Rails和其他gem不兼容的問題,只要把rake的版本設置為0.8.7就可以了。  閱讀全文
          posted @ 2011-07-03 21:28 Paul Lin 閱讀(1426) | 評論 (1)編輯 收藏
          posted @ 2011-06-25 13:40 Paul Lin 閱讀(364) | 評論 (0)編輯 收藏
          posted @ 2011-06-18 23:02 Paul Lin 閱讀(333) | 評論 (0)編輯 收藏
          <2011年6月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點博客

          好友博客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 安龙县| 武汉市| 北海市| 鄯善县| 尼勒克县| 运城市| 钟山县| 利津县| 阳西县| 香河县| 东至县| 安乡县| 公安县| 陕西省| 绥德县| 定结县| 龙陵县| 贺兰县| 军事| 昌平区| 措美县| 武穴市| 昌图县| 太原市| 科尔| 通许县| 孙吴县| 沐川县| 五台县| 万宁市| 东乌珠穆沁旗| 上思县| 朝阳县| 长沙县| 沾益县| 侯马市| 开原市| 漳州市| 舞钢市| 崇仁县| 封开县|