Sha256: 25e3d09855f325b9d77f0b61ed4b169f55ff0c551f1cbd1a87a588a8e2868f31

Contents?: true

Size: 792 Bytes

Versions: 18

Compression:

Stored size: 792 Bytes

Contents

#!/usr/bin/env ruby

if ARGV[0]
  Dir.chdir ARGV[0]
end

STDIN.each do |line|
  chunks = line.split(':')
  file = chunks[0]
  line_number = chunks[1].to_i
  spacer = file.scan(/^\s*/)[0]
  file.gsub!(/^\s+/, '')
  unless File.exists? file
    puts line
    next
  end

  if File.directory? file
    puts line
    next
  end

  puts ''
  puts line.chomp
  puts "#{spacer}vim +#{line_number} #{file}"
  data = File.read(file)
  counter = 0
  data.each_line do |line|
    counter += 1
    if counter > line_number -10
      if counter < line_number +10
        if counter == line_number
          puts "#{spacer}" + counter.to_s.rjust(8, ' ') + "| #{line.chomp}"
        else
          puts spacer +counter.to_s.rjust(8, ' ') + "| #{line}"
        end
      end
    end
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ix-cli-0.0.19 bin/ix-stack
ix-cli-0.0.18 bin/ix-stack
ix-cli-0.0.17 bin/ix-stack
ix-cli-0.0.16 bin/ix-stack
ix-cli-0.0.15 bin/ix-stack
ix-cli-0.0.14 bin/ix-stack
ix-cli-0.0.13 bin/ix-stack
ix-cli-0.0.12 bin/ix-stack
ix-cli-0.0.11 bin/ix-stack
ix-cli-0.0.10 bin/ix-stack
ix-cli-0.0.9 bin/ix-stack
ix-cli-0.0.7 bin/ix-stack
ix-cli-0.0.6 bin/ix-stack
ix-cli-0.0.5 bin/ix-stack
ix-cli-0.0.4 bin/ix-stack
ix-cli-0.0.3 bin/ix-stack
ix-cli-0.0.2 bin/ix-stack
ix-cli-0.0.1 bin/ix-stack