Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Use rails_best_practicesto refactor your rails codes      flyerhzm@gmail.com         Richard
Huang       Proprietary
and
Co...
About MeRichard
Huang
(flyerhzm)• hEp://huangzhimin.com• hEp://twiEer.com/flyerhzm• hEp://github.com/flyerhzmWork
for
OpenFei...
Presentation from ihower      Proprietary
and
Confiden/al.
©
2011
OpenFeint.   3
rails_best_practices gem      Proprietary
and
Confiden/al.
©
2011
OpenFeint.   4
rails_best_practices gem28
code
checkers~
800
watchers
on
github>
100K
downloads        Proprietary
and
Confiden/al.
©
2011...
rails-bestpractices.com     Proprietary
and
Confiden/al.
©
2011
OpenFeint.   6
rails-bestpractices.com     Proprietary
and
Confiden/al.
©
2011
OpenFeint.   7
rails-bestpractices.com70
prac/cesgem
documentgem
blog        Proprietary
and
Confiden/al.
©
2011
OpenFeint.   8
How rails_best_practices gem          works        Proprietary
and
Confiden/al.
©
2011
OpenFeint.   9
Usagegem
install
rails_best_prac/cescd
rails_projectrails_best_prac/ces         Proprietary
and
Confiden/al.
©
2011
OpenFei...
ResultProprietary
and
Confiden/al.
©
2011
OpenFeint.   11
Html ResultProprietary
and
Confiden/al.
©
2011
OpenFeint.   12
Why should userails_best_practices gem       Proprietary
and
Confiden/al.
©
2011
OpenFeint.   13
We Are Ruby/Rails Developers  Write
Beau/ful
Codes  Follow
Best
Prac/ces          Proprietary
and
Confiden/al.
©
2011
OpenF...
We Are a TeamCode
Conven/onCode
Review       Proprietary
and
Confiden/al.
©
2011
OpenFeint.   15
Javacheckstyle        Proprietary
and
Confiden/al.
©
2011
OpenFeint.   16
RubySaikuroFlogFlayReekRoodi          Proprietary
and
Confiden/al.
©
2011
OpenFeint.   17
rails_best_practices gemCheck
rails
codes
qualityCreate
check
list
for
rails
team         Proprietary
and
Confiden/al.
©
20...
How rails_best_practice gem          works       Proprietary
and
Confiden/al.
©
2011
OpenFeint.   19
1                                                   2Codes                    rbp
gem                                     ...
1                                                   2Codes                    rbp
gem                                   se...
1                                                   2Codes                    rbp
gem                                   se...
1                                                   2Codes                    rbp
gem                                     ...
1                                                   2Codes                    rbp
gem                                     ...
sexp       class Post < ActiveRecord::Base         attr_accessor :editable       ends(:class, :Post,  s(:colon2, s(:const,...
sexp       def test         puts "hello world"       ends(:defn, :test, s(:args),  s(:scope,    s(:block,      s(:call, ni...
Play with sexp                                  ruby_parserhEps://github.com/flyerhzm/rails_best_prac/ces/blob/master/lib/r...
More Optionsrails_best_prac/cesrails_best_prac/ces
‐f
htmlrails_best_prac/ces
‐f
html
‐‐with‐textmaterails_best_prac/ces
‐...
Configurablerails_best_prac/ces
‐gmvim
config/rails_best_prac/ces.ymlrails_best_prac/ces            Proprietary
and
Confiden...
ExtensibilityHow
to
write
your
own
check
list?   RAILS_ROOT

=>

Rails.root       Proprietary
and
Confiden/al.
©
2011
OpenF...
Resource• rails
best
prac/ces
Website    hEp://rails‐bestprac/ces.com/
• rails_best_prac/ces
Source
Codes    hEps://github...
Thank you  Questions?Proprietary
and
Confiden/al.
©
2011
OpenFeint.   32
Upcoming SlideShare
Loading in …5
×

rails_best practices_rubykaigi

6,120 views

Published on

My presentation on rubykaigi 2011

Published in: Technology
  • Be the first to comment

rails_best practices_rubykaigi

  1. 1. Use rails_best_practicesto refactor your rails codes flyerhzm@gmail.com Richard
Huang Proprietary
and
Confiden/al.
©
2011
OpenFeint. 1
  2. 2. About MeRichard
Huang
(flyerhzm)• hEp://huangzhimin.com• hEp://twiEer.com/flyerhzm• hEp://github.com/flyerhzmWork
for
OpenFeint Proprietary
and
Confiden/al.
©
2011
OpenFeint. 2
  3. 3. Presentation from ihower Proprietary
and
Confiden/al.
©
2011
OpenFeint. 3
  4. 4. rails_best_practices gem Proprietary
and
Confiden/al.
©
2011
OpenFeint. 4
  5. 5. rails_best_practices gem28
code
checkers~
800
watchers
on
github>
100K
downloads Proprietary
and
Confiden/al.
©
2011
OpenFeint. 5
  6. 6. rails-bestpractices.com Proprietary
and
Confiden/al.
©
2011
OpenFeint. 6
  7. 7. rails-bestpractices.com Proprietary
and
Confiden/al.
©
2011
OpenFeint. 7
  8. 8. rails-bestpractices.com70
prac/cesgem
documentgem
blog Proprietary
and
Confiden/al.
©
2011
OpenFeint. 8
  9. 9. How rails_best_practices gem works Proprietary
and
Confiden/al.
©
2011
OpenFeint. 9
  10. 10. Usagegem
install
rails_best_prac/cescd
rails_projectrails_best_prac/ces Proprietary
and
Confiden/al.
©
2011
OpenFeint. 10
  11. 11. ResultProprietary
and
Confiden/al.
©
2011
OpenFeint. 11
  12. 12. Html ResultProprietary
and
Confiden/al.
©
2011
OpenFeint. 12
  13. 13. Why should userails_best_practices gem Proprietary
and
Confiden/al.
©
2011
OpenFeint. 13
  14. 14. We Are Ruby/Rails Developers Write
Beau/ful
Codes Follow
Best
Prac/ces Proprietary
and
Confiden/al.
©
2011
OpenFeint. 14
  15. 15. We Are a TeamCode
Conven/onCode
Review Proprietary
and
Confiden/al.
©
2011
OpenFeint. 15
  16. 16. Javacheckstyle Proprietary
and
Confiden/al.
©
2011
OpenFeint. 16
  17. 17. RubySaikuroFlogFlayReekRoodi Proprietary
and
Confiden/al.
©
2011
OpenFeint. 17
  18. 18. rails_best_practices gemCheck
rails
codes
qualityCreate
check
list
for
rails
team Proprietary
and
Confiden/al.
©
2011
OpenFeint. 18
  19. 19. How rails_best_practice gem works Proprietary
and
Confiden/al.
©
2011
OpenFeint. 19
  20. 20. 1 2Codes rbp
gem sexp 3 4 Lexical 5 6Analyze
 Prepare Result 7 9 8 Review Proprietary
and
Confiden/al.
©
2011
OpenFeint.
  21. 21. 1 2Codes rbp
gem sexp LexicalAnalyze
 Prepare Result Review Proprietary
and
Confiden/al.
©
2011
OpenFeint.
  22. 22. 1 2Codes rbp
gem sexp 3 4 LexicalAnalyze
 Prepare Result Review Proprietary
and
Confiden/al.
©
2011
OpenFeint.
  23. 23. 1 2Codes rbp
gem sexp 3 4 Lexical 5 6Analyze
 Prepare Result Review Proprietary
and
Confiden/al.
©
2011
OpenFeint.
  24. 24. 1 2Codes rbp
gem sexp 3 4 Lexical 5 6Analyze
 Prepare Result 7 9 8 Review Proprietary
and
Confiden/al.
©
2011
OpenFeint.
  25. 25. sexp class Post < ActiveRecord::Base   attr_accessor :editable ends(:class, :Post,  s(:colon2, s(:const, :ActiveRecord), :Base),  s(:scope,    s(:call, nil, :attr_accessor,      s(:arglist, s(:lit, :editable))    )  )) Proprietary
and
Confiden/al.
©
2011
OpenFeint. 25
  26. 26. sexp def test   puts "hello world" ends(:defn, :test, s(:args),  s(:scope,    s(:block,      s(:call, nil, :puts,        s(:arglist, s(:str, "hello world"))      )    )  )) Proprietary
and
Confiden/al.
©
2011
OpenFeint. 26
  27. 27. Play with sexp ruby_parserhEps://github.com/flyerhzm/rails_best_prac/ces/blob/master/lib/rails_best_prac/ces/core/runner.rb#L104 Proprietary
and
Confiden/al.
©
2011
OpenFeint. 27
  28. 28. More Optionsrails_best_prac/cesrails_best_prac/ces
‐f
htmlrails_best_prac/ces
‐f
html
‐‐with‐textmaterails_best_prac/ces
‐f
html
‐‐with‐mvim Proprietary
and
Confiden/al.
©
2011
OpenFeint. 28
  29. 29. Configurablerails_best_prac/ces
‐gmvim
config/rails_best_prac/ces.ymlrails_best_prac/ces Proprietary
and
Confiden/al.
©
2011
OpenFeint. 29
  30. 30. ExtensibilityHow
to
write
your
own
check
list? RAILS_ROOT

=>

Rails.root Proprietary
and
Confiden/al.
©
2011
OpenFeint. 30
  31. 31. Resource• rails
best
prac/ces
Website hEp://rails‐bestprac/ces.com/
• rails_best_prac/ces
Source
Codes hEps://github.com/flyerhzm/rails_best_prac/ces• rails_best_prac/ces
Document hEp://rdoc.rails‐bestprac/ces.com/03/23/11 Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 31
  32. 32. Thank you Questions?Proprietary
and
Confiden/al.
©
2011
OpenFeint. 32

×