shaddox 0.0.24 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shaddox/shadow.rb +10 -8
- data/lib/shaddox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 959be3a573d73f65aff4a01e635b0b7825c32456
|
4
|
+
data.tar.gz: c57378931aed9b37b571f1e43c188909d1235761
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d11f2eab72bdfa3b5cf07b69edd8f69ef0e9fca8ed2e8b50424549f4e04fb9418a9c1cf1de4b49a18c5631722e096102ee857d7d1a4ade45485f4ab26778607
|
7
|
+
data.tar.gz: d4a8d0ea643810e493e32c5aee0a141ee5630edcf556e09d27b78bbcba1ca2a4b0b5f01272491d15b83aef786e51fc20ec39446bbe8e03035fa950e25bc2efd6
|
data/lib/shaddox/shadow.rb
CHANGED
@@ -10,7 +10,7 @@ module Shaddox
|
|
10
10
|
require 'fileutils'
|
11
11
|
#include FileUtils
|
12
12
|
def initialize(options, &block)
|
13
|
-
@debug = options[:debug] || false
|
13
|
+
@debug = options[:debug] || true # TODO: change to false for actual release
|
14
14
|
@installer = options[:installer]
|
15
15
|
@tmppath = options[:tmppath] || '/tmp/shaddox/'
|
16
16
|
@required = true
|
@@ -36,11 +36,10 @@ module Shaddox
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def cd(path, &block)
|
39
|
-
current_path = Dir.pwd
|
40
39
|
mkdir(path)
|
41
|
-
FileUtils.cd(path.exp_path)
|
42
|
-
|
43
|
-
|
40
|
+
FileUtils.cd(path.exp_path) do
|
41
|
+
instance_eval(&block)
|
42
|
+
end
|
44
43
|
end
|
45
44
|
|
46
45
|
def exists(path)
|
@@ -58,12 +57,12 @@ module Shaddox
|
|
58
57
|
def ln_s(source, dest, opts = {})
|
59
58
|
ensure_parent_dir(source)
|
60
59
|
ensure_parent_dir(dest)
|
61
|
-
info "Linking '#{source}' to '#{dest}'", 1 if @
|
60
|
+
info "Linking '#{source}' to '#{dest}'", 1 if @debug
|
62
61
|
FileUtils::ln_s(source.exp_path, dest.exp_path, opts)
|
63
62
|
end
|
64
63
|
|
65
64
|
def mkdir(path)
|
66
|
-
info "Ensuring directory '#{path}' exists", 1 if @
|
65
|
+
info "Ensuring directory '#{path}' exists", 1 if @debug
|
67
66
|
FileUtils::mkdir_p(path.exp_path)
|
68
67
|
end
|
69
68
|
|
@@ -102,6 +101,7 @@ module Shaddox
|
|
102
101
|
case repo.vcs
|
103
102
|
when :git
|
104
103
|
# Clone/update repo in vcs:
|
104
|
+
info 'Updating the repository', 1 if @debug
|
105
105
|
if exists_d('vcs')
|
106
106
|
cd 'vcs' do
|
107
107
|
exec "git fetch #{repo.url} #{repo.branch}:#{repo.branch} --force"
|
@@ -114,10 +114,12 @@ module Shaddox
|
|
114
114
|
|
115
115
|
# Link shared paths
|
116
116
|
repo.shared.each do |shared_path|
|
117
|
+
info 'Linking shared paths', 1 if @debug
|
117
118
|
ln_s "#{release_path}/#{shared_path}", "./shared/#{shared_path}"
|
118
119
|
end
|
119
120
|
|
120
121
|
# Link ./current to the latest release
|
122
|
+
info 'Linking current to latest release', 1 if @debug
|
121
123
|
ln_s './current', release_path
|
122
124
|
end
|
123
125
|
end
|
@@ -137,7 +139,7 @@ module Shaddox
|
|
137
139
|
puts "-------------------"
|
138
140
|
end
|
139
141
|
raise "No installer specified for this target!" unless @installer
|
140
|
-
info "Ensuring #{package} is installed with #{@installer}", 1 if @
|
142
|
+
info "Ensuring #{package} is installed with #{@installer}", 1 if @debug
|
141
143
|
package_installed = lambda { system("type #{package} >/dev/null 2>&1") }
|
142
144
|
unless package_installed.call()
|
143
145
|
case @installer
|
data/lib/shaddox/version.rb
CHANGED