As you probably know, last week the RubyMine team joined RubyKaigi 2017 in Hiroshima, Japan. It was great meeting and talking to so many Ruby developers, and especially to hear their feedback and suggestions about RubyMine and Ruby as a whole. Thank you!

Special thanks to the Samuraism team for their invaluable help during the preparation and participation in the conference. We couldn’t do this without you, folks!

What’s up with Ruby?

The need to improve Ruby’s type system seems to be the most important trend. There were a number of talks suggesting improvements for type annotations in Ruby, including “Automated Type Contracts Generation” by our own Valentin Fondaratov. Take a look at the updated presentation:

You will find this and many other talks from the conference on RubyKaigi’s channel on YouTube (still getting updated at the time of writing).

What’s used for Ruby and Rails development?

At every conference we conduct a teeny-tiny survey to figure out the most used tools for Ruby and Rails development. This time we only got 40 responses, but still, the results differ from what we got at the previous RailsConf. As expected, the Japanese Ruby community stays “hardcore” with Vim as their number one choice for Ruby and Rails development:

RubyKaigi’17

This contrasts markedly with the previous RailsConf results where 31% of those surveyed reported Sublime Text their primary editor, and another 28% preferred Atom. That said, Vim was the editor of choice for 18% of the respondents:

RailsConf’17

Also, Vue.js coupled with Rails turns out to be popular already:

RubyKaigi’17

Again, this differs from the RailsConf reports. React and AngularJS frameworks seem to be more popular in the West:

RailsConf’17

By the way, if you are using RubyMine, you’ll be glad to know that the IDE provides intelligent support for *.vue files through an official JetBrains plugin. Check out the webhelp for more info.

Anyway, it was great to be part of RubyKaigi this year, and we’ll hopefully see you again next year!

]]>https://blog.jetbrains.com/ruby/2017/09/whats-up-with-ruby-a-small-review-of-rubykaigi-2017/feed/0https://blog.jetbrains.com/ruby/2017/09/whats-up-with-ruby-a-small-review-of-rubykaigi-2017/How RubyMine Helped Me Learn to Code Fasterhttp://feedproxy.google.com/~r/jetbrains_rubymine/~3/OpxbBO5R3bc/
https://blog.jetbrains.com/ruby/2017/09/how-rubymine-helped-me-learn-to-code-faster/#respondTue, 19 Sep 2017 02:38:29 +0000http://blog.jetbrains.com/ruby/?p=7743Continue reading →]]>This is a guest post by Adrian DeGus. Adrian is the founder of Nuvro, an online project management tool for teams of all sizes. He also runs SEMCentric, a digital marketing agency based out of Phoenix, AZ.

Last year I made the decision, like countless others before me, to learn to code as a means to launch a startup. I had been managing web development projects for years which gave me a bit of an advantage, but the road was still far more grueling than I had expected.
Within a couple of months, I realized that all the people online claiming to have learned programming in 1-3 months were either way smarter than me or had very loose definitions of “learned”. So, I set a more realistic goal of learning and launching in one year.
I was able to meet my goal and launched my startup in exactly 363 days. I had planned to celebrate reaching this goal (with two days to spare) by taking a much-needed break. However, I had already caught the programming bug and decided to spend that time refactoring instead.
The path to launching within one year, however, was not as I expected. In my mind, the process was supposed to go something like this:

Decide which language (singular) to learn

Choose an IDE

Work through a couple of tutorials

Build my prototype

Develop a deeper understanding of programming over time, if necessary

What actually happened was:

Decide which primary language to learn

Realize that secondary languages/frameworks would also be necessary

Invest weeks of valuable time trying every IDE in existence

Come to terms with all other aspects of reality.

Deciding on a Language

Rails. Everyone says I can have an MVP live in one month, easy, moving on…

Deciding on Secondary Languages

JavaScript and jQuery, no brainer, time to code…

Choosing an IDE

This is where I hit a brick wall. Everyone seemed to either use Sublime Text, Cloud9 or VIM. I tried all, I hated all. Sublime was surprisingly restrictive and offered little in the way of syntactic guidance. I didn’t care for the cloud environment of Cloud9, even if it removed the need to setup my dev environment locally on my Windows machine. VIM was good on paper, but I didn’t want to add to my already mounting learning curve. I also tried NetBeans, which I had played with years ago in a short-lived attempt to learn PHP, but found it slow and clunky. After wasting valuable time learning each of these I decided to go simple with Notepad++. But as expected, it was way too simple.
All I was looking for was something I could customize to fit my style and something that could offer enough syntactic guidance to help me avoid simple mistakes and maybe help reduce a few keystrokes along the way.
Then I found RubyMine. Some people said it was great, but only for experienced Ruby programmers. Others said it was great, but too expensive. But all I noticed was people saying it was great. I tried it, immediately loved it and will never use anything else.

