Camping

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

Figura: Visitando la página (1)
[scale=0.5]chapter8/camping1.png

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:

Figura: Visitando la página (2)
[scale=0.5]chapter8/camping2.png



Casiano Rodriguez León 2015-01-07