rbbt-util 5.5.55 → 5.5.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/rbbt/resource.rb +31 -29
- data/lib/rbbt/util/cmd.rb +3 -3
- data/share/unicorn.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTdmNTRiNGE5OWE1NGU0MTY4MTRkYzE0MTM3NWIzOGI3ODk1M2ZlZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2UyNzkwM2MyOTU1MDM4YWU0Nzg3YjdjNjhjM2EzNmUxMDg1NTZhOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2FkOTZiZWJhYmU1ODZhYmJkYWMwOTcxZjVjZWU0ZjMyNDc0ODkyZDVkNjgw
|
10
|
+
MzYyMDZiMDZhMzk0YzNiNGQ0ZDk4OTg2NGM2M2IyMjc0MjJlOWJmMDcwYjI0
|
11
|
+
OTY5MThlNDAxZWYyZjE1MThkNjM1MTQ4OTAwM2M4MjJkMzViMmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTNkOWQ1YmYwZmI3MWI4NTc2MDg5OTAzMWEwMDkyZjZkMzIyMDljMTA3YWRl
|
14
|
+
NGU3NzRkZWRhODk2NzY5ZWIxNzI4YTdhMGUzMjhkOGZjNTA1MDAzMGJkNGU2
|
15
|
+
NWZlZjViMWQ5MTUzZTE5YmFlMWNiN2E5MTQ4YWE5MzM2MDJlMWI=
|
data/lib/rbbt/resource.rb
CHANGED
@@ -111,44 +111,46 @@ module Resource
|
|
111
111
|
if not File.exists? final_path or force
|
112
112
|
Log.medium "Producing: #{ final_path }"
|
113
113
|
Misc.lock final_path + '.produce' do
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
114
|
+
if not File.exists? final_path or force
|
115
|
+
(remote_server and get_from_server(path, final_path)) or
|
116
|
+
begin
|
117
|
+
case type
|
118
|
+
when :string
|
119
|
+
Open.write(final_path, content)
|
120
|
+
when :url
|
121
|
+
Open.write(final_path, Open.open(content))
|
122
|
+
when :proc
|
123
|
+
data = case content.arity
|
124
|
+
when 0
|
125
|
+
content.call
|
126
|
+
when 1
|
127
|
+
content.call final_path
|
128
|
+
end
|
129
|
+
Open.write(final_path, data) unless data.nil?
|
130
|
+
when :rake
|
131
|
+
run_rake(path, content, rake_dir)
|
132
|
+
when :install
|
133
|
+
Log.debug "Installing software: #{path}"
|
134
|
+
software_dir = path.resource.root.software.find :user
|
135
|
+
preamble = <<-EOF
|
135
136
|
#!/bin/bash
|
136
137
|
|
137
138
|
RBBT_SOFTWARE_DIR="#{software_dir}"
|
138
139
|
|
139
140
|
INSTALL_HELPER_FILE="#{Rbbt.share.install.software.lib.install_helpers.find :lib, caller_lib_dir(__FILE__)}"
|
140
141
|
source "$INSTALL_HELPER_FILE"
|
141
|
-
|
142
|
+
EOF
|
142
143
|
|
143
|
-
|
144
|
+
CMD.cmd('bash', :in => preamble + "\n" + Open.read(content))
|
144
145
|
|
145
|
-
|
146
|
-
|
147
|
-
|
146
|
+
set_software_env(software_dir)
|
147
|
+
else
|
148
|
+
raise "Could not produce #{ resource }. (#{ type }, #{ content })"
|
149
|
+
end
|
150
|
+
rescue
|
151
|
+
FileUtils.rm_rf final_path if File.exists? final_path
|
152
|
+
raise $!
|
148
153
|
end
|
149
|
-
rescue
|
150
|
-
FileUtils.rm_rf final_path if File.exists? final_path
|
151
|
-
raise $!
|
152
154
|
end
|
153
155
|
end
|
154
156
|
end
|
data/lib/rbbt/util/cmd.rb
CHANGED
@@ -41,7 +41,7 @@ module CMD
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def close
|
44
|
-
self.original_read unless self.eof?
|
44
|
+
self.original_read unless self.closed? or self.eof?
|
45
45
|
|
46
46
|
wait_and_status
|
47
47
|
|
@@ -67,9 +67,9 @@ module CMD
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def read(*args)
|
70
|
-
data = original_read(*args) unless self.eof?
|
70
|
+
data = original_read(*args) unless self.closed? or self.eof?
|
71
71
|
|
72
|
-
self.close if self.eof?
|
72
|
+
self.close if self.eof? and not self.closed?
|
73
73
|
|
74
74
|
data
|
75
75
|
end
|
data/share/unicorn.rb
CHANGED