RubyMine is great, but only for experienced programmers

I honestly cannot see the logic behind this statement. As an inexperienced programmer just starting out, I found it to be invaluable. The guidance it provides in the form of syntax highlighting, code completion, refactoring and debugging is incredibly useful for people just learning.

RubyMine is great, but too expensive

I couldn’t disagree more. I’m personally happy to pay a little for something that’s lightyears better than anything else out there. Why wouldn’t I? If a tool helps you work better, faster and more efficiently than it’s an easy decision. And RubyMine does exactly that, it makes me a better programmer.

So How Did RubyMine Help Me Learn to Code Faster?

I attribute my accelerated learning and productivity curve to several features that I relied on daily.

Searching Everywhere

Every tutorial and screencast I worked through had at least one thing in common, constant clicking around to find files to work in. I did the same before finding RubyMine and found it tedious and inefficient. With RubyMine, however, I just double tap SHIFT and a lightweight window pops up with all my recently edited files. And if the file I’m looking for isn’t immediately visible I simply type the first couple of letters and it shows up on top. I can literally jump to any recently edited file within two seconds. It has been a tremendous time saver.

Somewhat related, RubyMine has a small feature that can automatically close all project folders. Simply double click on your app directory. No more clicking to collapse each individual folder to keep your work space clean.

Code Completion

Every IDE I’ve tried offered this to some degree, but none come close to RubyMine. What takes several keystrokes in other IDE’s takes a couple in RubyMine. It may seem insignificant but it adds up, both in the overall time spent typing out unnecessary code and in the additional focus you can maintain. This may not be something an experienced programmer would benefit from, but as a beginner everything takes mental focus. And something as simple as methods being completed and indented properly, every single time, really helps.

Syntax Highlighting and Guidance

Every IDE I’ve tried offers this, but yet again, none as intelligently as RubyMine. As I’m typing I can immediately see what belongs to what and if any syntax errors were detected. The highlighting extends to a broad range of colors depending on how complex or long your code spans. I found this especially useful when working in ERB files. In an ERB I could have a long complex table filled with both HTML and Ruby, requiring multiple scrolls to work within, and immediately know where I’m at. RubyMine will dynamically show code guides, floating at the top of the work space, to help understand where the code you’re working on begins. No confusion, no scrolling, no wasted time.

Automatic Refactoring

The time saving benefits of this are obvious. What is less obvious, at least for new developers, is the insight it provides. Working through any tutorial or screencast will often only show the easiest refactorings, while RubyMine tends to show you the best for the given situation.

Built-in Documentation

I relied on this heavily, must faster to hit a keyboard shortcut and be studying documentation within seconds than having to Google, sort, read, back up, start over. Countless times I was able to get my answer and get back to coding.

Customization with a Hidden Benefit

The first thing I really liked about RubyMine was that I had full control to customize it to my heart’s content. I could literally change anything I wanted which was a relief after realizing how restrictive other popular IDE’s were (not to mention the learning curve built into every setting). As I worked to make everything just the way I liked, I noticed that RubyMine labeled everything in an easily referenceable manner, meaning it displayed the name for every type of code I could format (for example constants, instance methods, functions and keywords). This was true for everything from Ruby to JavaScript to CSS. The hidden benefit was the indirect knowledge of the proper name for everything. This helped me to find solutions to my problems faster by forming the best searches and questions.

TL;DR
RubyMine helped me learn to code faster by removing all unnecessary tedium, by helping to prevent countless common errors and by providing valuable documentation and guidance along the way.
This in turn helped me to go from learning to code to launching my startup, Nuvro Project Management, in just under one year. I can honestly say that RubyMine played a big part in my ability to learn and launch within one year and that I will be using RubyMine to grow Nuvro for years to come.

RubyMine 2017.3 EAP 1 (build 173.2099.29) is here kicking off a series of Early Access builds for the upcoming v2017.3 that should be out by the end of November. The first EAP has a gazillion improvements, so you may find the navigation useful:

Better Performance

