Skip to content

Commit d03aae7

Browse files
p-mongop
andauthored
Use frozen strings by default
(#2202) * Use frozen strings by default * remove duplicated comments Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com>
1 parent ab72078 commit d03aae7

File tree

864 files changed

+2600
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

864 files changed

+2600
-17
lines changed

examples/aggregate.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Group documents by field and calculate count.
25

36
coll = client[:restaurants]

examples/create.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Insert a document
25

36
require 'date'

examples/delete.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Delete all documents matching a condition
25

36
client[:restaurants].find('borough' => 'Manhattan').delete_many

examples/index.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Create a single field index
25

36
result = client[:restaurants].indexes.create_one(cuisine: Mongo::Index::ASCENDING)

examples/query.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Query for all documents in a collection
25

36
cursor = client[:restaurants].find

examples/update.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Update top-level fields in a single document
25

36
client[:restaurants].find(name: 'Juni').update_one('$set'=> { 'cuisine' => 'American (New)' },

gemfiles/standard.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
def standard_dependencies
25
gem 'yard'
36
gem 'ffi'

lib/mongo.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/active_support.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2019-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/address.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the 'License');

lib/mongo/address/ipv4.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the 'License');

lib/mongo/address/ipv6.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the 'License');

lib/mongo/address/unix.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the 'License');

lib/mongo/address/validator.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2017-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the 'License');

lib/mongo/auth.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/aws.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/aws/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/aws/credentials_retriever.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/aws/request.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/base.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/conversation_base.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/cr.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/cr/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/credential_cache.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2019-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/gssapi.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB, Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/gssapi/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/ldap.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/ldap/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/roles.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/sasl_conversation_base.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/scram.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/scram/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/scram256.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/scram256/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/scram_conversation_base.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/stringprep.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2018-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -59,7 +62,7 @@ def prepare(data, mappings, prohibited, options = {})
5962
private
6063

6164
def apply_maps(data, mappings)
62-
data.each_char.inject('') do |out, c|
65+
data.each_char.inject(+'') do |out, c|
6366
out << mapping(c.ord, mappings)
6467
end
6568
end

lib/mongo/auth/stringprep/profiles/sasl.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2018-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/stringprep/tables.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2018-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/stringprep/unicode_normalize/normalize.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# coding: utf-8
2-
# frozen_string_literal: false
1+
# frozen_string_literal: true
2+
# encoding: utf-8
33

44
# Copyright Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp)
55

lib/mongo/auth/stringprep/unicode_normalize/tables.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# coding: us-ascii
21
# frozen_string_literal: true
2+
# encoding: us-ascii
33

44
# automatically generated by template/unicode_norm_gen.tmpl
55

lib/mongo/auth/user.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/user/view.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/x509.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/auth/x509/conversation.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/background_thread.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2019-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bson.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2014-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/combineable.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/ordered_combiner.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/result.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/result_combiner.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/transformable.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/unordered_combiner.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/bulk_write/validatable.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2015-2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

lib/mongo/caching_cursor.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# frozen_string_literal: true
2+
# encoding: utf-8
3+
14
# Copyright (C) 2020 MongoDB Inc.
25
#
36
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)