lib/zypper/onlinesearch/release.rb in zypper-onlinesearch-1.0.0 vs lib/zypper/onlinesearch/release.rb in zypper-onlinesearch-1.1.0
- old
+ new
@@ -1,42 +1,43 @@
-require 'iniparse'
+# frozen_string_literal: true
+require "iniparse"
+
module Zypper
module Onlinesearch
-
+ #
+ # Current release classification.
+ #
class Release
-
-
- def initialize()
- @filename = File.exist?('/etc/SuSE-release') ? '/etc/SuSE-release' : '/etc/os-release'
+ def initialize
+ @filename = File.exist?("/etc/SuSE-release") ? "/etc/SuSE-release" : "/etc/os-release"
@ini = IniParse.parse(File.read(@filename))
end
def name
- ini['NAME'].delete('"')
+ ini["NAME"].delete('"')
end
def version
- ini['VERSION'].delete('"')
+ ini["VERSION"].delete('"')
end
def id
- ini['ID'].delete('"')
+ ini["ID"].delete('"')
end
def pretty_name
- ini['PRETTY_NAME'].delete('"')
+ ini["PRETTY_NAME"].delete('"')
end
def arch
`uname -i`.strip.chomp.to_sym
end
private
def ini
- @ini['__anonymous__']
+ @ini["__anonymous__"]
end
end
-
end
end