diff --git a/Gemfile b/Gemfile index dc0cc53..fa6a9aa 100755 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #------------------------------------------------------------------------- # # Copyright (c) Microsoft and contributors. All rights reserved. # @@ -13,4 +15,4 @@ # limitations under the License. #-------------------------------------------------------------------------- source 'https://rubygems.org' -gemspec \ No newline at end of file +gemspec diff --git a/Rakefile b/Rakefile index 44e012f..dbfc2b8 100755 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #------------------------------------------------------------------------- # # Copyright (c) Microsoft and contributors. All rights reserved. # @@ -22,11 +24,10 @@ Gem::PackageTask.new(gem_spec) do |pkg| end namespace :test do - Rake::TestTask.new :unit do |t| t.pattern = 'test/unit/**/*_test.rb' t.verbose = true - t.libs = %w(lib test) + t.libs = %w[lib test] end namespace :unit do @@ -34,15 +35,14 @@ namespace :test do Rake::TestTask.new component do |t| t.pattern = "test/unit/#{component}/**/*_test.rb" t.verbose = true - t.libs = %w(lib test) + t.libs = %w[lib test] end end component_task :core end - end -task :test => %w(test:unit) +task test: %w[test:unit] -task :default => :test +task default: :test diff --git a/azure-core.gemspec b/azure-core.gemspec index 60d4c53..180425b 100755 --- a/azure-core.gemspec +++ b/azure-core.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #------------------------------------------------------------------------- # # Copyright (c) Microsoft and contributors. All rights reserved. # @@ -14,7 +16,7 @@ #-------------------------------------------------------------------------- require 'date' -require File.expand_path('../lib/azure/core/version', __FILE__) +require File.expand_path('lib/azure/core/version', __dir__) Gem::Specification.new do |s| s.name = 'azure-core' @@ -25,7 +27,7 @@ Gem::Specification.new do |s| s.summary = 'Core library to be consumed by Ruby SDK gems' s.homepage = 'http://github.com/Azure/azure-ruby-asm-core' s.license = 'Apache License, Version 2.0' - s.files = `git ls-files`.split("\n").reject { |f| f.start_with?("test/unit") } + s.files = `git ls-files`.split("\n").reject { |f| f.start_with?('test/unit') } s.required_ruby_version = '>= 1.9.3' @@ -33,12 +35,11 @@ Gem::Specification.new do |s| s.add_runtime_dependency('faraday_middleware', '~> 0.10') s.add_runtime_dependency('nokogiri', '~> 1.6') + s.add_development_dependency('bundler', '~> 1.11') s.add_development_dependency('dotenv', '~> 2.0') s.add_development_dependency('minitest', '~> 5') s.add_development_dependency('minitest-reporters', '~> 1') s.add_development_dependency('mocha', '~> 1.0') s.add_development_dependency('rake', '~> 10.0') s.add_development_dependency('timecop', '~> 0.7') - s.add_development_dependency('bundler', '~> 1.11') - end diff --git a/lib/azure/core/auth/signer.rb b/lib/azure/core/auth/signer.rb index fab6c16..89ccbcd 100755 --- a/lib/azure/core/auth/signer.rb +++ b/lib/azure/core/auth/signer.rb @@ -31,8 +31,7 @@ def initialize(access_key) if access_key.nil? raise ArgumentError, 'Signing key must be provided' end - - @access_key = Base64.strict_decode64(access_key) + @access_key = Base64.decode64(access_key) end # Generate an HMAC signature.