My presentation about deveropment environment for Ruby programming.
http://kentaro.hatenablog.com/entry/2012/05/29/230254
Ruby Dev Envid:antipop / @kentaro2012-05-29
View Slide
Self Introduction•id:antipop•@kentaro•Working for paperboy&co.
Seasoned Perler
Ruby Beginner
This meeting is NOT to giveuseful information to you.It’s YOU to do so.
Agenda•Shell•irb / pry•Multiple Rubies•Helpful Gems for Deveropment•How to consult documents•Editor Settings
Shell
aliasesalias be="bundle exec"alias r='rails'alias rs='rspec'alias ra='rake'
@banyan’salias r="rails"alias rr="routes_cache | less"alias rrg="routes_cache | grep"alias rrr="routes_cache --force"alias rrrg="routes_cache --force | grep"alias rspec='rspec -c'alias fu='bundle exec rspec --format Fuubar --color spec'alias nyan='bundle exec rspec --format NyanCatFormatter --color spec'alias five='bundle exec rspec --format Fivemat --color spec'alias br='bundle exec rake spec'alias rdm='rake db:migrate'alias b='bundle exec'alias bundle-init='bundle install --path .bundle/gems'alias plog='grc powder applog' # dependent on grcalias powlog='grc powder applog' # dependent on grcalias rails-init='bundle install --path .bundle/gems && rake db:createdb:migrate && powder link'https://github.com/banyan/config/blob/master/.zshrc#L182
Any Suggestion?
irb / pry
show-docalias with ?
show-sourcealias with $
pry-rails•Replacement for `rails c`•pry with rails env
pry-nav•Simple step execution•continue / next / step•Helpful for debugging.pryrc:Pry.commands.alias_command 'c', 'continue'Pry.commands.alias_command 's', 'step'Pry.commands.alias_command 'n', 'next'
(DEMO)
pry-clipboard•Allows us to copy from theresults / history in prysession and paste them•Needs to some work-aroundto be used with tmux• http://kentaro.hatenablog.com/entry/2012/04/27/002058
Multiple Rubiesrvm / rbenv
rbenv$ curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash$ rbenv install 1.9.3-p194$ rbenv global 1.9.3-p194$ rbenv rehash$ ruby -vruby 1.9.3p194 (2012-04-20 revision 35410)[x86_64-darwin11.3.0]
rbenv-bundler•No more `bundle exec`•Just type `rails`, `rspec`, etc.
Gems Helpful forDeveropment
•bundler•gem-browse•vagrant•...
How to ConsultDocuments
αΫαΫҾ͚ΔRuby ϦϑΝϨϯεϚχϡΞϧhttp://miyamae.github.com/rubydoc-ja/
api.rubyonrails.orghttp://api.rubyonrails.org/
Rails Guidehttp://guides.rubyonrails.org/
Rails Guide in Kindle
Editor SettingsVim / Emacs
rinari•Jump from some buffer toanother related with eachother (eg. model to spec)•rhtml-mode•colorize•some shortcut keys
anything-project•Narrows down canditate filesinto specific projects•Fast and sufficient•rinari is too feature-richfor me
anything-project(require 'anything-project)(define-key global-map (kbd "C-;") 'anything-project)(ap:add-project:name 'ruby:look-for '("Gemfile"):include-regexp '("\\.rb$" "\\.erb$" "^Gemfile$"):exclude-regexp "\\(vendor\\|tmp\\|log\\|doc\\|\\.git\\|\\.bundle\\)/")
anything-rdefsMethoddefinitionas outlines