Investigating performance issues is the hardest part of our job as it all depends on the specific project environment, which we usually cannot investigate as the majority of our customers develop proprietary software. Still, based on your feedback and requests, we’ve got a better sense of direction and now our performance-improving attempts have started to pay off.

In our recent updates, the 2017.2 and 2017.3 builds, we have seen consistent improvement in the overall responsiveness of the IDE, which can be witnessed in massive Ruby/Rails apps (e.g. while using autocompletion, inspecting code, finding usages, or navigating to declarations).

However, to make the effect of the improvements completely obvious, one should give RubyMine a full load. To test our improvements, we’ve inspected all the code in Diaspora and TracksApp in the new EAP (Code | Inspect Code) and compared the results with the most stable version of the previous release version, RubyMine 2017.1.5, and the currently stable RubyMine 2017.2.3 that already contains some of the performance updates. Here’s what we’ve got:

As you can see on the graph, the new EAP clearly does the job faster: 1.5 times faster than the current stable build, and about 1.8–2.5 times faster compared to the previous major version!

If you develop a huge Ruby/Rails project and enjoy testing EAPs, please try this build and let us know if you can confirm our results.

Embedded Puppet (EPP) Support

Our users developing with Puppet will be glad to know that RubyMine now supports the EPP templating language. The IDE correctly identifies .epp files, recognizes the original EPP syntax, and autocompletes opening expression and parameter tags:

The templates resolution works as well, meaning that you can autocomplete a path to a template and navigate from a manifest to the template called:

Also, we have implemented a Refactor Rename action for variables and parameters:

And Find Usages for template files:

Refactoring

“Extract Method” Improved

The Extract Method dialog now allows you to choose whether to extract a method to a public, protected, or private section. If the chosen section doesn’t exist, RubyMine will create it and put the method right into the added section:

Renaming files from tabs

We added a handy option to rename files from tabs. It speaks for itself and needs no further explanation, but here’s what it looks like:

RuboCop Improvements

Note that starting from this EAP RubyMine runs RuboCop in the context of bundler if the Gemfile exists in the project root. If you don’t have rubocop in your Gemfile, but RuboCop inspections are active (Settings / Preferences | Inspections | Ruby | RuboCop) you will get the following message:

The message will be reworked in the next EAP build. For now though, simply add gem 'rubocop' to your Gemfile and install it to get rid of the error message, and continue working with RuboCop like before.

As for improvements, now RubyMine can not only autocorrect the whole file with RuboCop, but also fix errors by a class offense, or even a cop department. You will discover the new options by calling Show Intention Actions(Alt+Enter):

Code Style

Indenting private and protected methods

The long-awaited option to indent methods under private and protected is finally available in this build. You can find it in Preferences / Settings | Code Style | Ruby:

Adding spaces around any operators

Continuous commenting on Enter

Now if you comment a line, RubyMine will automatically comment the next line when you press Enter. To remove the automatically inserted #, press Backspace:

As usual, we added this option upon request, but if you don’t like the new “autocommenting” behavior, go Help | Find Action | Registry, and uncheck ruby.auto.prolong.comment (just start typing to find it quickly).

See the release notes for the full list of improvements, and please use our bug tracker to report any issues you encounter.

Your comments on the new EAP are very welcome in the section below!

Cheers,

Your RubyMine team

]]>https://blog.jetbrains.com/ruby/2017/09/rubymine-2017-3-eap1-is-open-2/feed/0https://blog.jetbrains.com/ruby/2017/09/rubymine-2017-3-eap1-is-open-2/Using Live Templates for Ruby on Rails in RubyMinehttp://feedproxy.google.com/~r/jetbrains_rubymine/~3/o7U3x0yo5qI/
https://blog.jetbrains.com/ruby/2017/09/using-live-templates-for-ruby-on-rails-in-rubymine/#commentsFri, 08 Sep 2017 19:55:26 +0000http://blog.jetbrains.com/ruby/?p=7661Continue reading →]]>This post continues the series of useful tips and tricks in RubyMine, and is devoted to using Live Templates. Please also check out the other recent posts uncovering navigation tips in RubyMine, and the 10 most useful shortcuts.

What is Live Templates and why use it for Ruby on Rails

Live Templates (aka Code Snippets in many text editors) is a simple solution allowing you to generate frequently-used custom code constructs, and quickly insert them in the editor.

While RubyMine has a built-in set of keywords for Ruby and Rails, and provides autocompletion for them, there are cases when using shortcuts is more preferable. In the case of Ruby on Rails development, this is especially applicable to HTML and ERB tags.

