posts - 262,  comments - 221,  trackbacks - 0
          posted @ 2012-02-18 18:57 Paul Lin 閱讀(649) | 評論 (0)編輯 收藏
               摘要: 換句話說,當(dāng)你找到與天賦、個性完全匹配的工作,它恰好處在上升期的市場,公司又提供了必要的授權(quán)與資源,那么你就很容易成功。反之,若這三點中的任何一點不匹配,那么你就是個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等技術(shù)   閱讀全文
          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文版看完了,心中那個成就感和滿足感啊~~

          繼續(xù)下一輪的針對性學(xué)習(xí)計劃,計劃包括:

          1. Rails應(yīng)用的部署和性能監(jiān)控

          2. Rails的MVC架構(gòu)和Cache

          3. JS和JS與Rails的結(jié)合使用

          4. Ruby的語法和特性

          5. MySQL配置和調(diào)優(yōu)

          6. 搜索引擎和推薦引擎的學(xué)習(xí)

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

          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測試優(yōu)化之路》中,我演示了如何使用Guard-spork, Guard-rspec和Spork, Rspec來進(jìn)行自動化測試和集成測試。

          今天發(fā)現(xiàn)存在一個bug,那就是當(dāng)model文件被修改后,雖然會重新啟動rspec執(zhí)行測試。但是測試的代碼不是最新的,而是繼續(xù)沿用已經(jīng)加載到內(nèi)存的model文件。網(wǎng)上搜索一番后,發(fā)現(xiàn)問題的原因是spork的預(yù)加載問題。于是在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設(shè)置成只有name是可以訪問的,然后在Console中執(zhí)行如下命令:

          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:顯示目錄樹和標(biāo)簽(特別有用)
          Rails.vim:這個不說了,Rails開發(fā)必備
          Snipmate.vim:代碼片段自動完成,Rails開發(fā)神器之一
          FuzzyFinder.vim:模糊查找,使用頻率最高的插件之一
          TabBar:BufferExpoloer的增強版,用來標(biāo)識打開的文件的
          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,來自動監(jiān)控spork中預(yù)加載的文件發(fā)生變化后,自動重啟spork

          1).在Gemfile中增加gem 'guard-spork'
          2).在shell中g(shù)em 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的觸發(fā)機制:

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

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

          3. 要有自動加載被測試對象和環(huán)境數(shù)據(jù)的機制

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

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點博客

          好友博客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 新密市| 吉林省| 阜康市| 芜湖市| 铜山县| 冷水江市| 德兴市| 珠海市| 遵义市| 民勤县| 乌审旗| 吉安市| 砀山县| 东港市| 嫩江县| 阿巴嘎旗| 汉沽区| 彝良县| 渝北区| 虞城县| 大庆市| 合阳县| 夹江县| 崇左市| 宁都县| 留坝县| 苏尼特左旗| 元氏县| 屏山县| 凉城县| 牡丹江市| 大关县| 六盘水市| 朝阳市| 青冈县| 东至县| 嵊州市| 翼城县| SHOW| 湘西| 富平县|