Hack your bundle for fun and profit (La Conf 2013)

Hack your bundle for fun and profit (La Conf 2013)

Bundler has turned out to be a super-usful tool for installing and managing dependencies, but it has hidden depths! This talk discusses some of the ways you can use Bundler and other tools together to boost your development productivity. I’ll walk through how to use the lesser-known but very handy commands like bundle gem, bundle open, and a few others. I’ll show you how to use Bundler to make sure you always run your app on the right version of Ruby, how to search through every gem in your Gemfile with a single command, and how to check for newer versions of the gems you use.

4c3ed917e59156a36212d48155831482?s=128

André Arko

May 10, 2013
Tweet

Transcript

  1. Hack your bundle for fun and profit

  2. André Arko @indirect   

  3. None
  4. None
  5. bundle install

  6. probably what you want bundle install

  7. installs the Gemfile bundle install

  8. after edits or git pulls bundle install

  9. bundle update

  10. probably not what you want bundle update

  11. updates every gem bundle update

  12. this may be surprising bundle update

  13. much more useful bundle update

  14. updates GEM as Gemfile allows bundle update

  15. updates GEM along with child deps bundle update

  16. bundle show

  17. lists bundled gems bundle show

  18. prints the path to GEM bundle show

  19. opens GEM in $EDITOR bundle open

  20. lists paths to every bundled gem bundle show --paths

  21. sneakily useful bundle show --paths

  22. finds “foo” in any gem grep "foo" `bundle show --paths`

  23. Rails 4 sneak preview

  24. Rails 4 sneak preview (well… DHH does this)

  25. gives you a binary that you can run from cron

    bundle binstubs
  26. no more cd in cronjobs /myapp/bin/rake foo

  27. if your Ruby location is known, check it in /myapp/bin/rake

    foo
  28. creates a Gemfile for you bundle init

  29. bundle git locals

  30. bundle git locals use git checkouts directly

  31. bundle git locals changes apply instantly

  32. bundle git locals commits update lock file

  33. bundle config local.rack ~/sw/rack

  34. enforce ruby versions ruby "1.9.3"

  35. sets Heroku ruby version ruby "1.9.3"

  36. bundle won’t load on wrong versions ruby "1.9.3"

  37. literal dependency graph bundle viz

  38. None
  39. load your gems, then open IRB bundle console

  40. create a new gem named NAME bundle gem NAME

  41. gemspec, directories, release tasks, all there bundle gem NAME

  42. tasks update when bundler updates bundle gem NAME

  43. go forth and bundle