Sha256: 46ab59562df4b5ae218d4253f85963138906c29ccb2dc22dc171730ee6aa9346

Contents?: true

Size: 417 Bytes

Versions: 13

Compression:

Stored size: 417 Bytes

Contents

# encoding: utf-8
module LocalPac
  class GitFile
    attr_reader :path, :name, :content, :sha

    def initialize(data, git_dir = nil)
      data = data.split(" ")
      @path    = data.last 
      @sha     = data[2] 
      @name    = path.sub(/.pac$/, '').camelize.downcase.to_sym
      @content = Git.cat_file(@sha, git_dir).join("\n")
    end

    def to_s
      "#{name}: #{path} (#{content})"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
local_pac-0.1.13 lib/local_pac/git_file.rb
local_pac-0.1.11 lib/local_pac/git_file.rb
local_pac-0.1.10 lib/local_pac/git_file.rb
local_pac-0.1.9 lib/local_pac/git_file.rb
local_pac-0.1.8 lib/local_pac/git_file.rb
local_pac-0.1.7 lib/local_pac/git_file.rb
local_pac-0.1.6 lib/local_pac/git_file.rb
local_pac-0.1.5 lib/local_pac/git_file.rb
local_pac-0.1.4 lib/local_pac/git_file.rb
local_pac-0.1.3 lib/local_pac/git_file.rb
local_pac-0.1.2 lib/local_pac/git_file.rb
local_pac-0.1.1 lib/local_pac/git_file.rb
local_pac-0.1.0 lib/local_pac/git_file.rb