Flowdock
method

parse_source

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: LockfileParser
  • 1_8_6_287
  • 1_8_7_72
  • 1_8_7_330
  • 1_9_1_378
  • 1_9_2_180
  • 1_9_3_125
  • 1_9_3_392
  • 2_1_10
  • 2_2_9
  • 2_4_6
  • 2_5_5
  • 2_6_3 (0)
  • What's this?
parse_source(line) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/bundler/lockfile_parser.rb, line 128
    def parse_source(line)
      case line
      when SPECS
        case @type
        when PATH
          @current_source = TYPES[@type].from_lock(@opts)
          @sources << @current_source
        when GIT
          @current_source = TYPES[@type].from_lock(@opts)
          # Strip out duplicate GIT sections
          if @sources.include?(@current_source)
            @current_source = @sources.find {|s| s == @current_source }
          else
            @sources << @current_source
          end
        when GEM
          if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
            @opts["remotes"] = @opts.delete("remote")
            @current_source = TYPES[@type].from_lock(@opts)
            @sources << @current_source
          else
            Array(@opts["remote"]).each do |url|
              @rubygems_aggregate.add_remote(url)
            end
            @current_source = @rubygems_aggregate
          end
        when PLUGIN
          @current_source = Plugin.source_from_lock(@opts)
          @sources << @current_source
        end
      when OPTIONS
        value = $2
        value = true if value == "true"
        value = false if value == "false"

        key = $1

        if @opts[key]
          @opts[key] = Array(@opts[key])
          @opts[key] << value
        else
          @opts[key] = value
        end
      when *SOURCE
        @current_source = nil
        @opts = {}
        @type = line
      else
        parse_spec(line)
      end
    end
Register or log in to add new notes.