diff --git a/lib/puppet/pops/loader/static_loader.rb b/lib/puppet/pops/loader/static_loader.rb index 04f04308b81..7e24e844c27 100644 --- a/lib/puppet/pops/loader/static_loader.rb +++ b/lib/puppet/pops/loader/static_loader.rb @@ -46,9 +46,9 @@ def initialize def discover(type, error_collector = nil, name_authority = Pcore::RUNTIME_NAME_AUTHORITY) # Static loader only contains runtime types - return EMPTY_ARRAY unless type == :type && name_authority == name_authority = Pcore::RUNTIME_NAME_AUTHORITY + return EMPTY_ARRAY unless type == :type && name_authority == Pcore::RUNTIME_NAME_AUTHORITY - typed_names = type == :type && name_authority == Pcore::RUNTIME_NAME_AUTHORITY ? @loaded.keys : EMPTY_ARRAY + typed_names = @loaded.keys block_given? ? typed_names.select { |tn| yield(tn) } : typed_names end diff --git a/lib/puppet/util/windows/com.rb b/lib/puppet/util/windows/com.rb index dd38a1de688..b26acd34c01 100644 --- a/lib/puppet/util/windows/com.rb +++ b/lib/puppet/util/windows/com.rb @@ -141,7 +141,7 @@ def initialize(pointer) self::VTBL.members.each do |name| define_method(name) do |*args| - if Puppet::Util::Windows::COM.FAILED(result = @vtbl[name].call(self, *args)) + if Puppet::Util::Windows::COM.FAILED((result = @vtbl[name].call(self, *args))) raise Puppet::Util::Windows::Error.new(_("Failed to call %{klass}::%{name} with HRESULT: %{result}.") % { klass: self, name: name, result: result }, result) end @@ -183,7 +183,7 @@ def initialize(opts = {}) self::VTBL.members.each do |name| define_method(name) do |*args| - if Puppet::Util::Windows::COM.FAILED(result = @vtbl[name].call(self, *args)) + if Puppet::Util::Windows::COM.FAILED((result = @vtbl[name].call(self, *args))) raise Puppet::Util::Windows::Error.new(_("Failed to call %{klass}::%{name} with HRESULT: %{result}.") % { klass: self, name: name, result: result }, result) end