From 9a9b3f9387ad9a7ebed6c14ea4ae9a7f8f975fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A9=20Dupuis?= Date: Thu, 31 Oct 2024 17:13:26 -0700 Subject: [PATCH] Lint --- lib/azure_blob/client.rb | 2 +- lib/azure_blob/tags.rb | 14 +++++++------- test/client/test_client.rb | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/azure_blob/client.rb b/lib/azure_blob/client.rb index a3efc21..e89cf7c 100644 --- a/lib/azure_blob/client.rb +++ b/lib/azure_blob/client.rb @@ -29,7 +29,7 @@ def initialize(account_name:, access_key: nil, principal_id: nil, container:, ** ) end @signer = using_managed_identities ? - AzureBlob::EntraIdSigner.new(account_name:, host:, principal_id: ) : + AzureBlob::EntraIdSigner.new(account_name:, host:, principal_id:) : AzureBlob::SharedKeySigner.new(account_name:, access_key:) end diff --git a/lib/azure_blob/tags.rb b/lib/azure_blob/tags.rb index a85b87e..f5c22ef 100644 --- a/lib/azure_blob/tags.rb +++ b/lib/azure_blob/tags.rb @@ -1,13 +1,13 @@ -require 'rexml/document' +require "rexml/document" module AzureBlob class Tags # :nodoc: - def self.from_response response + def self.from_response(response) document = REXML::Document.new(response) tags = {} - document.elements.each('Tags/TagSet/Tag') do |tag| - key = tag.elements['Key'].text - value = tag.elements['Value'].text + document.elements.each("Tags/TagSet/Tag") do |tag| + key = tag.elements["Key"].text + value = tag.elements["Value"].text tags[key] = value end new(tags) @@ -23,8 +23,8 @@ def headers { "x-ms-tags": @tags.map do |key, value| - %{#{key}=#{value}} - end.join("&") + %(#{key}=#{value}) + end.join("&"), } end diff --git a/test/client/test_client.rb b/test/client/test_client.rb index 0eb1b62..89ea6de 100644 --- a/test/client/test_client.rb +++ b/test/client/test_client.rb @@ -352,10 +352,10 @@ def test_create_container end def test_get_blob_tags - client.create_block_blob(key, content, tags: { tag1: "value 1", "tag 2": "value 2"}) + client.create_block_blob(key, content, tags: { tag1: "value 1", "tag 2": "value 2" }) tags = client.get_blob_tags(key) - assert_equal({"tag1" => "value 1", "tag 2" => "value 2"}, tags) + assert_equal({ "tag1" => "value 1", "tag 2" => "value 2" }, tags) end end