From b1afbe3a2ff7623c9a0e8504bc85af4bd8156059 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Thu, 14 Jan 2016 16:34:08 -0600 Subject: [RuboCop] Fix Style/MutableConstant --- lib/bundler/lockfile_parser.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lib/bundler/lockfile_parser.rb') diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index f802157c..94e88dbd 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "strscan" # Some versions of the Bundler 1.1 RC series introduced corrupted @@ -14,16 +15,16 @@ module Bundler class LockfileParser attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version - BUNDLED = "BUNDLED WITH" - DEPENDENCIES = "DEPENDENCIES" - PLATFORMS = "PLATFORMS" - RUBY = "RUBY VERSION" - GIT = "GIT" - GEM = "GEM" - PATH = "PATH" - SPECS = " specs:" + BUNDLED = "BUNDLED WITH".freeze + DEPENDENCIES = "DEPENDENCIES".freeze + PLATFORMS = "PLATFORMS".freeze + RUBY = "RUBY VERSION".freeze + GIT = "GIT".freeze + GEM = "GEM".freeze + PATH = "PATH".freeze + SPECS = " specs:".freeze OPTIONS = /^ ([a-z]+): (.*)$/i - SOURCE = [GIT, GEM, PATH] + SOURCE = [GIT, GEM, PATH].freeze def initialize(lockfile) @platforms = [] @@ -89,7 +90,7 @@ module Bundler GIT => Bundler::Source::Git, GEM => Bundler::Source::Rubygems, PATH => Bundler::Source::Path, - } + }.freeze def parse_source(line) case line @@ -134,7 +135,7 @@ module Bundler end end - NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?' + NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?'.freeze NAME_VERSION_2 = /^ {2}#{NAME_VERSION}(!)?$/ NAME_VERSION_4 = /^ {4}#{NAME_VERSION}$/ NAME_VERSION_6 = /^ {6}#{NAME_VERSION}$/ -- cgit v1.2.3