rbbt-util 5.5.20 → 5.5.21
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.
- checksums.yaml +8 -8
- data/lib/rbbt/resource.rb +14 -0
- data/lib/rbbt/resource/path.rb +6 -1
- data/lib/rbbt/util/misc.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzhkZWMyMDBkOGM4OWUxODM3N2MzY2MwZTEwNjkyZTMxOTUxODRlZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWNiNmUwNzliZGE3ZDllOGZhZjM0NzExNTVmZjdhNjY0ZDdiY2UzZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODNiN2M4NDA2OWMyOGEzZTcwZmZhMTMxYjU2MjczNDI2ZWRiMjUwMTgxMmY5
|
10
|
+
NjliZjM1OTM4ZmRiMzQxN2JjYTBhZjQ3YzA4NDE3NmU0NGEwZDQ0ZDE3NzBi
|
11
|
+
MmE5ZTIxNWNkOTY3NDMxYmUzYjNlZmRmNWUwYzc5M2MzZGVlNDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTYzZTc1MDEyMWU4YTBlZDA2MDM3NjFkNWNiMGU4ZWRlZmFkYjMzN2Y0MzJh
|
14
|
+
ZWEwYjg2OWYzZDQxZjdiYjQyZGM3OGQzZDVlZjljOGIyZWZiYzYwY2JlNzNl
|
15
|
+
MmQwNWNlZmZjYmI2NjIwNjg4ZjljOTRjYzhlZGIxODU4ZjgxNDA=
|
data/lib/rbbt/resource.rb
CHANGED
@@ -57,6 +57,20 @@ module Resource
|
|
57
57
|
url = File.join(remote_server, '/resource/', self.to_s, 'get_file')
|
58
58
|
url << "?" << Misc.hash2GET_params(:file => path, :create => false)
|
59
59
|
begin
|
60
|
+
response = Net::HTTP.get_response(URI(url))
|
61
|
+
|
62
|
+
case response
|
63
|
+
when Net::HTTPSuccess then
|
64
|
+
Open.write(final_path, response.body)
|
65
|
+
when Net::HTTPRedirection then
|
66
|
+
location = response['location']
|
67
|
+
Log.debug("Feching directory from: #{location}. Into: #{final_path}")
|
68
|
+
Misc.in_dir final_path do
|
69
|
+
CMD.cmd('tar xvfz -', :in => Open.open(location))
|
70
|
+
end
|
71
|
+
else
|
72
|
+
raise "Response not understood: #{response.inspect}"
|
73
|
+
end
|
60
74
|
Open.write(final_path, Open.read(url, :nocache => true))
|
61
75
|
return true
|
62
76
|
rescue
|
data/lib/rbbt/resource/path.rb
CHANGED
@@ -27,8 +27,13 @@ module Path
|
|
27
27
|
Path.setup File.dirname(self), @pkgdir, @resource
|
28
28
|
end
|
29
29
|
|
30
|
+
def directory?
|
31
|
+
return nil unless self.exists?
|
32
|
+
File.directory? self.find
|
33
|
+
end
|
34
|
+
|
30
35
|
def glob(pattern = '*')
|
31
|
-
exp = File.join(self.
|
36
|
+
exp = File.join(self.produce, pattern)
|
32
37
|
Dir.glob(exp).collect{|f| Path.setup(f, self.resource, self.pkgdir)}
|
33
38
|
end
|
34
39
|
|
data/lib/rbbt/util/misc.rb
CHANGED