rubocop:disable LineLength
495443
def start
      if ENV['rvm_path']
        sh "rvmsudo vhost run #{run_options}"
      else
        vhost = File.expand_path('../../bin/vhost', __dir__)
        sh "bundle exec sudo env PATH=#{ENV['PATH']} #{vhost} run #{run_options}"
      end
      sleep 1
      self.device = @device if @device
    end
643866
private void newLine() {
    numBlocks = 0;
    perms = username = group = path = linkTarget = replication = hardlinkId = "";
    filesize = 0l;
    type = INode.INodeType.REGULAR_INODE.toString();
    inInode = true;
  }
1273043
def stringify_comment_array comments
      ctxt = ''
      num = nil
      started = false
      last_line = nil
      comments.each { |l|
        # Trim the comment and minimum leading whitespace
        p = l.text.gsub(/^#+/, '')
        if num.nil? and !p.strip.empty?
          num = p.index(/[^ ]/)
          started = true
        elsif started and !p.strip.empty?
          cur = p.index(/[^ ]/)
          num = cur if cur < num
        end
        # Include blank lines between comments
        ctxt += ("\n" * (l.loc.first_line - last_line - 1)) unless last_line.nil? || l.loc.first_line - last_line <= 0
        ctxt += "#{p[num..-1]}\n" if started
        last_line = l.loc.last_line if last_line.nil? || l.loc.last_line > last_line
      }
      ctxt
    end
836683
def run_line_length_cop_auto_gen_config(paths)
      puts Rainbow(PHASE_1).yellow
      @options[:only] = ['Metrics/LineLength']
      execute_runner(paths)
      @options.delete(:only)
      @config_store = ConfigStore.new
      # Save the todo configuration of the LineLength cop.
      IO.read(ConfigLoader::AUTO_GENERATED_FILE)
        .lines
        .drop_while { |line| line.start_with?('#') }
        .join
    end
328424
function (parts, indent, prefix) {
        var lines = [];
        var line = [];

        var lineLength = !!prefix ? prefix.length - 1: indent.length - 1;

        parts.forEach(function (part) {
          if (lineLength + 1 + part.length > textWidth) {
            lines.push(indent + line.join(' '));
            line = [];
            lineLength = indent.length - 1;
          }
          line.push(part);
          lineLength += part.length + 1;
        });

        if (line) {
          lines.push(indent + line.join(' '));
        }
        if (prefix) {
          lines[0] = lines[0].substr(indent.length);
        }
        return lines;
      }
865012
function(line) {
  const length = getLength(line);
  let output;
  if (length > 100) {
    output = (Math.round(length / 1000 * 100) / 100) +
        ' ' + 'km';
  } else {
    output = (Math.round(length * 100) / 100) +
        ' ' + 'm';
  }
  return output;
}
329177
def map_gems_to_specs(gems)
      gems.map.with_index do |gemfile, index|
        # rubocop:disable Metrics/LineLength
        Utils.logger.info("[#{index + 1}/#{gems.size}]: Processing #{gemfile.split('/')[-1]}")
        # rubocop:enable Metrics/LineLength

        if File.size(gemfile).zero?
          Utils.logger.warn("Skipping zero-length gem: #{gemfile}")
          next
        end

        begin
          spec = if ::Gem::Package.respond_to? :open
                   ::Gem::Package
                     .open(File.open(gemfile, 'rb'), 'r', &:metadata)
                 else
                   ::Gem::Package.new(gemfile).spec
                 end

          spec.loaded_from = gemfile

          # HACK: fuck this shit - borks all tests that use pl1
          if File.basename(gemfile, '.gem') != spec.original_name
            exp = spec.full_name
            exp << " (#{spec.original_name})" if
              spec.original_name != spec.full_name
            msg = "Skipping misnamed gem: #{gemfile} should be named #{exp}"
            Utils.logger.warn(msg)
            next
          end

          version = spec.version.version
          unless version =~ /^\d+\.\d+\.\d+.*/
            msg = "Skipping gem #{spec.full_name} - invalid version #{version}"
            Utils.logger.warn(msg)
            next
          end

          if ::Gem::VERSION >= '2.5.0'
            spec.abbreviate
            spec.sanitize
          else
            abbreviate spec
            sanitize spec
          end

          spec
        rescue SignalException
          msg = 'Received signal, exiting'
          Utils.logger.error(msg)
          raise
        rescue StandardError => e
          msg = ["Unable to process #{gemfile}",
                 "#{e.message} (#{e.class})",
                 "\t#{e.backtrace.join "\n\t"}"].join("\n")
          Utils.logger.debug(msg)
        end
      end.compact
    end
872392
def truncate(input, max = 30)
      return input if input.nil? || input.length <= max

      input[0..max - 1].gsub(/\s\w+\s*$/, '...')
    end
323308
def following_non_gem_lines
      all_lines[(index+1)..(-1)].
          reject {|x| x.strip.empty? || x.match(GemBench::TRASH_REGEX) }.
          map(&:strip).
          inject([]) do |following_lines, next_line|
            break following_lines if next_line.match(GEM_REGEX)
            following_lines << next_line
      end
    end
288127
def parse(path, contents = nil)
      print_known_info if verbose

      contents ||= File.open(path, "r:utf-8", &:read)

      # Work around for Rubinius incomplete encoding in 1.9 mode
      if contents.respond_to?(:encoding) && contents.encoding.name != "UTF-8"
        contents.encode!("UTF-8")
      end

      if contents.tr!("“”‘’‛", %(""'''))
        # Changes have been made
        ui.puts "Your #{path.basename} has had smart quotes sanitised. " \
          "To avoid issues in the future, you should not use " \
          "TextEdit for editing it. If you are not using TextEdit, " \
          "you should turn off smart quotes in your editor of choice.".red
      end

      if contents.include?("puts")
        ui.puts "You used `puts` in your Dangerfile. To print out text to GitHub use `message` instead"
      end

      self.defined_in_file = path
      instance_eval do
        # rubocop:disable Lint/RescueException
        begin
          eval_file(contents, path)
        rescue Exception => e
          message = "Invalid `#{path.basename}` file: #{e.message}"
          raise DSLError.new(message, path, e.backtrace, contents)
        end
        # rubocop:enable Lint/RescueException
      end
    end
1087284
def _get_long_description(self):
        

        if self.description is None:
            return None

        lines = [x for x in self.description.split('\n')]
        if len(lines) == 1:
            return None

        elif len(lines) >= 3 and lines[1] == '':
            return '\n'.join(lines[2:])

        return self.description
265935
def ensure_description_newlines(buffer)
      return if description.empty?

      if description[-1, 1] != '\n'
        buffer << '\n\n'
      elsif description.length > 1 && description[-2, 1] != '\n'
        buffer << '\n'
      end
    end
842844
def truncate content  #:nodoc:
      _maxlen = @maxlen || @width-@internal_width
      _maxlen = @width-@internal_width if _maxlen > @width-@internal_width # take care of decrease in width
      if !content.nil? 
        if content.length > _maxlen # only show maxlen
          @longest_line = content.length if content.length > @longest_line
          #content = content[@pcol..@pcol+maxlen-1] 
          content.replace(content[@pcol..@pcol+_maxlen-1] || "")
        else
          if @pcol > 0
              content.replace(content[@pcol..-1]  || "")
          end
        end
      end
      content
    end
1295356
def lines
      ret = [Attributes::HEADER]
      # Sort by name, but id goes first
      @attrs.sort_by{|x| x[:name] == 'id' ? '_' : x[:name]}.each do |row|
        line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}"
        # split into lines that don't exceed 80 chars
        lt = wrap_text(line, MAX_CHARS_PER_LINE-3).split("\n")
        line = ([lt[0]] + lt[1..-1].map{|x| "#   #{x}"}).join("\n")
        ret << line
      end
      ret
    end
136701
def format_backtrace(backtrace)
      backtrace ||= []
      backtrace[0..BACKTRACE_LINES].collect do |line|
        "#{line.gsub(/\n|\`|\'/, '')}".split(//).last(MAX_LINE_LENGTH).join
      end
    end
434092
def backspace!
      if @col > 0
        left, cursor, right = abbrev_segments
        @abbrev = left.chop! + cursor + right
        @col -= 1
        redraw
      end
    end
451589
private static String stripIndentFromLine(String line, int numChars) {
        int length = line.length();
        return numChars <= length ? line.substring(numChars) : "";
    }