diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-14 16:34:08 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 22:21:13 -0600 |
commit | b1afbe3a2ff7623c9a0e8504bc85af4bd8156059 (patch) | |
tree | 832de2112b4c7a44d081302eec030c74448c3712 /lib/bundler/lockfile_parser.rb | |
parent | 8b64c9785abfcdafe1e8420f61d51e924ba434a1 (diff) | |
download | bundler-b1afbe3a2ff7623c9a0e8504bc85af4bd8156059.tar.gz |
[RuboCop] Fix Style/MutableConstant
Diffstat (limited to 'lib/bundler/lockfile_parser.rb')
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 23 |
1 files changed, 12 insertions, 11 deletions
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}$/ |