Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial Commit

  • Loading branch information...
commit c620dabee75600829ea1893ea23cc1d932a61314 0 parents
@arunsark authored
1  .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.2-p290@sinatra
8 Capfile
@@ -0,0 +1,8 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+
+# Uncomment if you are using Rails' asset pipeline
+# load 'deploy/assets'
+
+Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+
+load 'config/deploy' # remove this line to skip loading any of the default tasks
9 Gemfile
@@ -0,0 +1,9 @@
+source 'http://rubygems.org'
+
+gem 'sinatra'
+gem 'thin'
+gem 'haml'
+
+group :development do
+ gem 'capistrano'
+end
38 Gemfile.lock
@@ -0,0 +1,38 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ capistrano (2.8.0)
+ highline
+ net-scp (>= 1.0.0)
+ net-sftp (>= 2.0.0)
+ net-ssh (>= 2.0.14)
+ net-ssh-gateway (>= 1.1.0)
+ daemons (1.1.4)
+ eventmachine (0.12.10)
+ haml (3.1.2)
+ highline (1.6.2)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-sftp (2.0.5)
+ net-ssh (>= 2.0.9)
+ net-ssh (2.1.4)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ rack (1.3.2)
+ sinatra (1.2.6)
+ rack (~> 1.1)
+ tilt (>= 1.2.2, < 2.0)
+ thin (1.2.11)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
+ tilt (1.3.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capistrano
+ haml
+ sinatra
+ thin
22 config/deploy.rb
@@ -0,0 +1,22 @@
+set :application, "set your application name here"
+set :repository, "set your repository location here"
+
+set :scm, :subversion
+# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
+
+role :web, "your web-server here" # Your HTTP server, Apache/etc
+role :app, "your app-server here" # This may be the same as your `Web` server
+role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run
+role :db, "your slave db-server here"
+
+# if you're still using the script/reaper helper you will need
+# these http://github.com/rails/irs_process_scripts
+
+# If you are using Passenger mod_rails uncomment this:
+# namespace :deploy do
+# task :start do ; end
+# task :stop do ; end
+# task :restart, :roles => :app, :except => { :no_release => true } do
+# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+# end
+# end
13 hello.rb
@@ -0,0 +1,13 @@
+
+get '/' do
+ 'Hello World!'
+end
+
+get '/hello/:name' do |n|
+ "Hello #{n}"
+end
+
+get '/haml/:name' do |n|
+ @name = n
+ haml :index
+end
6 main.rb
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__))
+require 'bundler/setup'
+require 'sinatra'
+require 'haml'
+require 'hello'
+require 'pages'
3  pages.rb
@@ -0,0 +1,3 @@
+get '/pages' do
+ "Hello Pages"
+end
4 views/index.haml
@@ -0,0 +1,4 @@
+%h1 Hello HAML
+%p
+ ="I am calling you from sinatra #{@name}"
+
Please sign in to comment.
Something went wrong with that request. Please try again.