Skip to content

Commit 1248185

Browse files
author
Stephen von Takach
committed
update to use frozen string literal
1 parent d45bd3f commit 1248185

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ _yardoc
1818
doc/
1919

2020
Gemfile.lock
21+
22+
.DS_Store

lib/ruby-tls.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# frozen_string_literal: true
12

2-
require "ruby-tls/ssl" # Loads OpenSSL using FFI
3+
require 'ruby-tls/ssl' # Loads OpenSSL using FFI
34

45
module RubyTls
56
end

lib/ruby-tls/ssl.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'ffi'
24
require 'ffi-compiler/loader'
35
require 'thread'
@@ -289,8 +291,8 @@ def self.SSL_CTX_sess_set_cache_size(ssl_ctx, op)
289291

290292
class Context
291293
# Based on information from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
292-
CIPHERS = 'EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4'.freeze
293-
SESSION = 'ruby-tls'.freeze
294+
CIPHERS = 'EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4'
295+
SESSION = 'ruby-tls'
294296

295297

296298
ALPN_LOOKUP = ThreadSafe::Cache.new
@@ -368,7 +370,7 @@ def cleanup
368370

369371

370372
def self.build_alpn_string(protos)
371-
protocols = ''.force_encoding('ASCII-8BIT')
373+
protocols = String.new.force_encoding('ASCII-8BIT')
372374
protos.each do |prot|
373375
protocol = prot.to_s
374376
protocols << protocol.length
@@ -677,7 +679,7 @@ def put_plain_text(data)
677679
end
678680

679681

680-
CIPHER_DISPATCH_FAILED = 'Cipher text dispatch failed'.freeze
682+
CIPHER_DISPATCH_FAILED = 'Cipher text dispatch failed'
681683
def dispatch_cipher_text
682684
begin
683685
did_work = false

lib/ruby-tls/version.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RubyTls
2-
VERSION = "2.1.2"
4+
VERSION = '2.2.0'
35
end

ruby-tls.gemspec

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# frozen_string_literal: true
12
# -*- encoding: utf-8 -*-
3+
24
$:.push File.expand_path("../lib", __FILE__)
35
require "ruby-tls/version"
46

@@ -11,15 +13,15 @@ Gem::Specification.new do |s|
1113
s.homepage = "https://github.com/cotag/ruby-tls"
1214
s.summary = "Abstract TLS for Ruby"
1315
s.description = <<-EOF
14-
Allows transport layers outside Ruby TCP be secured.
16+
Allows transport layers outside Ruby TCP to be secured.
1517
EOF
1618

1719

18-
s.add_dependency 'ffi-compiler', '>= 0.0.2'
19-
s.add_dependency 'thread_safe'
20+
s.add_dependency 'ffi-compiler', '>= 1.0', '< 2.0'
21+
s.add_dependency 'concurrent-ruby', '~> 1.0'
2022

21-
s.add_development_dependency 'rspec'
22-
s.add_development_dependency 'yard'
23+
s.add_development_dependency 'rspec', '~> 3.5'
24+
s.add_development_dependency 'yard', '~> 0.9'
2325

2426

2527
s.files = Dir["{lib}/**/*"] + %w(ruby-tls.gemspec README.md)

0 commit comments

Comments
 (0)