IDE, Terminal and SCM to work with Ruby on Rails

30
IDE, Terminal and SCM to work with Ruby on R ails Henry Le

description

You can have basic guides to start or improve writing Ruby on Rails websites.

Transcript of IDE, Terminal and SCM to work with Ruby on Rails

Page 1: IDE, Terminal and SCM to  work with Ruby on Rails

IDE, Terminal and SCM to work with Ruby on Rails

Henry Le

Page 2: IDE, Terminal and SCM to  work with Ruby on Rails

1. Integrated Development Environment (IDE)

Page 3: IDE, Terminal and SCM to  work with Ruby on Rails

1.a IDE vs Editor• IDE (integrated development environment): make software

development faster, usually provide code auto-completion; refactoring support; fast find of files, function, class; debug support; integrated build tools; source control management …

• IDE examples: Netbeans, Eclipse, Sublime, Ruby Mine, Aptana Studio…

• Text Editor: provide plain text editor, sometimes also provide syntax highlighting

• Text editor examples: notepad, gedit, TextMate, vim, …

Page 4: IDE, Terminal and SCM to  work with Ruby on Rails

1.b What IDE is popular for RoR?

• In Ruby on Rails community, Sublime and Ruby Mine are the 2 most popular IDEs that everyone usually use in Mac OS and Linnux.

• For Windows Rubyist, they usually use Netbeans, Aptana and Sublime.

Page 5: IDE, Terminal and SCM to  work with Ruby on Rails

Ruby Mine

Page 6: IDE, Terminal and SCM to  work with Ruby on Rails

Netbeans

Page 7: IDE, Terminal and SCM to  work with Ruby on Rails

Sublime

Page 8: IDE, Terminal and SCM to  work with Ruby on Rails

1.c Sublime Packages

• Sublime Packages are the way Sublime organisation its plugins, settings.

• For RoR developer, we can add more syntax plugins to have much better code highlighting.

Page 9: IDE, Terminal and SCM to  work with Ruby on Rails

Sublime Packages

Page 10: IDE, Terminal and SCM to  work with Ruby on Rails

Without sass plugin

With sass plugin

Page 11: IDE, Terminal and SCM to  work with Ruby on Rails

1.d Sublime Key Bindings and Settings

• Sublime settings store our config about writing code, page format, font type, highlight line, tab size … We can refer the Setting - Default file for the options supported.

• Sublime key binding store short cut definitions for Sublime commands. We can refer in Key Binding command for some examples to customise or add new ones.

Page 12: IDE, Terminal and SCM to  work with Ruby on Rails

Sublime Key Bindings

Page 13: IDE, Terminal and SCM to  work with Ruby on Rails

Sublime Settings

Page 14: IDE, Terminal and SCM to  work with Ruby on Rails

1.e Are Sublime Settings is important?

• This is short but important!

• Why? When work in a group, we need to make our code consistent with everyone and the code convention is one of the best key here.

Page 15: IDE, Terminal and SCM to  work with Ruby on Rails

Mix indentation formats

We don’t see the different in Editor but in Github they show very clear. It make reviewing pull requests more

difficult and confusing.

Page 16: IDE, Terminal and SCM to  work with Ruby on Rails

Indentation for 4 spaces or tab

Long indentation distance make it hard to follow the code follow, reduce ability to focusing when the line so long.

Page 17: IDE, Terminal and SCM to  work with Ruby on Rails

The best practises

https://github.com/bbatsov/ruby-style-guide

Page 18: IDE, Terminal and SCM to  work with Ruby on Rails

2. Terminal

Page 19: IDE, Terminal and SCM to  work with Ruby on Rails

Command line format customisation

• https://github.com/robbyrussell/oh-my-zsh

• https://github.com/zsh-users/antigen

Page 20: IDE, Terminal and SCM to  work with Ruby on Rails

Sample screenshot

Page 21: IDE, Terminal and SCM to  work with Ruby on Rails

Sample config

Page 22: IDE, Terminal and SCM to  work with Ruby on Rails

3. Source control management (SCM)

Page 23: IDE, Terminal and SCM to  work with Ruby on Rails

Git• Almost RoR developer use git as source control

management system.

• Why? Becasuse it’s very flexible, easy to use and make developer life happier. :)

• For more information and comparision, you can find at:

• http://stackoverflow.com/questions/871/why-is-git-better-than-subversion

• https://git.wiki.kernel.org/index.php/GitSvnComparison

Page 24: IDE, Terminal and SCM to  work with Ruby on Rails

Git flow overview

• Gitk (Linux)

• Git-cola (Mac, Linux, Windows)

• SourceTree (Mac, Windows)

• Linux user can not use SourceTree so a combine of gitk and git cola work fine also.

Page 25: IDE, Terminal and SCM to  work with Ruby on Rails

Git cola

Page 26: IDE, Terminal and SCM to  work with Ruby on Rails

Gitk

Page 27: IDE, Terminal and SCM to  work with Ruby on Rails

SourceTree

Page 28: IDE, Terminal and SCM to  work with Ruby on Rails

4. Conclusion

• Tools for software development are flexible and depend on which languages, platforms that your software written by.

• For Ruby on Rails, this slide has covered some tips and techniques on Sublime, Command Line customisation and Git flow tools.

Page 29: IDE, Terminal and SCM to  work with Ruby on Rails

Happy coding

Hope this help!

Page 30: IDE, Terminal and SCM to  work with Ruby on Rails

Preference

• http://sublimetext.info/docs/en/

• https://github.com/bbatsov/ruby-style-guide

• https://github.com/styleguide/ruby