lib/artifacts.rb in dev_tasks-0.0.33 vs lib/artifacts.rb in dev_tasks-0.0.34
- old
+ new
@@ -1,36 +1,30 @@
require_relative('./dependencies.rb')
-class Artifacts < Hash
+class Artifacts < Array
def initialize
# gem, dev_tasks-0.0.7.gem
Dir.glob('*.gemspec') {|f|
spec=Gem::Specification.load(f)
- self[spec.name]="#{spec.name}-#{spec.version.to_s}.gem"
+ artifact="#{spec.name}-#{spec.version.to_s}.gem"
+ self << artifact if(!self.include?(artifact))
}
# C# dll, bin/Net4.0/QcNet.dll
Dir.glob("*.csproj").each{|p|
text = File.read(p)
# extract AssemblyName of form: <AssemblyName>MyLibrary.Test</AssemblyName>
assemblyName=text[/<AssemblyName>([\w\.]+)</,1]
outputPath=text[/Release[.\w\W]+<OutputPath>([\w\.\\]+)</,1]
if(!assemblyName.nil? && !outputPath.nil? && !assemblyName.include?("Test"))
cs_dll = "#{outputPath}\\#{assemblyName}.dll".gsub("\\\\","\\").gsub('/','\\').gsub('\\','/')
- self[assemblyName]=cs_dll
+ self << cs_dll if(!self.include?(cs_dll))
# add in file dependencies
- deps = Dependencies.get_dependencies_from_file p
- if(!deps.nil? && deps.has_key?(:file))
- deps[:file].each {|d|
-
- # d include to directory from which it was referenced, Visual Studio copies this to
- # the location of cs_dll
- cs_dll_dep=d.gsub(File.dirname(d),File.dirname(cs_dll)).gsub('\\','/')
- name=d.gsub('\\','/').split('/').last.gsub('.dll','')
- self["#{assemblyName} #{name}"] = cs_dll_dep
- }
- end
+ Dependencies.csharp_file_dependencies(File.read(p)).each{|dep|
+ cs_dll_dep=d.gsub(File.dirname(dep),File.dirname(cs_dll)).gsub('\\','/')
+ self << cs_dll_dep if(!self.include?(cs_dll_dep))
+ }
end
}
end
end
\ No newline at end of file