Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable frozen string literals #46

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .rubocop_todo.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/hawk.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/hash/deep_merge'
require 'active_support/core_ext/object/blank'
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
##
# Represents an error.
Expand Down
4 changes: 3 additions & 1 deletion lib/hawk/http.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
require 'uri'
require 'typhoeus'
Expand All @@ -19,7 +21,7 @@ class HTTP
params_encoding: :rack
# username: nil,
# password: nil,
}
}.freeze

def initialize(base, options = {})
@defaults = DEFAULTS.deep_merge(options)
Expand Down
4 changes: 3 additions & 1 deletion lib/hawk/http/caching.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'dalli'

module Hawk
Expand All @@ -9,7 +11,7 @@ module Caching
compress: true,
expires_in: 60,
serializer: MultiJson
}
}.freeze

def initialize(*)
super
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/http/instrumentation.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'cgi'

module Hawk
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/linker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
# Allows adding to any Ruby object an accessor referencing an {Hawk::Model}.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
autoload :Base, 'hawk/model/base'
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/active.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model'

module Hawk
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/association.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Association
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
##
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/collection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
class Collection < Array
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/configurator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Configurator
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
##
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/finder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Finder
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/lookup.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Lookup
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/pagination.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Pagination
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/proxy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
class Proxy
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/querying.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Querying
Expand Down
4 changes: 3 additions & 1 deletion lib/hawk/model/schema.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Schema
Expand Down Expand Up @@ -176,7 +178,7 @@ def to_s
/_date$/ => :date,
/_num$/ => :bignum,
/^is_/ => :boolean
}
}.freeze
end
end
end
2 changes: 2 additions & 0 deletions lib/hawk/model/schema/dsl.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Schema
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/model/scoping.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Model
module Scoping
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/polyfills.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Polyfills
def self.polyfill(klass, method, &impl)
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/rake.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
##
# Namespace to all rake-related functionality.
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/rake/default_task.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Rake
##
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/rake/utils.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
module Rake
##
Expand Down
2 changes: 2 additions & 0 deletions lib/hawk/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hawk
VERSION = '2.0.0'
end
Loading