MacBookdeCasiano:~ casiano$ sudo gem install camping Password: Successfully installed camping-2.1.467 1 gem installed Installing ri documentation for camping-2.1.467... Installing RDoc documentation for camping-2.1.467...
MacBookdeCasiano:~ casiano$ gem which camping (checking gem camping-2.1.467 for camping) /Library/Ruby/Gems/1.8/gems/camping-2.1.467/lib/camping.rb
MacBookdeCasiano:chapter8ReflectionandMetaprogramming casiano$ camping nuts.rb ** Starting Mongrel on 0.0.0.0:3301
Añadimos este código a nuts.rb
:
module Nuts::Controllers class Index < R '/' def get Time.now.to_s end end end
y lo ejecutamos de nuevo: