lib/kde_frameworks_creator.rb in inqlude-0.7.1 vs lib/kde_frameworks_creator.rb in inqlude-0.7.2
- old
+ new
@@ -18,22 +18,26 @@
attr_reader :warnings, :errors
def initialize
@frameworks = Hash.new
+ @warnings = []
+ @errors = []
end
def parse_checkout dir_name, options = {}
@warnings = []
@errors = []
Dir.entries( dir_name ).each do |entry|
next if entry =~ /^\./
next if entry == "kapidox"
next if entry == "kde4support"
+ next if !File.exist?(File.join(dir_name, entry, ".git"))
@frameworks[entry] = {}
parse_readme File.join(dir_name,entry), options
+ parse_metainfo File.join(dir_name,entry)
parse_authors File.join(dir_name,entry)
end
end
def frameworks
@@ -50,11 +54,11 @@
@errors = [] if !@errors
name = extract_name( path )
framework = @frameworks[name] || {}
- framework["link_home_page"] = "https://projects.kde.org/projects/frameworks/#{name}"
+ framework["link_home_page"] = "http://api.kde.org/frameworks-api/frameworks5-apidocs/#{name}/html/index.html"
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|
@@ -106,11 +110,11 @@
end
end
end
required_fields = []
- [ "title", "summary", "introduction", "link_home_page" ].each do |field|
+ [ "title", "introduction", "link_home_page" ].each do |field|
if !options[:ignore_errors] || !options[:ignore_errors].include?(field)
required_fields.push field
end
end
@@ -121,9 +125,28 @@
end
@frameworks[name] = framework
end
+ def parse_metainfo path
+ name = extract_name( path )
+
+ metainfo_path = File.join(path,"metainfo.yaml")
+ if ( !File.exists?( metainfo_path ) )
+ @errors.push( { :name => name, :issue => "missing_file",
+ :details => "metainfo.yaml" } )
+ return
+ end
+
+ metainfo = YAML.load_file(metainfo_path)
+
+ framework = @frameworks[name] || {}
+
+ framework["summary"] = metainfo["description"]
+
+ @frameworks[name] = framework
+ end
+
def parse_authors path
name = extract_name( path )
authors_path = File.join(path,"AUTHORS")
if ( !File.exists?( authors_path ) )