method
get
ruby latest stable - Class:
Gem::RequestSet::Lockfile
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.
get(expected_types = nil, expected_value = nil)public
Gets the next token for a Lockfile
# File lib/rubygems/request_set/lockfile.rb, line 215
def get expected_types = nil, expected_value = nil # :nodoc:
@current_token = @tokens.shift
type, value, column, line = @current_token
if expected_types and not Array(expected_types).include? type then
unget
message = "unexpected token [#{type.inspect}, #{value.inspect}], " +
"expected #{expected_types.inspect}"
raise ParseError.new message, column, line, "#{@gem_deps_file}.lock"
end
if expected_value and expected_value != value then
unget
message = "unexpected token [#{type.inspect}, #{value.inspect}], " +
"expected [#{expected_types.inspect}, " +
"#{expected_value.inspect}]"
raise ParseError.new message, column, line, "#{@gem_deps_file}.lock"
end
@current_token
end