From 9ebb4371de43e60f36a457bed2dbbeaf9982d445 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 24 Apr 2018 15:24:37 +1000 Subject: [PATCH] Adds frozen_string_literal magic comment. This should help reduce the memory footprint of the gem as reported in #396. --- lib/rack/twilio_webhook_authentication.rb | 2 ++ lib/twilio-ruby.rb | 2 ++ lib/twilio-ruby/framework/domain.rb | 2 ++ lib/twilio-ruby/framework/error.rb | 2 ++ lib/twilio-ruby/framework/helper.rb | 2 ++ lib/twilio-ruby/framework/obsolete_client.rb | 2 ++ lib/twilio-ruby/framework/page.rb | 2 ++ lib/twilio-ruby/framework/request.rb | 2 ++ lib/twilio-ruby/framework/resource.rb | 2 ++ lib/twilio-ruby/framework/response.rb | 2 ++ lib/twilio-ruby/framework/serialize.rb | 2 ++ lib/twilio-ruby/framework/twilio_response.rb | 2 ++ lib/twilio-ruby/framework/values.rb | 2 ++ lib/twilio-ruby/framework/version.rb | 2 ++ lib/twilio-ruby/http/http_client.rb | 2 ++ lib/twilio-ruby/jwt/access_token.rb | 2 ++ lib/twilio-ruby/jwt/client_capability.rb | 2 ++ lib/twilio-ruby/jwt/jwt.rb | 2 ++ lib/twilio-ruby/jwt/task_router.rb | 2 ++ lib/twilio-ruby/security/request_validator.rb | 2 ++ lib/twilio-ruby/util.rb | 2 ++ lib/twilio-ruby/util/configuration.rb | 2 ++ lib/twilio-ruby/version.rb | 2 ++ 23 files changed, 46 insertions(+) diff --git a/lib/rack/twilio_webhook_authentication.rb b/lib/rack/twilio_webhook_authentication.rb index 850b65cf7..5df26ff80 100644 --- a/lib/rack/twilio_webhook_authentication.rb +++ b/lib/rack/twilio_webhook_authentication.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack # Middleware that authenticates webhooks from Twilio using the request # validator. diff --git a/lib/twilio-ruby.rb b/lib/twilio-ruby.rb index 9e38ee8a1..0477af3d0 100644 --- a/lib/twilio-ruby.rb +++ b/lib/twilio-ruby.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'net/http' require 'net/https' require 'nokogiri' diff --git a/lib/twilio-ruby/framework/domain.rb b/lib/twilio-ruby/framework/domain.rb index 5de49fbcd..4c82631f5 100644 --- a/lib/twilio-ruby/framework/domain.rb +++ b/lib/twilio-ruby/framework/domain.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST class Domain diff --git a/lib/twilio-ruby/framework/error.rb b/lib/twilio-ruby/framework/error.rb index 164ea8b05..9bfd0400b 100644 --- a/lib/twilio-ruby/framework/error.rb +++ b/lib/twilio-ruby/framework/error.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST class TwilioError < StandardError diff --git a/lib/twilio-ruby/framework/helper.rb b/lib/twilio-ruby/framework/helper.rb index 60f073a83..9de240675 100644 --- a/lib/twilio-ruby/framework/helper.rb +++ b/lib/twilio-ruby/framework/helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST def url_join(left, right) diff --git a/lib/twilio-ruby/framework/obsolete_client.rb b/lib/twilio-ruby/framework/obsolete_client.rb index eba0fbd22..d40821a40 100644 --- a/lib/twilio-ruby/framework/obsolete_client.rb +++ b/lib/twilio-ruby/framework/obsolete_client.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST class ObsoleteClient diff --git a/lib/twilio-ruby/framework/page.rb b/lib/twilio-ruby/framework/page.rb index 8e3669b00..e3212314a 100644 --- a/lib/twilio-ruby/framework/page.rb +++ b/lib/twilio-ruby/framework/page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST # Page Base Class diff --git a/lib/twilio-ruby/framework/request.rb b/lib/twilio-ruby/framework/request.rb index 3731e4556..22294fd20 100644 --- a/lib/twilio-ruby/framework/request.rb +++ b/lib/twilio-ruby/framework/request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio class Request attr_reader :host, :port, :method, :url, :params, :data, :headers, :auth, :timeout diff --git a/lib/twilio-ruby/framework/resource.rb b/lib/twilio-ruby/framework/resource.rb index 83f534827..320e42e4f 100644 --- a/lib/twilio-ruby/framework/resource.rb +++ b/lib/twilio-ruby/framework/resource.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST class ListResource diff --git a/lib/twilio-ruby/framework/response.rb b/lib/twilio-ruby/framework/response.rb index 848e8b282..e2e4023ef 100644 --- a/lib/twilio-ruby/framework/response.rb +++ b/lib/twilio-ruby/framework/response.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio class Response attr_accessor :status_code, :body, :headers diff --git a/lib/twilio-ruby/framework/serialize.rb b/lib/twilio-ruby/framework/serialize.rb index 4916008df..ff00e71da 100644 --- a/lib/twilio-ruby/framework/serialize.rb +++ b/lib/twilio-ruby/framework/serialize.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio def self.serialize_iso8601_date(date) if date.eql?(:unset) diff --git a/lib/twilio-ruby/framework/twilio_response.rb b/lib/twilio-ruby/framework/twilio_response.rb index 54d301ff6..04227ad5c 100644 --- a/lib/twilio-ruby/framework/twilio_response.rb +++ b/lib/twilio-ruby/framework/twilio_response.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio class TwilioResponse attr_accessor :status_code, :body diff --git a/lib/twilio-ruby/framework/values.rb b/lib/twilio-ruby/framework/values.rb index 5446aadb0..cb7d4c858 100644 --- a/lib/twilio-ruby/framework/values.rb +++ b/lib/twilio-ruby/framework/values.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio class Values def self.of(hash) diff --git a/lib/twilio-ruby/framework/version.rb b/lib/twilio-ruby/framework/version.rb index d0eee2c76..2debf6bcc 100644 --- a/lib/twilio-ruby/framework/version.rb +++ b/lib/twilio-ruby/framework/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module REST class Version diff --git a/lib/twilio-ruby/http/http_client.rb b/lib/twilio-ruby/http/http_client.rb index ca7b59363..a35d74aeb 100644 --- a/lib/twilio-ruby/http/http_client.rb +++ b/lib/twilio-ruby/http/http_client.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'faraday' module Twilio diff --git a/lib/twilio-ruby/jwt/access_token.rb b/lib/twilio-ruby/jwt/access_token.rb index c90486d42..e38a0b774 100644 --- a/lib/twilio-ruby/jwt/access_token.rb +++ b/lib/twilio-ruby/jwt/access_token.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module JWT module AccessTokenGrant diff --git a/lib/twilio-ruby/jwt/client_capability.rb b/lib/twilio-ruby/jwt/client_capability.rb index a58c4ce35..ccac0d33c 100644 --- a/lib/twilio-ruby/jwt/client_capability.rb +++ b/lib/twilio-ruby/jwt/client_capability.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module JWT module Scope diff --git a/lib/twilio-ruby/jwt/jwt.rb b/lib/twilio-ruby/jwt/jwt.rb index b59316513..43cb22906 100644 --- a/lib/twilio-ruby/jwt/jwt.rb +++ b/lib/twilio-ruby/jwt/jwt.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module JWT class BaseJWT diff --git a/lib/twilio-ruby/jwt/task_router.rb b/lib/twilio-ruby/jwt/task_router.rb index 012a4c2f3..e3638a4cf 100644 --- a/lib/twilio-ruby/jwt/task_router.rb +++ b/lib/twilio-ruby/jwt/task_router.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module JWT class TaskRouterCapability < BaseJWT diff --git a/lib/twilio-ruby/security/request_validator.rb b/lib/twilio-ruby/security/request_validator.rb index d32fbf699..3a13b20a7 100644 --- a/lib/twilio-ruby/security/request_validator.rb +++ b/lib/twilio-ruby/security/request_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module Security class RequestValidator diff --git a/lib/twilio-ruby/util.rb b/lib/twilio-ruby/util.rb index 155062ea3..26bc01d83 100644 --- a/lib/twilio-ruby/util.rb +++ b/lib/twilio-ruby/util.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module Util def url_encode(hash) diff --git a/lib/twilio-ruby/util/configuration.rb b/lib/twilio-ruby/util/configuration.rb index b84ae1ae4..963a11bab 100644 --- a/lib/twilio-ruby/util/configuration.rb +++ b/lib/twilio-ruby/util/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio module Util class Configuration diff --git a/lib/twilio-ruby/version.rb b/lib/twilio-ruby/version.rb index 309c689a8..c28e2e61a 100644 --- a/lib/twilio-ruby/version.rb +++ b/lib/twilio-ruby/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twilio VERSION = '5.8.1' end