Talks
Power up Your Development with RubyMine

Power up Your Development with RubyMine

by Tatiana Vasilyeva

In the talk titled "Power Up Your Development with RubyMine" presented by Tatiana Vasilyeva at RailsConf 2016, the speaker discusses various tips and tricks for enhancing productivity while using the RubyMine IDE. The session focuses on customizing the development environment and learning shortcuts that can greatly improve coding efficiency. Key points include:

  • Customization: Tailoring the IDE to create a visually appealing workspace by adjusting color schemes, modifying editor layouts, and utilizing predefined keymaps.
  • Plugins: Exploring the plugin library within RubyMine, installing new plugins for improved functionality, and utilizing tools that assist during presentations.
  • Navigation: Effectively navigating through code by using features like 'scroll to source', 'Go to Definition', and the navigation bar to quickly access files and methods. The Rails view structure allows better organization for Rails applications.
  • Coding Efficiency: Utilizing scratch files for temporary coding, employing clipboard history, and using multiple cursors to edit code more efficiently. Features like Rails generators and custom code snippets streamline the development process.
  • Code Quality: Leveraging inspection tools within RubyMine to highlight errors and suggest improvements. Functions for refactoring code, like extracting methods from duplicates, help maintain clean code.
  • Testing and Debugging: The speaker details how to run tests, utilize breakpoints for debugging, and navigate error codes to diagnose issues effectively.
  • Version Control and Database Integration: Discussing how RubyMine facilitates version control management and simplifies database interactions directly within the IDE.

In conclusion, RubyMine offers powerful tools and functionalities that can significantly boost a developer's productivity. Understanding and implementing these features can lead to a more enjoyable and efficient coding experience. The session encourages participants to explore RubyMine further and reach out for assistance if needed.

