lib/autoproj/os_repository_resolver.rb in autoproj-2.14.0 vs lib/autoproj/os_repository_resolver.rb in autoproj-2.15.0
- old
+ new
@@ -1,7 +1,7 @@
-require 'tempfile'
-require 'json'
+require "tempfile"
+require "json"
module Autoproj
# Manager for OS repository provided by package sets
class OSRepositoryResolver
# All the information contained in all the OSrepos files
@@ -9,11 +9,13 @@
# The operating system
attr_accessor :operating_system
def self.load(file)
- raise ArgumentError, "no such file or directory: #{file}" unless File.file?(file)
+ unless File.file?(file)
+ raise ArgumentError, "no such file or directory: #{file}"
+ end
error_t = if defined? Psych::SyntaxError
[ArgumentError, Psych::SyntaxError]
else
ArgumentError
@@ -60,16 +62,16 @@
end
end.flatten.uniq
end
def entry_matches?(entry, identifiers)
- !(entry.keys.first.split(',').map(&:strip) & identifiers).empty?
+ !(entry.keys.first.split(",").map(&:strip) & identifiers).empty?
end
def resolved_entries
os_name, os_version = operating_system
- os_version << 'default' unless os_version.include?('default')
+ os_version << "default" unless os_version.include?("default")
distribution_filtered = definitions.select do |entry|
entry_matches?(entry, os_name)
end.map(&:values).flatten
@@ -129,9 +131,9 @@
def self.verify_type(obj, type, path = [])
return if obj.is_a?(type)
raise ArgumentError, "invalid osrepos definition in #{path.join('/')}: "\
- "expected a #{type}, found a #{obj.class}"
+ "expected a #{type}, found a #{obj.class}"
end
end
end