capinatra 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/capinatra ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+
5
+ FileUtils.cp File.join(File.dirname(__FILE__), '..', 'templates', 'Capfile'), File.join(Dir.pwd, 'Capfile')
data/lib/capinatra.rb ADDED
@@ -0,0 +1,34 @@
1
+ require 'erb'
2
+
3
+ Capistrano::Configuration.instance(:must_exist).load do
4
+ after "deploy:update_code", "capinatra:config"
5
+
6
+ namespace :capinatra do
7
+ desc "Sets up apache vhost"
8
+ task :vhost do
9
+ logger.info 'compiling vhost template'
10
+ template = File.read(File.join(File.dirname(__FILE__), '..', 'templates', 'vhost.conf.erb'))
11
+
12
+ logger.info 'uploading vhost file'
13
+ put ERB.new(template).result(binding), "#{application}.conf"
14
+
15
+ logger.info 'moving vhost file to ' + apache_vhost_dir
16
+ sudo "mv #{application}.conf #{apache_vhost_dir}"
17
+
18
+ logger.info 'restarting apache'
19
+ sudo "sudo apache2ctl graceful"
20
+ end
21
+
22
+ desc "Adds config.ru file"
23
+ task :config do
24
+ logger.info 'compiling config.ru template'
25
+ template = File.read(File.join(File.dirname(__FILE__), '..', 'templates', 'config.ru.erb'))
26
+
27
+ logger.info 'uploading config.ru file'
28
+ put ERB.new(template).result(binding), "config.ru"
29
+
30
+ logger.info 'moving vhost file to ' + apache_vhost_dir
31
+ sudo "mv config.ru #{release_path}"
32
+ end
33
+ end
34
+ end
data/templates/Capfile ADDED
@@ -0,0 +1,34 @@
1
+ require 'capistrano/version'
2
+ require 'rubygems'
3
+ require 'capinatra'
4
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
5
+
6
+ # app settings
7
+ set :app_file, "app.rb"
8
+ set :application, "your-app-name"
9
+ set :domain, "your-app-domain.com"
10
+ role :app, domain
11
+ role :web, domain
12
+ role :db, domain, :primary => true
13
+
14
+ # general settings
15
+ set :user, "deploy"
16
+ set :group, "deploy"
17
+ set :deploy_to, "/home/deploy/apps/#{application}"
18
+ set :deploy_via, :remote_cache
19
+ default_run_options[:pty] = true
20
+
21
+ # scm settings
22
+ set :repository, "git@github.com:your-name/your-project"
23
+ set :scm, "git"
24
+ set :branch, "master"
25
+ set :git_enable_submodules, 1
26
+
27
+ # where the apache vhost will be generated
28
+ set :apache_vhost_dir, "/etc/apache2/sites-enabled/"
29
+
30
+ namespace :deploy do
31
+ task :restart do
32
+ run "touch #{current_path}/tmp/restart.txt"
33
+ end
34
+ end
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'sinatra'
3
+
4
+ root = File.dirname(__FILE__)
5
+
6
+ Sinatra::Application.default_options.merge! \
7
+ :run => false,
8
+ :root => root,
9
+ :app_file => File.join(root, '<%= app_file %>'),
10
+ :views => File.join(root, 'views')
11
+
12
+ load File.join(File.dirname(__FILE__), '<%= app_file %>')
13
+
14
+ run Sinatra.application
@@ -0,0 +1,4 @@
1
+ <VirtualHost *:80>
2
+ ServerName <%= domain %>
3
+ DocumentRoot <%= deploy_to %>/current/public
4
+ </VirtualHost>
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capinatra
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors: []
7
+
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-21 00:00:00 -05:00
13
+ default_executable: capinatra
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description:
26
+ email:
27
+ executables:
28
+ - capinatra
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
33
+ files:
34
+ - bin/capinatra
35
+ - lib/capinatra.rb
36
+ - templates/Capfile
37
+ - templates/config.ru.erb
38
+ - templates/vhost.conf.erb
39
+ has_rdoc: false
40
+ homepage:
41
+ post_install_message:
42
+ rdoc_options: []
43
+
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ requirements: []
59
+
60
+ rubyforge_project:
61
+ rubygems_version: 1.3.1
62
+ signing_key:
63
+ specification_version: 2
64
+ summary: Quickly deploy Sinatra apps on Passenger
65
+ test_files: []
66
+