Skip to content

Commit

Permalink
Freeze literal strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmazza committed Nov 16, 2016
1 parent 63a4eca commit c8ba3e3
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion faraday-http-cache.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# frozen_string_literal: true
Gem::Specification.new do |gem|
gem.name = 'faraday-http-cache'
gem.version = '1.3.1'
Expand Down
3 changes: 2 additions & 1 deletion lib/faraday/http_cache.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'faraday'

require 'faraday/http_cache/storage'
Expand Down Expand Up @@ -48,7 +49,7 @@ class HttpCache < Faraday::Middleware
ERROR_STATUSES = (400..499).freeze

# The name of the instrumentation event.
EVENT_NAME = 'http_cache.faraday'.freeze
EVENT_NAME = 'http_cache.faraday'

CACHE_STATUSES = [
# The request was not cacheable.
Expand Down
1 change: 1 addition & 0 deletions lib/faraday/http_cache/cache_control.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Faraday
class HttpCache < Faraday::Middleware
# Internal: A class to represent the 'Cache-Control' header options.
Expand Down
1 change: 1 addition & 0 deletions lib/faraday/http_cache/request.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Faraday
class HttpCache < Faraday::Middleware
# Internal: A class to represent a request
Expand Down
1 change: 1 addition & 0 deletions lib/faraday/http_cache/response.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'time'
require 'faraday/http_cache/cache_control'

Expand Down
1 change: 1 addition & 0 deletions lib/faraday/http_cache/storage.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'json'
require 'digest/sha1'

Expand Down
1 change: 1 addition & 0 deletions spec/binary_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache do
Expand Down
1 change: 1 addition & 0 deletions spec/cache_control_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache::CacheControl do
Expand Down
1 change: 1 addition & 0 deletions spec/http_cache_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache do
Expand Down
1 change: 1 addition & 0 deletions spec/instrumentation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
require 'active_support'
require 'active_support/notifications'
Expand Down
1 change: 1 addition & 0 deletions spec/json_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache do
Expand Down
1 change: 1 addition & 0 deletions spec/request_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache::Request do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'uri'
require 'socket'

Expand Down
3 changes: 2 additions & 1 deletion spec/storage_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache::Storage do
Expand Down Expand Up @@ -44,7 +45,7 @@

context 'when ASCII characters in response cannot be converted to UTF-8' do
let(:response) do
body = "\u2665".force_encoding('ASCII-8BIT')
body = String.new("\u2665").force_encoding('ASCII-8BIT')
double(:response, serializable_hash: { 'body' => body })
end

Expand Down
1 change: 1 addition & 0 deletions spec/support/test_app.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'sinatra/base'
require 'json'

Expand Down
1 change: 1 addition & 0 deletions spec/support/test_server.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'net/http'

class TestServer
Expand Down
1 change: 1 addition & 0 deletions spec/validation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Faraday::HttpCache do
Expand Down

0 comments on commit c8ba3e3

Please sign in to comment.