As you probably know when you start typing <% in .html.erb files, the IDE suggests inserting the whole tag, and puts the caret right inside:

But there are alternatives that you may find more convenient, especially if you are used to the default shortcut ⇧⌘./Ctrl+Shift+. that inserts ERB expression printing tag <%= %>, which doesn’t have a similar version for the “non-rendering” Ruby code execution tag <% %>. This is exactly the kind of case where live templates come in handy because they allow you to create one. Here’s how:

Go to Preferences / Settings | Editor | Live Templates. Choose Rails from the list of available language/markup templates, and hit + to add a new template:

Then take the following steps:

Create an abbreviation that you will type for a quick insertion in the editor (like erbext), and provide a description that will help you remember what a specific template does(F1).

Type the code that should be generated in the Template text field. Specify where the cursor should be put after the template is inserted by typing $END$. In our case we want to have the caret right inside the tag.

Finally, decide if you want to insert the tag with Enter, Tab, or Space, and choose in which file types the tag should be available. Our tag is ERB-specific:

That’s it! Now you have two new ways to quickly insert <% %>. You can either type the abbreviation of the template, and the RubyMine will generate it:

Or call Insert Live Template by pressing ⌘J/Ctrl+J, and choose your custom template by just typing it:

Now, the icing on the cake is that you can also create a live template that will surround selected text with custom live templates just like with HTML tags. To do that, create a new live template (or just copy the existing erbext), change its name, description, and replace $END$ with $SELECTION$:

Now you have an alternate template that allows you to wrap selected text in <% %> by pressing ⌥⌘J/Ctrl+Alt+J:

Pretty handy, isn’t it?

Refer to our web help to learn more about creating, editing, and using live templates in RubyMine.

If you find this feature useful, please share your own custom live templates with us in the comments below.

]]>https://blog.jetbrains.com/ruby/2017/09/using-live-templates-for-ruby-on-rails-in-rubymine/feed/2https://blog.jetbrains.com/ruby/2017/09/using-live-templates-for-ruby-on-rails-in-rubymine/Meet the RubyMine Team at RubyKaigi 2017!http://feedproxy.google.com/~r/jetbrains_rubymine/~3/poEJXbS4RXo/
https://blog.jetbrains.com/ruby/2017/09/rubymine-at-rubykaigi-2017/#respondThu, 07 Sep 2017 13:12:11 +0000http://blog.jetbrains.com/ruby/?p=7636Continue reading →]]>Read this post in Japanese

Hello everyone,

We are happy to announce that the RubyMine team will visit Japan this September for RubyKaigi 2017! Not only are we sponsoring the event together with other Japanese and international tech companies, but we’re also bringing our own presentation:

Drop by for a chat!

If you’re attending RubyKaigi this year, make sure to find our booth in the expo. We would be happy to talk with you about RubyMine, and discuss your issues, questions, and suggestions. We can even organize quick customer meetings on the spot.

Our booth will feature JetBrains and RubyMine branding which are hard to miss. Also, our staff will be wearing JetBrains T-shirts during the conference, so feel free to stop us anytime and chat!

We’re not coming empty-handed: every RubyKaigi participant will get a 20% discount for a personal RubyMine license, as well as a chance to win a free personal RubyMine license, by participating in our raffle. All of this goes without saying that we’ve prepared some swag for you to grab

Running Docker Compose on Windows

If you are running Windows, you probably know that support for Docker and Docker Compose, announced in v2017.1 and v2017.2 respectively, didn’t work for our Windows users because of an inability to configure Docker/Compose as a remote Ruby interpreter in RubyMine. Today’s update finally fixes this and other issues related to the Docker integration on Windows. In short, you should now be able to configure Docker/Compose on Windows the same way as shown below:

Refer to this post to learn how to setup Docker Compose in RubyMine in detail.

More on the Debugger

The previous update was devoted to improvements in the debugger with the following most important ones:

Debugging and attaching to Zeus, Passenger, Foreman web servers, and any other multi-process applications

Better-performing debugger

Previously, costly operations were slowing the debugger down while stepping during the debugging session. But in the previous release we added a way to detect such operations and provide a timeout message instead. Take a look at the example below:

As you can see, instead of evaluating expressions the debugger threw a timeout message, saving you time during debugging. Inline debugging, in this case, shows <?> instead of actual values for the object skipped.

