diff --git a/Gemfile b/Gemfile index cc91aef..0350b57 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" gemspec diff --git a/Rakefile b/Rakefile index 3cc7987..24e7bde 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2015 SUSE LLC # This library is free software; you can redistribute it and/or modify diff --git a/lib/libyui/rake.rb b/lib/libyui/rake.rb index ff5e29e..6809278 100644 --- a/lib/libyui/rake.rb +++ b/lib/libyui/rake.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2015 SUSE LLC # This library is free software; you can redistribute it and/or modify @@ -23,7 +25,7 @@ include Libyui::Tasks::Helpers # read package name from spec file name because CWD can have a -branch suffix - main_spec = Dir.glob("package/*.spec").sort.last + main_spec = Dir.glob("package/*.spec").max conf.package_name = main_spec[/package\/(.*)\.spec$/, 1] conf.version = cmake_version diff --git a/lib/libyui/tasks.rb b/lib/libyui/tasks.rb index 0c2c791..2cac04c 100644 --- a/lib/libyui/tasks.rb +++ b/lib/libyui/tasks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2015-2021 SUSE LLC # This library is free software; you can redistribute it and/or modify @@ -19,7 +21,7 @@ module Libyui # Facilities to write Libyui related rake tasks. module Tasks # Name of the CMake version file - VERSION_CMAKE = "VERSION.cmake".freeze + VERSION_CMAKE = "VERSION.cmake" # Targets definition TARGETS_FILE = File.expand_path("../../data/targets.yml", __dir__) @@ -145,7 +147,7 @@ def bump_spec_so_version(filename = nil) # @param filename [String, nil] if nil, it uses the shortest spec filename # @return [String] def spec_filename(filename) - filename || Dir.glob("package/*.spec").sort.first + filename || Dir.glob("package/*.spec").min end end end diff --git a/lib/tasks/so_version.rake b/lib/tasks/so_version.rake index 2f34244..2dbe0f4 100644 --- a/lib/tasks/so_version.rake +++ b/lib/tasks/so_version.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2021 SUSE LLC # This library is free software; you can redistribute it and/or modify @@ -24,7 +26,7 @@ namespace :so_version do filenames = Dir.glob("package/*.spec").sort filenames.reject! { |f| spec_so_version(f).nil? } - mismatches = filenames.select { |f| spec_so_version(f) != so_version } + mismatches = filenames.reject { |f| spec_so_version(f) == so_version } if mismatches.any? messages = ["so version mismatch:"] diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 3d339a4..6a7b57a 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2015 SUSE LLC # This library is free software; you can redistribute it and/or modify diff --git a/lib/tasks/version.rake b/lib/tasks/version.rake index a8a8a3c..ac26b59 100644 --- a/lib/tasks/version.rake +++ b/lib/tasks/version.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2015 SUSE LLC # This library is free software; you can redistribute it and/or modify diff --git a/libyui-rake.gemspec b/libyui-rake.gemspec index b678775..d904f34 100644 --- a/libyui-rake.gemspec +++ b/libyui-rake.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- # Copyright (C) 2015 SUSE LLC # This library is free software; you can redistribute it and/or modify