Refactoring Rails Applications with RubyMine
Slides: Typical Rails problems
01:26 - Rails is great at the beginning
02:09 - 2.months.later, first problems
03:59 - 6.months later, hidden dependencies, security bugs, rails upgrades
06:01 - 2.years.later, new team members, huge classes
07:50 - New guidelines
13:30 - Why is extracting a service object a good starting point in refactoring?
14:08 - DDD service objects vs Rails service objects
14:50 - Question: When is a good time to start refactoring?
17:50 - Typical controller coupling, views, @ivars, filters
21:32 - Redmine project explanation, codebase overview
RubyMine session - extracting a service object
24:54 - Question: How to build a refactor strategy when your test coverage is not good enough?
27:22 - RubyMine overview, structure view, scratch file, listing concerns, ‘create’ action
28:45 - Running a subset of tests
30:10 - Grouping concerns - controller takes care of all http-related concerns
30:51 - An example test which is good enough for refactoring
32:10 - Start of the refactoring - code changes
32:30 - Run tests with the coverage tool, explaining the limitations of line coverage tools
33:30 - Live template example - service object template, CreateTimeEntry class
34:49 - What’s the good name for the service object method name? execute or call
36:49 - Tests pass after moving some code to the new class
38:40 - Handling the ‘return’ statement with the Proc
45:56 - Extracting the respond_create_success, respond_create_failure methods
47:39 - When to stop refactoring?
49:56 - Question: When to introduce service objects, when to follow The Rails Way?
51:44 - Question: Which params to pass to the constructor of the service object and which to the method?
53:50 - Extracting the service object to the new file
Summary:
56:56 - Summary of the refactoring session
1:02:49 - More information/resources - Refactoring is an essential part of most developers' lives and has always been a focus of RubyMine. However, many of our users are unaware of some of these useful features. We've asked Andrzej Krzywda (@andrzejkrzywda), Rails refactoring guru, to share his experience and best practices with us in this webinar.
Learn more about RubyMine at https://www.jetbrains.com/ruby/.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Refactoring Rails Applications with RubyMine», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.