aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-02-01 21:30:42 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-02-06 12:21:06 +1300
commitbc503968b208c3b3f8e76d9aa8c6b285963c5ad2 (patch)
treeed5c1ee602bed6eea5447fe501920acc899b5f03 /lib
parent282666c7959d73b21d0d69c5cce671358c142fd5 (diff)
downloadruby-openssl-bc503968b208c3b3f8e76d9aa8c6b285963c5ad2.tar.gz
Prefer `frozen_string_literal: true`.
Diffstat (limited to 'lib')
-rw-r--r--lib/openssl.rb2
-rw-r--r--lib/openssl/bn.rb2
-rw-r--r--lib/openssl/buffering.rb10
-rw-r--r--lib/openssl/cipher.rb2
-rw-r--r--lib/openssl/config.rb7
-rw-r--r--lib/openssl/digest.rb2
-rw-r--r--lib/openssl/pkcs5.rb2
-rw-r--r--lib/openssl/pkey.rb2
-rw-r--r--lib/openssl/ssl.rb2
-rw-r--r--lib/openssl/x509.rb2
10 files changed, 16 insertions, 17 deletions
diff --git a/lib/openssl.rb b/lib/openssl.rb
index 1dd5faa7..7ba2229a 100644
--- a/lib/openssl.rb
+++ b/lib/openssl.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
=begin
= Info
'OpenSSL for Ruby 2' project
diff --git a/lib/openssl/bn.rb b/lib/openssl/bn.rb
index 8d1ebefb..0a5e11b4 100644
--- a/lib/openssl/bn.rb
+++ b/lib/openssl/bn.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
#
# = Ruby-space definitions that completes C-space funcs for BN
diff --git a/lib/openssl/buffering.rb b/lib/openssl/buffering.rb
index 5d1586e5..5d0ed3b6 100644
--- a/lib/openssl/buffering.rb
+++ b/lib/openssl/buffering.rb
@@ -1,5 +1,5 @@
# coding: binary
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
#= Info
# 'OpenSSL for Ruby 2' project
@@ -40,7 +40,7 @@ module OpenSSL::Buffering
def initialize(*)
super
@eof = false
- @rbuffer = ""
+ @rbuffer = String.new
@sync = @io.sync
end
@@ -312,7 +312,7 @@ module OpenSSL::Buffering
# buffer is flushed to the underlying socket.
def do_write(s)
- @wbuffer = "" unless defined? @wbuffer
+ @wbuffer = String.new unless defined? @wbuffer
@wbuffer << s
@wbuffer.force_encoding(Encoding::BINARY)
@sync ||= false
@@ -398,7 +398,7 @@ module OpenSSL::Buffering
# See IO#puts for full details.
def puts(*args)
- s = ""
+ s = String.new
if args.empty?
s << "\n"
end
@@ -416,7 +416,7 @@ module OpenSSL::Buffering
# See IO#print for full details.
def print(*args)
- s = ""
+ s = String.new
args.each{ |arg| s << arg.to_s }
do_write(s)
nil
diff --git a/lib/openssl/cipher.rb b/lib/openssl/cipher.rb
index af721b3a..8ad8c35d 100644
--- a/lib/openssl/cipher.rb
+++ b/lib/openssl/cipher.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
# = Ruby-space predefined Cipher subclasses
#
diff --git a/lib/openssl/config.rb b/lib/openssl/config.rb
index 48d8be00..ef83c57b 100644
--- a/lib/openssl/config.rb
+++ b/lib/openssl/config.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
=begin
= Ruby-space definitions that completes C-space funcs for Config
@@ -53,9 +53,8 @@ module OpenSSL
def parse_config(io)
begin
parse_config_lines(io)
- rescue ConfigError => e
- e.message.replace("error in line #{io.lineno}: " + e.message)
- raise
+ rescue => error
+ raise ConfigError, "error in line #{io.lineno}: " + error.message
end
end
diff --git a/lib/openssl/digest.rb b/lib/openssl/digest.rb
index 810c2ebe..c9539119 100644
--- a/lib/openssl/digest.rb
+++ b/lib/openssl/digest.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
# = Ruby-space predefined Digest subclasses
#
diff --git a/lib/openssl/pkcs5.rb b/lib/openssl/pkcs5.rb
index 959447df..8dedc4be 100644
--- a/lib/openssl/pkcs5.rb
+++ b/lib/openssl/pkcs5.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
# Ruby/OpenSSL Project
# Copyright (C) 2017 Ruby/OpenSSL Project Authors
diff --git a/lib/openssl/pkey.rb b/lib/openssl/pkey.rb
index 8a547c34..ecb112f7 100644
--- a/lib/openssl/pkey.rb
+++ b/lib/openssl/pkey.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
# Ruby/OpenSSL Project
# Copyright (C) 2017 Ruby/OpenSSL Project Authors
diff --git a/lib/openssl/ssl.rb b/lib/openssl/ssl.rb
index 96fad7c4..8554ada0 100644
--- a/lib/openssl/ssl.rb
+++ b/lib/openssl/ssl.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
=begin
= Info
'OpenSSL for Ruby 2' project
diff --git a/lib/openssl/x509.rb b/lib/openssl/x509.rb
index aa29fbe5..1d2a5aac 100644
--- a/lib/openssl/x509.rb
+++ b/lib/openssl/x509.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#--
# = Ruby-space definitions that completes C-space funcs for X509 and subclasses
#