capobvious 0.2.94 → 0.2.95

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,7 +63,7 @@ set :backup_db, false
63
63
  set :backup_sys, false
64
64
  set :auto_migrate, true
65
65
 
66
- #set :deploy_to, "/home/user/www/application"
66
+ #set :deploy_folder, "/home/user/www/application"
67
67
  set :deploy_via, :remote_cache
68
68
 
69
69
  set :keep_releases, 5
@@ -2,7 +2,7 @@
2
2
  require "rvm/capistrano"
3
3
 
4
4
  Capistrano::Configuration.instance.load do
5
- rvmrc = "rvm use #{rvm_ruby_string}"
5
+ rvmrc = "rvm use #{rvm_ruby_string}" if exists?(:rvm_ruby_string)
6
6
  set :rvm_type, :user
7
7
 
8
8
  default_run_options[:pty] = true
@@ -10,7 +10,11 @@ Capistrano::Configuration.instance.load do
10
10
 
11
11
  set :rails_env, "production" unless exists?(:rails_env)
12
12
  set :branch, "master" unless exists?(:branch)
13
- set :deploy_to, "/home/#{user}/www/#{application}" unless exists?(:deploy_folder)
13
+ if exists?(:deploy_folder)
14
+ set :deploy_to, fetch(:deploy_folder)
15
+ else
16
+ set :deploy_to, "/home/#{user}/www/#{application}"
17
+ end
14
18
  set :deploy_via, :remote_cache unless exists?(:deploy_via)
15
19
  set :keep_releases, 5 unless exists?(:keep_releases)
16
20
  set :use_sudo, false unless exists?(:use_sudo)
@@ -131,7 +135,7 @@ Capistrano::Configuration.instance.load do
131
135
  after "deploy:update_code", "create:dbconf"
132
136
  namespace :create do
133
137
  task :files do
134
- create.rvmrc
138
+ create.rvmrc if exists?(:rvmrc)
135
139
  end
136
140
  desc "Create .rvmrc & files"
137
141
  task :rvmrc do
@@ -708,6 +712,27 @@ EOF
708
712
  end
709
713
  end
710
714
 
715
+ if gem_use?('whenever') && exists?(:whenever) && fetch(:whenever) == true
716
+ set :whenever_command, "bundle exec whenever"
717
+ require "whenever/capistrano/recipes"
718
+ after "bundle:install", "whenever:update_crontab"
719
+ after "deploy:rollback", "whenever:update_crontab"
720
+ end
721
+
722
+ #namespace :whenever do
723
+ # task :update_crontab do
724
+ # run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} whenever:update_crontab"
725
+ # end
726
+ #end
727
+
728
+ def local_gem_available?(name)
729
+ Gem::Specification.find_by_name(name)
730
+ rescue Gem::LoadError
731
+ false
732
+ rescue
733
+ Gem.available?(name)
734
+ end
735
+
711
736
 
712
737
  def file_size(file_path)
713
738
  size = run("wc -c #{file_path} | cut -d' ' -f1")
@@ -1,3 +1,3 @@
1
1
  module Capobvious
2
- VERSION = "0.2.94"
2
+ VERSION = "0.2.95"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capobvious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.94
4
+ version: 0.2.95
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,40 +9,40 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-18 00:00:00.000000000 Z
12
+ date: 2012-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
+ prerelease: false
16
17
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
+ none: false
22
23
  type: :runtime
23
- prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
25
  requirements:
27
26
  - - ! '>='
28
27
  - !ruby/object:Gem::Version
29
28
  version: '0'
29
+ none: false
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rvm-capistrano
32
+ prerelease: false
32
33
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
+ none: false
38
39
  type: :runtime
39
- prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
41
  requirements:
43
42
  - - ! '>='
44
43
  - !ruby/object:Gem::Version
45
44
  version: '0'
45
+ none: false
46
46
  description: Capfile that we use every day
47
47
  email:
48
48
  - donotsendhere@gmail.com
@@ -66,17 +66,17 @@ rdoc_options: []
66
66
  require_paths:
67
67
  - lib
68
68
  required_ruby_version: !ruby/object:Gem::Requirement
69
- none: false
70
69
  requirements:
71
70
  - - ! '>='
72
71
  - !ruby/object:Gem::Version
73
72
  version: '0'
74
- required_rubygems_version: !ruby/object:Gem::Requirement
75
73
  none: false
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
75
  requirements:
77
76
  - - ! '>='
78
77
  - !ruby/object:Gem::Version
79
78
  version: '0'
79
+ none: false
80
80
  requirements: []
81
81
  rubyforge_project: capobvious
82
82
  rubygems_version: 1.8.24