5 Of Our Favorite Ruby Gems

25
Custom Software, Simplified 5 Awesome Gems ...and some fun with MemeGenerator Wednesday, February 6, 13

description

A lightning talk presented as part of a series at BostonRB project night, February 6, 2013

Transcript of 5 Of Our Favorite Ruby Gems

Page 1: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

5 Awesome Gems...and some fun with MemeGenerator

Wednesday, February 6, 13

Page 2: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Hi!• I’m Dan

• Co-Organizer @ BostonRB

• Principal Consultant @ LaunchWare

• Head of Instruction @ Launch Academy

• dpickett on Twitter / GitHub/ everyHub

Wednesday, February 6, 13

Page 3: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Some Favorites

• inherited_resources

• kaminari

• guard

• configatron

• bourbon

Wednesday, February 6, 13

Page 4: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Inherited Resources

Wednesday, February 6, 13

Page 5: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why?

• Makes writing boilerplate controllers easier

• Easy internationalization of flash text with the Responders gem

• Easy API generation for JSON and XML

Wednesday, February 6, 13

Page 6: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why Not?

• Another DSL/Library to Learn

• Can sometimes get in your way for nonstandard controller actions

• Not good for beginners - feel the pain of repetition in your controllers, first

Wednesday, February 6, 13

Page 7: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

class  AccountsController  <  ApplicationController    respond_to  :json    inherit_resources  #gives  you  all  RESTful  actions  for  Accountend

Wednesday, February 6, 13

Page 8: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Kaminari

Wednesday, February 6, 13

Page 9: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why?• Easily customizable/themed

• great configuration options

• awesome generators

• Scope-Based

• Doesn’t hack core objects

• I18n ready for localization

Wednesday, February 6, 13

Page 10: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why Not?

• Other engines might express alternative decisions (refinery, ie)

• Can be painful to paginate non-scope/AREL collections

Wednesday, February 6, 13

Page 11: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

#in  your  controller@users  =  User.    page(params[:page]).    per(50)

#in your view<%= paginate @users %>

Wednesday, February 6, 13

Page 12: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

guard

Wednesday, February 6, 13

Page 13: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why?

• Don’t constantly have to run tests manually

• Invokes tests for files that change

• Extensible plugin architecture

• Extensible notification architecture

Wednesday, February 6, 13

Page 14: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why Not?

• Minor issue where guard plugins can lag behind on dependencies

Wednesday, February 6, 13

Page 15: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Configatron

Wednesday, February 6, 13

Page 16: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why?

• Easy, dynamic configuration for gems and applications

• Configure via manual code, hash or YAML

• Plays nicely with Rails Application configuration

Wednesday, February 6, 13

Page 17: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why Not?

• nulls vs. blanks can be confusing

Wednesday, February 6, 13

Page 18: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

module  Facebook    def  self.secret_key=(key)        configatron.facebook.secret_key  =  key    end

   def  self.secret_key        configatron.facebook.secret_key    endend

Wednesday, February 6, 13

Page 19: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Bourbon

Wednesday, February 6, 13

Page 20: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why?

• Handy shortcuts for common CSS idioms

• Beautiful documentation

• Exposes you to lots of great/creative CSS uses

Wednesday, February 6, 13

Page 21: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Why Not?

• Can be difficult to install/configure as part of the asset pipeline

• You still need to be an informed consumer of experimental CSS features

Wednesday, February 6, 13

Page 22: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

http://bourbon.io

Wednesday, February 6, 13

Page 23: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

To Learn More...

http://launchacademy.co

The Fun Begins May 1stWednesday, February 6, 13

Page 24: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

For More Gems...

• Ignition, our rails template is available

• http://github.com/LaunchWare/ignition

Wednesday, February 6, 13

Page 25: 5 Of Our Favorite Ruby Gems

Custom Software, Simplified

Questions?

Wednesday, February 6, 13