Add frozen_string_literal pragma

This will prevent the same string from being re-initialized over and over
This commit is contained in:
Dillon Welch 2018-08-10 13:10:33 -07:00
parent dcc505ce02
commit d91a98d3af
No known key found for this signature in database
GPG Key ID: 4CAB42A969203697
22 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rubygems'
require 'rake'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'benchmark'
$: << '../lib' << 'lib'

View File

@ -1,2 +1,4 @@
# frozen_string_literal: true
require 'addressable/uri'
require 'addressable/template'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# encoding:utf-8
#--
# Copyright (C) Bob Aman

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# encoding:utf-8
#--
# Copyright (C) Bob Aman

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# encoding:utf-8
#--
# Copyright (C) Bob Aman

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# encoding:utf-8
#--
# Copyright (C) Bob Aman

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# encoding:utf-8
#--
# Copyright (C) Bob Aman
@ -208,6 +210,7 @@ module Addressable
new_authority = authority.gsub(/\\/, '/').gsub(/ /, '%20')
# NOTE: We want offset 4, not 3!
offset = match.offset(4)
uri = uri.dup
uri[offset[0]...offset[1]] = new_authority
end
parsed = self.parse(uri)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# encoding:utf-8
#--
# Copyright (C) Bob Aman

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# coding: utf-8
# Copyright (C) Bob Aman
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# coding: utf-8
# Copyright (C) Bob Aman
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# coding: utf-8
# Copyright (C) Bob Aman
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# coding: utf-8
# Copyright (C) Bob Aman
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# coding: utf-8
# Copyright (C) Bob Aman
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# coding: utf-8
# Copyright (C) Bob Aman
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'bundler/setup'
require 'rspec/its'

View File

@ -1,2 +1,4 @@
# frozen_string_literal: true
desc "Remove all build products"
task "clobber"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rubygems/package_task"
namespace :gem do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
namespace :git do
namespace :tag do
desc "List tags from the Git repository"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
namespace :metrics do
task :lines do
lines, codelines, total_lines, total_codelines = 0, 0, 0, 0

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rspec/core/rake_task"
namespace :spec do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rake"
begin