By the way, the debugger provides a backtrace for each timeout operation, which you can find in the debugger’s Console View if you check Verbose debugger output in settings (Preferences / Settings | Build, Execution, Deployment | Debugger).

What if you want to know what a specific variable is equal to despite its heaviness, but get a timeout message instead? In this case, you can simply evaluate that code fragment with the Evaluate Expression:

Debugging & Attaching to multi-process apps

Starting with the previous EAP you shouldn’t have any issues debugging multi-process applications like Passenger, Zeus, and Foreman. You can also attach to the local processes of such applications painlessly.

For example, if you want to debug your Rails app running as a sub-process of a currently running Foreman webserver, you can just attach to Foreman, and RubyMine will also attach to the Rails app, or any other existing sub-process:

Download this build from our website, and please let us know in the comments below if the new improvements help address your issues with Docker (for Windows users) and the debugger.

As usual, you can see the release notes for the full list of improvements, and use our bug tracker to report any issues you encounter.

RubyMine 2017.2.3 EAP has been released, introducing a number of improvements for the debugger and other bug-fixes.

Better Debugger

Our recent drive to enhance performance has affected the debugger too. In this RubyMine EAP we’re bringing these debugging improvements:

No more issues with multi-process debug targets. Now it’s possible to debug servers like Passenger, Zeus, and Foreman painlessly. Moreover, Attach to Local process now perfectly works with these servers: just select the web/deployment server during the attach phase, and RubyMine will stop at the breakpoints in all its subprocesses.

The debugger is now smart enough to detect costly operations triggered by watch expressions evaluation. It will stop such operations if they’re likely to slow down the debugging process. For example, if any tracked variables use SQL queries for the to_s evaluation, RubyMine will not slow down during stepping, which it did before.

RubyMine 2017.2.2 EAP has been released introducing a series of performance improvements and a number of bug-fixes.

The Hunt for Performance

This EAP contains the first part of major performance updates that will take full effect in v2017.3 (to be released in fall 2017).

For this EAP, we have fixed internal bugs affecting the speed of code completion, inspections, and the overall responsiveness of the IDE.

As a quick-and-dirty test we have analyzed Discourse and TracksApp, the two well known open source Rails apps, for existing errors and code smells with RubyMine (Code | Inspect Code), and compared it against the same analysis in the current stable v2017.2.1. The results varied across the team, but generally showed a 50%-100% increase in speed of code analysis when inspecting the whole project.

We encourage you to try and check the same for your applications and let us know how it works out. Note that the changes we made have most likely affected RubyMine in many ways, so please report any issues you face to our bug tracker, or contact our support team.

As usually, every significant feature was announced during our Early Access Program versions, and discovered in a blog post. Let’s see what’s new in detail:

Docker Compose

Support for Docker has been upgraded with Docker Compose! Now you can work with your apps in Docker containers taking advantage of code analysis, completion, and other great IDE features. See the related blog post to learn how to configure Docker Compose for your project.

Starting with this release you can also use the RubyMine debugger to debug your rails applications running with Docker Compose. Find more in this post.

RuboCop Quick-fixes

This release enhances previously added RuboCop support with an ability to auto-correct found code smells. Read more on the blog.

The new Arrangement and Blank lines code style options allow you to configure how different blocks of code such as fields and methods are ordered and separated.

Now you can import some of the ESLint code style rules to the IDE’s JavaScript code style settings.

For SASS and SCSS selectors created with & you can now use code completion in HTML files, and navigate to definition.

Version Control

The Git Log has two new features: Revert commit (see more), which allows you to remove any registered changes, and Reword (see more) — a convenient way to reword your local commits.

The new Commit dialog provides a way to add or remove a blank line between the subject and a body, and set up a max length. The IDE now also offers a quick fix and the Reformat action inside Commit Message.

The redesigned Shelf has got a Preview panel, and a new action to compare the “shelved” file with its local version.

User Interface

The Preview panel in Find in Path now has a Gutter – a left-side pane like in the editor – with line numbers, navigation icons and local change markers.

Since the previous major release (v2017.1) RubyMine has displayed RuboCop offenses treating and highlighting them as code inspections, but lacked an ability to autocorrect found code smells. Now we have improved that partial solution by adding proper quick-fixes:

If you press Alt+Enter, RubyMine will suggest a quick-fix for a found error, and auto-correct all errors in the file with RuboCop. So no more jumping to the terminal to fix your code with RuboCop!

By the way, RuboCop inspections and quick-fixes are now also available in scratch files.