qiita.rb
product_list = []
testcode_list = []
# ファイルからclass xxを抜き出す
File.open("Program.cs").each do |paragraph|
if /class\s*\w*/ =~ paragraph then
class_list = $&.split(/\s/)
product_list.push(class_list[1])
end
end
File.open("ProgramTest.cs").each do |paragraph|
if /class\s*\w*/ =~ paragraph then
class_list = $&.split(/\s/)
testcode_list = class_list[1]
product_list.each{|t|
if t == testcode_list.gsub(/Test/, "")
print t + "\t"
print testcode_list
print "\n"
end
}
end
end