dev 2.0.85 → 2.0.86
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dev_environment.rb +27 -0
- 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: 374ad3cc02e6af1519f1fba8f9c0ba62822a7a8a
|
4
|
+
data.tar.gz: c38ca71b9cddd388c9f73d4cb1eaeb4d6b509e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c78aa818f115212dfb862cc284b599142e721813ebb8ab89345aef37fbc9b921239cc02f91874d18a8641b809ba948592b01934331b56cea5eb3e63928fabbfa
|
7
|
+
data.tar.gz: 9298e1ca32132c3b0abac9f3531fc9edf51ee87c6c3dd38204b7d9eb8cd9c57a0ff4017a2d2f1facca386db63bc90dea1924d3265b7cd9ee75353a5055d2fd17
|
data/lib/dev_environment.rb
CHANGED
@@ -38,7 +38,11 @@ class Environment < Hash
|
|
38
38
|
dir=home
|
39
39
|
return dir
|
40
40
|
end
|
41
|
+
|
42
|
+
|
41
43
|
end
|
44
|
+
require 'fileutils'
|
45
|
+
|
42
46
|
class File
|
43
47
|
def self.amalgamate filename,source
|
44
48
|
File.open(filename,'w'){|file|
|
@@ -47,4 +51,27 @@ class File
|
|
47
51
|
}
|
48
52
|
}
|
49
53
|
end
|
54
|
+
|
55
|
+
def self.publish destination, source_dir, source_glob='**/*'
|
56
|
+
|
57
|
+
output = "\n"
|
58
|
+
# directory
|
59
|
+
FileUtils.mkdir_p destination if !File.exists? destination
|
60
|
+
|
61
|
+
files=nil
|
62
|
+
Dir.chdir(source_dir) do
|
63
|
+
files=FileList.new(source_glob).to_a
|
64
|
+
end
|
65
|
+
output = output + "\nfiles: #{files}.to_s"
|
66
|
+
|
67
|
+
Dir.chdir(source_dir) do
|
68
|
+
files.each{|f|
|
69
|
+
file="#{destination}/#{f}"
|
70
|
+
dirname=File.dirname(file)
|
71
|
+
FileUtils.mkdir_p dirname if !File.exists? dirname
|
72
|
+
FileUtils.cp(f,file) if !File.exists? file
|
73
|
+
}
|
74
|
+
end
|
75
|
+
output
|
76
|
+
end
|
50
77
|
end
|