Sha256: d1610d1f627994770fc9e67e344ea84ae4bdb7ba0a7c9e7fc00ef056bf657ab2

Contents?: true

Size: 135 Bytes

Versions: 3

Compression:

Stored size: 135 Bytes

Contents

class File

  def self.line_count(file_path)
    (`wc -l #{file_path}`.match /^\s*(?<line_count>\d+).*/)["line_count"].to_i
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cranium-0.3.0 lib/cranium/extensions/file.rb
cranium-0.2.1 lib/cranium/extensions/file.rb
cranium-0.2.0 lib/cranium/extensions/file.rb