sky mountains forest tent

Camping, a Ruby Microframework

camping site sign

Fast To Learn

Learning Camping only requires basic Ruby skills.

require 'camping'
Camping.goes :Blog
module Blog end

Camping Is Simple Yet Powerful

Camping is simpler than Rails, but yet still follows the MVC pattern unlike Sinatra and Padrino.

require 'camping'
Camping.goes :Blog
module Blog 
	module Models end
	module Controllers end
	module Views end
end

Camping Is Lightning Fast

Camping is built on Rack and is very compact making web apps fast to load/run and memory efficient.

The whole web microframework source code consistently stays at less than 4kB. You can probably view the complete source code on a single page.

Camping Model Persistence Is Up To You

Although Camping has an affinity for ActiveRecord, you can use your favorite ORM with it (e.g. MongoMapper to acces MongoDB)

If you choose ActiveRecord, Camping will manage a default Sqlite database and let you define schema migrations using classes.

    class BlogInitialSchemaCreation < V 1.0
      def self.up
        create_table :blog_posts, #...
      end
      
      def self.down
        drop_table :blog_posts
      end
    end

Camping Views Are Flexible

You can mix and match different view engines such as:

  • ERB - mix HTML and Ruby fragments
  • HAML
  • Markaby
  • ...

Camping Controllers Are Easy

Controller routes are declared at the same time as the controller definition:

class Edit < R '/post/(\d+)/edit'
  def get(post_id) end
  def post(post_id) end
end										

What Can You Build With Camping?

Camping is great for:

  • Web Sites
  • Internal Web Apps
  • Web Services