aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/lockfile_parser.rb
diff options
context:
space:
mode:
authormeganemura <mura2megane@gmail.com>2014-09-25 04:11:22 +0900
committermeganemura <mura2megane@gmail.com>2014-09-25 04:30:05 +0900
commit77e7050364367d98f9bc96911ea2769b69a4735c (patch)
treedc89a7411ca37a0b75f7db73ec75180d0e7886ee /lib/bundler/lockfile_parser.rb
parent472bd15a0ea22177da3fce1f05f34e61e89ddf07 (diff)
downloadbundler-77e7050364367d98f9bc96911ea2769b69a4735c.tar.gz
Replace strings with defined constants
Diffstat (limited to 'lib/bundler/lockfile_parser.rb')
-rw-r--r--lib/bundler/lockfile_parser.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 0511f0fc..0254a0cf 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -53,10 +53,10 @@ module Bundler
private
TYPES = {
- "GIT" => Bundler::Source::Git,
- "GEM" => Bundler::Source::Rubygems,
- "PATH" => Bundler::Source::Path,
- "SVN" => Bundler::Source::SVN
+ GIT => Bundler::Source::Git,
+ GEM => Bundler::Source::Rubygems,
+ PATH => Bundler::Source::Path,
+ SVN => Bundler::Source::SVN
}
def parse_source(line)
@@ -66,10 +66,10 @@ module Bundler
@opts, @type = {}, line
when SPECS
case @type
- when "PATH"
+ when PATH
@current_source = TYPES[@type].from_lock(@opts)
@sources << @current_source
- when "GIT", "SVN"
+ when GIT, SVN
@current_source = TYPES[@type].from_lock(@opts)
# Strip out duplicate GIT / SVN sections
if @sources.include?(@current_source)
@@ -77,7 +77,7 @@ module Bundler
else
@sources << @current_source
end
- when "GEM"
+ when GEM
Array(@opts["remote"]).each do |url|
@rubygems_aggregate.add_remote(url)
end