Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Refactor or Die

Refactor or Die

a Lightning talk @ Ruby Hiroba 2013

Sho Kusano

June 02, 2013
Tweet

More Decks by Sho Kusano

Other Decks in Programming

Transcript

  1. 4 http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers Sandi Metz’ rules for developers Controllers can instantiate

    only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed)
  2. $ rubocop ... C:264: Surrounding space missing for '{'. C:264:

    Surrounding space missing for '{'. C:264: Space missing to the left of '}'. C:282: Line is too long. [98/79] C:283: Line is too long. [81/79] C:284: Method has too many lines. [45/10] C:287: Prefer single-quoted strings when you don't need string interpolation or special symbols. C:288: Line is too long. [115/79] C:298: Indent when as deep as case. C:300: Indent when as deep as case. C:305: Line is too long. [98/79] C:310: Indent when as deep as case. C:318: Indent when as deep as case. C:320: Indent when as deep as case. ...
  3. $ COV=1 rspec spec/models ............................................................... Finished in 1.62 seconds 63

    examples, 0 failures Coverage report generated for RSpec to coverage. 140 / 140 LOC (100.0%) covered.
  4. class DirtyModel def old_method # body omitted ... end deprecate

    :old_method def new_method # body omitted ... end if Rails.env.test? alias_method :old_method, :new_method end end
  5. WE ARE HIRING !! Let’s refactor our codes together !!

    http://info.cookpad.com/jobs/?affcd=geo2a