Location must be in the format of "file_path\file_name.rb:line_number"
 Scenario must be a string array containing everything from the first tag to the last example table
 where applicable.
330591
def get_step_order
      order = []
      @steps.each do |line|
        next if is_comment?(line)
        match = line.match(STEP_REGEX)
        order << match[:style] unless match.nil?
      end
      order
    end
989109
def as_href(from_path)
      if @options.all_one_file
        "#" + path
      else
        RDoc::Markup::ToHtml.gen_relative_url from_path, path
      end
    end
629495
def coordinate(location)
      ## Returns array of numerical equiv coordinates (e.g. "AA11" -> [20,11])
      error = "\n\nSomething wrong during coordinate-mapping.\nAre you sure you passed an alphanumeric string\n to the coordinate() method?\n"
      split_index = -1
      location.each_char do |character|
        if letter?(character)
          split_index += 1
        end
      end
      row = location[0..split_index]
      column = location[split_index + 1..-1]
      fail ArgumentError, error unless row.length > 0 && column.length > 0
      ## Now convert alphanumeric row to jedec equiv' with to_row() method
      # and return coordinates.
      coordinates = [to_row(row), column.to_i - 1]
    end
221780
def to_s
      # Sorted by filename and line number.
      #
      #     FC123: My rule name: foo/recipes/default.rb
      @warnings.map do |w|
        ["#{w.rule.code}: #{w.rule.name}: #{w.match[:filename]}",
         w.match[:line].to_i]
      end.sort do |x, y|
        x.first == y.first ? x[1] <=> y[1] : x.first <=> y.first
      end.map { |w| "#{w.first}:#{w[1]}" }.uniq.join("\n")
    end
1156229
def task_definition_error(e)
      error_info = e.backtrace.first
      path, line_no, _ = error_info.split(':')
      line_no = line_no.to_i
      puts "Error evaluating #{path}:".color(:red)
      puts e.message
      puts "Here's the line in #{path} with the error:\n\n"

      contents = IO.read(path)
      content_lines = contents.split("\n")
      context = 5 # lines of context
      top, bottom = [line_no-context-1, 0].max, line_no+context-1
      spacing = content_lines.size.to_s.size
      content_lines[top..bottom].each_with_index do |line_content, index|
        line_number = top+index+1
        if line_number == line_no
          printf("%#{spacing}d %s\n".color(:red), line_number, line_content)
        else
          printf("%#{spacing}d %s\n", line_number, line_content)
        end
      end
    end
472437
def map_table_alias_for( path )
      return "table alias for #{path.inspect} already exists" unless table_aliases[path].nil?
      
      reflection = reflection_for( path )
      table_alias = reflection.table_name
      if table_aliases.values.include?( table_alias )
        max_length = reflection.active_record.connection.table_alias_length
        # Rails seems to pluralize reflection names
        table_alias = "#{reflection.name.to_s.pluralize}_#{reflection.active_record.table_name}".to(max_length-1)
      end            
      while table_aliases.values.include?( table_alias )
        if table_alias =~ /\w(_\d+?)$/
          table_index = $1.succ
          table_alias = "#{table_alias[0..-(table_index.length+1)]}_#{table_index}"
        else
          table_alias = "#{table_alias[0..(max_length-3)]}_2" 
        end
      end
      table_aliases[path] = table_alias
    end
51636
def extract(contents)
      file_text, matches = parse(contents)

      extracted_ruby = +''

      last_match = [0, 0]
      matches.each do |start_index, end_index|
        handle_region_before(start_index, last_match.last, file_text, extracted_ruby)

        extracted_ruby << extract_match(file_text, start_index, end_index)

        last_match = [start_index, end_index]
      end

      extracted_ruby << file_text[last_match.last..-1].gsub(/./, ' ')
      extracted_ruby.gsub!(/[^\S\r\n]+$/, '')

      # if we replaced <%== with <%= raw, try to shift the columns back to the
      # left so they match the original again
      extracted_ruby.gsub!(/   raw/, 'raw')

      extracted_ruby
    end
584437
def to_s
      msg = super
      @file = nil if (@file.is_a?(String) && @file.empty?)
      msg += Puppet::Util::Errors.error_location_with_space(@file, @line, @pos)
      msg
    end
575880
def hash_for_railsbp(error)
        {
          'linter' => error['message'].gsub(/\((.*)\)/, '').strip.parameterize('_').camelize,
          'severity' => 'warning',
          'reason' => error['message'],
          'column' => 0,
          'line' => error['line_number'].to_i
        }
      end
100392
def filelists
      fl = []
      @repomd.xpath("/xmlns:repomd/xmlns:data[@type=\"filelists\"]/xmlns:location").each do |f|
       fl << File.join(@url, f['href'])
      end
      fl
    end
387743
def to_location(location):
        
        if not location:
            raise SbgError('Location is required!')
        if isinstance(location, six.string_types):
            return location
        else:
            raise SbgError('Invalid location parameter!')
453738
def format_location(ctx, text):
    
    text = conversions.to_string(text, ctx)
    return text.split(">")[-1].strip()
858440
function FileLocation(fullPath, line, chFrom, chTo, id) {
        this.fullPath = fullPath;
        this.line = line;
        this.chFrom = chFrom;
        this.chTo = chTo;
        this.id = id;
    }
878245
function(tag, start_line, start_column) {
  return { t: tag,
           open: true,
           last_line_blank: false,
           start_line: start_line,
           start_column: start_column,
           end_line: start_line,
           children: [],
           parent: null,
           // string_content is formed by concatenating strings, in finalize:
           string_content: "",
           strings: [],
           inline_content: []
        };
}
571337
public static String resourceFileToString(final String location, final String fileName) {
        if (location == null || fileName == null) return null;

        final InputStream in = ResourceUtilities.class.getResourceAsStream(location + fileName);
        if (in == null) return null;

        final BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String line;
        final StringBuilder output = new StringBuilder("");
        try {
            while ((line = br.readLine()) != null) {
                output.append(line + "\n");
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                LOG.error("Failed to close the InputStream", e);
            }
            try {
                br.close();
            } catch (IOException e) {
                LOG.error("Failed to close the BufferedReader", e);
            }
        }
        return output.toString();
    }
45508
def error(msg, line = nil)
      error = ::Opal::SyntaxError.new(msg)
      error.location = Opal::OpalBacktraceLocation.new(file, line)
      raise error
    end
578249
private String getOrcStagingDataLocation(String orcStagingTableName) {
    String orcDataLocation = getConversionConfig().getDestinationDataPath();

    return orcDataLocation + Path.SEPARATOR + orcStagingTableName;
  }