class Dependencies < Hash def initialize initialize_ruby_dependencies initialize_csharp_dependencies end def initialize_ruby_dependencies ruby_deps = Array.new Dir.glob("**/*.rb").each{|f| text=File.read(f) text.scan(/require '([\w\/]+)/).each{|r| ruby_deps << r.first.to_s if !ruby_deps.include? r } } if ruby_deps.length > 0 ruby_deps = ruby_deps.sort self["ruby"]=ruby_deps end end def initialize_csharp_dependencies cs_dep_hash=Hash.new #includes = Array.new #hints = Array.new Dir.glob("**/*.csproj").each{|f| text=File.read(f) text.scan(/([\w\.\\\s]+) 0 cs_deps = cs_deps.sort self["C#"]=cs_deps end end def show self.each do |key,array| if(array.length > 0) puts key array.each {|v| puts " " + Color.green + v + Color.clear + " " } end end puts " " end end