Skip to content

Commit

Permalink
Add frozen_string_literal to CompositeIO and Multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
allan-pires committed Apr 10, 2024
1 parent 6e8fb4d commit af528e4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion google-apis-core/lib/google/apis/core/composite_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# frozen_string_literal: true

require 'google/apis/core/http_command'
require 'google/apis/core/upload'
require 'google/apis/core/download'
Expand All @@ -42,7 +44,7 @@ def initialize(*ios)
end

def read(length = nil, buf = nil)
buf = buf ? buf.replace('') : ''
buf = buf ? buf.replace('') : +''

begin
io = @ios[@index]
Expand Down
5 changes: 3 additions & 2 deletions google-apis-core/lib/google/apis/core/multipart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# frozen_string_literal: true

module Google
module Apis
Expand All @@ -31,7 +32,7 @@ def initialize(value, header = {})
end

def to_io(boundary)
part = ''
part = +''
part << "--#{boundary}\r\n"
part << "Content-Type: application/json\r\n"
@header.each do |(k, v)|
Expand Down Expand Up @@ -59,7 +60,7 @@ def initialize(io, header = {})
end

def to_io(boundary)
head = ''
head = +''
head << "--#{boundary}\r\n"
@header.each do |(k, v)|
head << "#{k}: #{v}\r\n"
Expand Down
2 changes: 2 additions & 0 deletions google-apis-core/spec/google/apis/core/batch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# frozen_string_literal: true

require 'spec_helper'
require 'google/apis/core/batch'
require 'google/apis/core/json_representation'
Expand Down
2 changes: 2 additions & 0 deletions google-apis-core/spec/google/apis/core/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# frozen_string_literal: true

require 'spec_helper'
require 'google/apis/options'
require 'google/apis/core/base_service'
Expand Down
2 changes: 2 additions & 0 deletions google-apis-core/spec/google/apis/core/upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# frozen_string_literal: true

require 'spec_helper'
require 'google/apis/core/upload'
require 'google/apis/core/json_representation'
Expand Down

0 comments on commit af528e4

Please sign in to comment.