Refactor ruby code based on AST

13c60e2a5806406b537daa542d3495da?s=47 flyerhzm
October 18, 2015

Refactor ruby code based on AST

13c60e2a5806406b537daa542d3495da?s=128

flyerhzm

October 18, 2015
Tweet

Transcript

  1. 2.
  2. 3.
  3. 4.
  4. 6.
  5. 7.
  6. 9.
  7. 10.
  8. 13.
  9. 14.
  10. 19.
  11. 21.
  12. 23.
  13. 25.
  14. 30.
  15. 31.
  16. 34.
  17. 37.
  18. 42.
  19. 43.
  20. 44.
  21. 45.
  22. 47.
  23. 48.
  24. 50.
  25. 53.

    DSL • within_file / within_files • with_node / within_node •

    if_exist_node / unless_exist_node • append / insert / insert_after / replace_with / remove • ……
  26. 54.
  27. 55.
  28. 56.
  29. 57.

    Demo Convert rspec to new syntax Convert rails code from

    2.3 to 3.0 Convert rails code from 3.2 to 4.0
  30. 59.
  31. 60.
  32. 61.

    Refs CodeClimate - https://codeclimate.com/ PullReview - https://www.pullreview.com/ flay - https://github.com/seattlerb/flay

    flog - https://github.com/seattlerb/flog brakeman - https://github.com/presidentbeef/brakeman rails_best_practices - https://github.com/railsbp/ rails_best_practices
  33. 62.

    Refs parsetree - https://github.com/seattlerb/parsetree ruby_parser - https://github.com/seattlerb/ruby_parser parser - https://github.com/whitequark/parser

    rubocop - https://github.com/bbatsov/rubocop transpec - https://github.com/yujinakayama/transpec synvert - https://github.com/xinminlabs/synvert
  34. 63.