00:00:10.670 Good morning, everyone. I hope you are awake, yes? Welcome to my talk.
00:00:18.830 I appreciate you coming here today. This talk is about RubyMine, where I will share various tips and tricks to enhance your productivity.
00:00:27.630 I hope you will learn something new today. But before we start, I have a small request.
00:00:34.620 Please stand up and raise both your hands if you are using RubyMine. If you are not using RubyMine, just keep your hands down. Let's get a little stretch in!
00:00:50.309 Thank you! Please take a seat. Now that we are ready to start, my name is Tatiana Vasilyeva, and I am a product marketing manager for RubyMine, part of the JetBrains team. I used to be a developer ten years ago when Ruby on Rails was quite new. However, I am not currently a developer, so if something doesn’t work today, please don’t blame me—just joke about it!
00:01:19.140 Let's dive in! When discussing IDEs, it's essential to create an environment that is visually appealing and comfortable for you as a developer, making your workspace conducive to productivity.
00:01:39.690 We'll start with some tips on how to tailor your IDE to better suit your needs, beginning with the color scheme. Let’s switch to a different look.
00:02:02.070 I will quickly switch the color scheme to a darker one, and you can let me know which one you prefer for this presentation.
00:02:22.450 It's helpful when you are working in pairs or giving presentations to quickly adjust the color scheme. Similarly, you can switch the keymap easily so that it aligns with what you or your teammate uses. We have several predefined keymaps available.
00:02:39.690 If you prefer a specific keymap, you can search for it with just one click, eliminating the need to dig through preferences.
00:03:03.970 You can also fully customize the colors of your workspace, creating a setup that is aesthetically pleasing to you.
00:03:20.750 Additionally, I encourage you to explore the list of plugins available in RubyMine. A majority come pre-installed, and you can always access more by browsing the plugins library.
00:03:39.100 For instance, I’m currently using a plugin that assists with presentations, showing all the shortcuts I am using at the bottom. You can install new plugins through the JetBrains plugin repository.
00:04:03.680 Another aspect of RubyMine that you can adjust is the layout of your editor windows. You can modify your view to have the project tree on the left and the editor on the right to suit your workflow.
00:04:23.380 You can choose whether to show or hide toolbars and the navigation bar based on your preferences. Additionally, you can navigate using the shortcuts assigned to each window.
00:04:38.530 If you ever feel overwhelmed with open windows, you can press Shift + Command + F12 to quickly hide tool windows and return to your code, helping you maintain focus.
00:05:00.000 For a more focused environment, you can enable distraction-free mode which allows you to only see your code, without any distractions from the IDE.
00:05:15.000 This mode can help enhance focus when coding. Although, today I will demonstrate the various windows and capabilities of the IDE.
00:05:27.000 Now, let's talk about navigation within your code, which is a crucial aspect of using RubyMine effectively. You can view the project structure to easily find the files you need.
00:05:43.000 You can search for files in the project tree by simply typing the name, but I recommend utilizing the 'scroll to source' feature to enhance your efficiency.
00:06:10.000 This feature allows you to keep track of where you are in the project structure while navigating through your open files.
00:06:27.000 If you are working on Rails applications, RubyMine also provides a Rails view that reorganizes your project structure into models, views, and controllers, which can simplify navigation.
00:06:45.000 You will be able to see controllers and their associated routes and views all in one place, making it easier to navigate your Rails application.
00:07:01.000 To switch between views, you don’t have to go back to the project tree; simply use the navigation bar at the top of your IDE.
00:07:19.000 You can start typing in the navigation bar, and it will understand multiple naming conventions, making it quick and easy to hop between files.
00:07:35.000 Now, I have a question for you. Do you feel comfortable with this view, or is there something that seems strange or awkward? I’d love to hear your feedback.
00:07:55.000 Some people have mentioned that the tabs take up too much space in the editor, which I agree with. You can disable them entirely if you find them cumbersome.
00:08:06.000 You can do this through preferences, or a more efficient way to navigate might be using the 'Find Action' command, which allows you to search for any command or action in RubyMine.
00:08:24.000 You can quickly browse for actions without navigating through multiple menus. It’s particularly useful if you are trying to remember a keyboard shortcut.
00:08:41.000 If you need to navigate to your recently edited files, use Command + E for the recent files list, or Shift + Command + E for the recently edited files.
00:09:02.000 This works much better than dealing with the tabs for navigating through your recent edits.
00:09:19.000 If you wish to return to a specific controller from a view, simply use the provided icons to quickly navigate between your files, methods, and classes.
00:09:49.000 To navigate through methods in your class file, use Command + F12 to bring up a structure popup showing all methods within the file.
00:10:01.000 This is especially convenient if you want to locate specific methods rapidly. You can also see inherited methods by clicking again on the popup.
00:10:17.000 Another way to navigate in RubyMine is to use 'Go to Definition.' This feature, triggered by Command + B, allows you to find the definition or declaration of a variable or method easily.
00:10:38.000 You can repeatedly use this command to navigate not only through your project files but also through imported libraries and gems.
00:10:57.000 If you don't want to switch to another file, you can use Command + Y to bring up a quick definition popup, which lets you see the method definition without leaving your current file.
00:11:13.000 Now, please raise your hands if you have already used something new from the previous slides—great!
00:11:30.000 Now, let’s shift our focus to coding itself. One of the most fundamental actions in RubyMine is creating a new file. You can do this easily from the IDE and also utilize Rails generators for scaffolding and quick project setups.
00:12:01.000 If you want to experiment with some code temporarily, consider creating a scratch file instead of a typical Ruby file. Scratch files reside within RubyMine and won’t clutter your project structure.
00:12:23.000 Scratch files also support code completion and can be executed within RubyMine, so you can play around with your code freely.
00:12:38.000 If you want to check where your scratch files are located, there is an option within RubyMine to view them at any time.
00:13:02.000 Coding often involves manipulating a lot of code, and RubyMine offers functionalities such as extending selections to select chunks of code semantically.
00:13:16.000 When copying code, you don’t have to select entire lines; you can simply place the cursor on the line and duplicate, delete, or move code as needed. This saves time and enhances workflow.
00:13:44.000 You can also access a clipboard history through Shift + Command + V to paste items you have copied in the past.
00:14:04.000 RubyMine supports multiple cursors, allowing you to edit various parts of your code simultaneously, which is a powerful feature.
00:14:25.000 Furthermore, if you want to emulate Vim editing capabilities within RubyMine, you can install the IdeaVim plugin. This enables you to use Vim keybindings alongside RubyMine functionality.
00:14:54.000 In addition, RubyMine includes predefined code snippets. You can create your own snippets for commonly used code patterns, optimizing your coding experience.
00:15:19.000 You can save a code fragment as a live template and add variables, allowing for dynamic snippets tailored to your coding style.
00:15:39.000 You can create various templates not only for Ruby but also for other languages like JavaScript, SQL, and more, helping you maintain consistency and efficiency.
00:15:57.000 Talking about HTML, RubyMine supports Emmet, which is a fantastic feature to generate HTML efficiently. With just a few keystrokes, you can create an entire structure.
00:16:10.000 You can wrap your selected code using Emmet to quickly add elements, enhancing your coding speed and productivity.
00:16:40.000 After you generate HTML with Emmet, you may wish to reformat it to comply with your coding standards. RubyMine offers several options to assist with code styling.
00:17:05.000 You can adjust code style settings in preferences, and RubyMine is equipped with various community-driven styles to cater to different preferences.
00:17:22.000 The editor supports EditorConfig for maintaining consistent coding styles across teams and projects. Just include an .editorconfig file in your project root.
00:17:51.000 Now, let's discuss cleaning up your code—inspections and refactoring are crucial to maintaining code quality. RubyMine provides a wealth of inspection tools to highlight errors in your code.
00:18:15.000 The IDE highlights issues efficiently and allows you to fix them with just a click. Additionally, RubyMine suggests methods for improvements, aiding in writing better code.
00:18:38.000 You can also run a code inspection across the entire project to locate issues like duplicates in the code.
00:19:10.000 If your code has duplicate segments, RubyMine helps you refactor it by extracting methods, making your codebase cleaner and more organized.
00:19:30.000 Now, let’s touch on testing and debugging in RubyMine. Running tests is straightforward, and while the test runner is typically displayed at the bottom of the IDE, you can customize its position.
00:19:48.000 There’s a filter icon that allows you to toggle visibility between all tests and just the failed ones, making it easier to focus on errors, rather than passing tests.
00:20:05.000 If you want to know what went wrong during tests, simply navigate to the error codes, adding breakpoints in your test files to check your code step by step.
00:20:22.000 While debugging, you can manage and adjust the breakpoint settings, allowing for a more streamlined code inspection process.
00:20:38.000 There's a preference setting to enable you to step through your own code without getting lost in external libraries and gems—this setting helps you stay focused on your project.
00:20:58.000 If you are using version control with RubyMine, you can view your commit history alongside your local changes.
00:21:10.000 You can also edit your code within the commit dialog, providing a convenient way to make quick fixes Right where you are.
00:21:23.000 Finally, if you are using databases, RubyMine simplifies database interactions. You can open your tables and run queries directly from the IDE.
00:22:00.000 The database tool integrates well with your Rails application, so you can easily view and modify data without leaving the environment.
00:22:19.000 Remember to leverage the import from sources feature for quick setups based on your configuration files.
00:22:36.000 As we wrap up, I want to thank you for your attention. If you have any questions, feel free to approach me after this talk or during booth time. I’m eager to assist!