class CsProj::Msbuild::SolutionParser

Public Class Methods

get_project_file(project_line) click to toggle source
# File lib/csproj/msbuild/solution_parser.rb, line 31
def self.get_project_file(project_line)
  project_line.split("\"")[5].tr('\\', "/")
end
get_project_name(project_line) click to toggle source
# File lib/csproj/msbuild/solution_parser.rb, line 27
def self.get_project_name(project_line)
  project_line.split("\"")[3]
end
parse(filename) click to toggle source
# File lib/csproj/msbuild/solution_parser.rb, line 6
def self.parse(filename)
  solution = Solution.new

  File.open(filename) do |f|
    f.read.split("\n").each do |line|
      if line.start_with? "Project"
        options = parse_line line
        solution.add_project Project.new(options)
      end
    end
  end

  solution
end
parse_line(line) click to toggle source
# File lib/csproj/msbuild/solution_parser.rb, line 21
def self.parse_line(line)
  name = get_project_name line
  project_file = get_project_file line
  {project_name: name, project_path: project_file}
end