lib/kde_frameworks_creator.rb in inqlude-0.11.0 vs lib/kde_frameworks_creator.rb in inqlude-0.12.0
- old
+ new
@@ -60,11 +60,11 @@
framework["link_mailing_list"] = "https://mail.kde.org/mailman/listinfo/kde-frameworks-devel"
framework["link_git_repository"] = "https://projects.kde.org/projects/frameworks/#{name}/repository"
state = nil
File.open(File.join(path,"README.md")).each_line do |line|
- if line =~ /^# (.*)/
+ if !framework["title"] && (line =~ /^# (.*) #/ || line =~ /^# (.*)/)
framework["title"] = $1
state = :parse_summary
next
elsif line =~ /^## Introduction/
framework["introduction"] = ""
@@ -85,11 +85,10 @@
end
end
if state == :parse_introduction
if line =~ /^##/
- framework["introduction"].strip!
state = nil
else
framework["introduction"] += line
end
end
@@ -119,9 +118,11 @@
end
required_fields.each do |field|
if !framework.has_key?(field) || framework[field].strip.empty?
@errors.push( { :name => name, :issue => "missing_" + field } )
+ else
+ framework[field].strip!
end
end
@frameworks[name] = framework
end