capobvious 0.2.93 → 0.2.94

Sign up to get free protection for your applications and to get access to all the features.
data/bin/capobvious CHANGED
@@ -36,6 +36,8 @@ def unindent(string)
36
36
  string.strip.gsub(/^#{indentation}/, "")
37
37
  end
38
38
 
39
+ repository=`git remote -v`.split("\n").first.split("\t").last.split(/\s+/).first rescue nil
40
+
39
41
  files = {
40
42
  "Capfile" => <<FILE,
41
43
  load 'deploy'
@@ -51,7 +53,7 @@ set :application, "appname"
51
53
  set :user, "USER_NAME_HERE"
52
54
  set :serv, "IP_ADDRESS_HERE"
53
55
 
54
- set :repository, "REPOSITORY_HERE"
56
+ set :repository, "#{repository||'REPOSITORY_HERE'}"
55
57
  set :branch, "master"
56
58
  set :server_name, "example.com"
57
59
  set :server_redirect, "www.example.com"
@@ -10,7 +10,7 @@ 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_to)
13
+ set :deploy_to, "/home/#{user}/www/#{application}" unless exists?(:deploy_folder)
14
14
  set :deploy_via, :remote_cache unless exists?(:deploy_via)
15
15
  set :keep_releases, 5 unless exists?(:keep_releases)
16
16
  set :use_sudo, false unless exists?(:use_sudo)
@@ -29,20 +29,21 @@ Capistrano::Configuration.instance.load do
29
29
  #if capture("if [ -f #{serv_path} ]; then echo '1'; fi") == '1'
30
30
  # database_yml = capture("cat #{serv_path}")
31
31
  #else
32
- database_yml = File.open(database_yml_path)
32
+ database_yml = File.open(database_yml_path) rescue nil
33
33
  #end
34
- config = YAML::load(database_yml)
35
- adapter = config[rails_env]["adapter"]
36
- database = config[rails_env]["database"]
37
- db_username = config[rails_env]["username"]
38
- db_password = config[rails_env]["password"]
39
-
40
- config = YAML::load(File.open(database_yml_path))
41
- local_rails_env = 'development'
42
- local_adapter = config[local_rails_env]["adapter"]
43
- local_database = config[local_rails_env]["database"]
44
- local_db_username = config[local_rails_env]["username"]||`whoami`.chop
45
- local_db_password = config[local_rails_env]["password"]
34
+ if database_yml
35
+ config = YAML::load(database_yml)
36
+ adapter = config[rails_env]["adapter"]
37
+ database = config[rails_env]["database"]
38
+ db_username = config[rails_env]["username"]
39
+ db_password = config[rails_env]["password"]
40
+
41
+ local_rails_env = 'development'
42
+ local_adapter = config[local_rails_env]["adapter"]
43
+ local_database = config[local_rails_env]["database"]
44
+ local_db_username = config[local_rails_env]["username"]||`whoami`.chop
45
+ local_db_password = config[local_rails_env]["password"]
46
+ end
46
47
 
47
48
  set :local_folder_path, "tmp/backup"
48
49
  set :timestamp, Time.new.to_i.to_s
@@ -1,3 +1,3 @@
1
1
  module Capobvious
2
- VERSION = "0.2.93"
2
+ VERSION = "0.2.94"
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.93
4
+ version: 0.2.94
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-02 00:00:00.000000000 Z
12
+ date: 2012-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano