lib/logirel/templates/utils.tt in logirel-0.1.4 vs lib/logirel/templates/utils.tt in logirel-0.1.5
- old
+ new
@@ -10,15 +10,27 @@
commit_date = Time.new.strftime("%Y-%m-%d %H%M%S")
end
[commit, commit_date]
end
+ # copy from the key's data using the glob pattern
+def nuspec_copy(key, glob)
+ puts "key: #{key}, glob: #{glob}, proj dir: #{PROJECTS[key][:dir]}"
+ FileList[File.join(FOLDERS[:binaries], PROJECTS[key][:dir], glob)].collect{ |f|
+ to = File.join( FOLDERS[:"#{key}"][:nuspec], "lib", FRAMEWORK )
+ FileUtils.mkdir_p to
+ cp f, to
+ # return the file name and its extension:
+ File.join(FRAMEWORK, File.basename(f))
+ }
+end
def copy_files(from_dir, file_pattern, out_dir)
- FileUtils.mkdir_p out_dir unless FileTest.exists?(out_dir)
- Dir.glob(File.join(from_dir, file_pattern)){|file|
- copy(file, out_dir) if File.file?(file)
- }
+ puts "copying from #{out_dir}"
+ FileUtils.mkdir_p out_dir unless FileTest.exists?(out_dir)
+ Dir.glob(File.join(from_dir, file_pattern)){|file|
+ copy(file, out_dir) if File.file?(file)
+ }
end
def versions(str)
str.split(/\r\n|\n/).map{|s|version(s)}.compact.sort
end
\ No newline at end of file