capinatra 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/templates/Capfile +8 -2
- data/templates/config.ru.erb +7 -1
- metadata +1 -1
data/templates/Capfile
CHANGED
@@ -3,7 +3,13 @@ require 'rubygems'
|
|
3
3
|
require 'capinatra'
|
4
4
|
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
|
5
5
|
|
6
|
-
#
|
6
|
+
# set an app_class if you're using the more recent style of creating
|
7
|
+
# Sinatra apps, where app_class would be the name of your subclass
|
8
|
+
# of Sinatra::Base. if you're just requiring 'sinatra' and using the
|
9
|
+
# more traditional DSL style of Sinatra, then comment this line out.
|
10
|
+
set :app_class, 'YourApp'
|
11
|
+
|
12
|
+
# standard settings
|
7
13
|
set :app_file, "app.rb"
|
8
14
|
set :application, "your-app-name"
|
9
15
|
set :domain, "your-app-domain.com"
|
@@ -11,7 +17,7 @@ role :app, domain
|
|
11
17
|
role :web, domain
|
12
18
|
role :db, domain, :primary => true
|
13
19
|
|
14
|
-
#
|
20
|
+
# environment settings
|
15
21
|
set :user, "deploy"
|
16
22
|
set :group, "deploy"
|
17
23
|
set :deploy_to, "/home/deploy/apps/#{application}"
|
data/templates/config.ru.erb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
<% if app_class # modern way of declaring Sinatra apps %>
|
3
|
+
require 'sinatra/base'
|
4
|
+
<% else # old way of declaring Sinatra apps %>
|
2
5
|
require 'sinatra'
|
3
6
|
|
4
7
|
root = File.dirname(__FILE__)
|
@@ -8,7 +11,10 @@ Sinatra::Application.default_options.merge! \
|
|
8
11
|
:root => root,
|
9
12
|
:app_file => File.join(root, '<%= app_file %>'),
|
10
13
|
:views => File.join(root, 'views')
|
14
|
+
<% end %>
|
11
15
|
|
12
16
|
load File.join(File.dirname(__FILE__), '<%= app_file %>')
|
13
17
|
|
14
|
-
|
18
|
+
<% if app_class %>
|
19
|
+
run <%= app_class %>
|
20
|
+
<% end %>
|