Sha256: 720b8fb84b441e610b7f307a41f2c5ad7628d40880128b5eee27f3a80e5e592c

Contents?: true

Size: 576 Bytes

Versions: 11

Compression:

Stored size: 576 Bytes

Contents

module Octopi
  class Blob < Base
    include Resource
    set_resource_name "blob"

    resource_path "/blob/show/:id"

    def self.find(user, repo, sha, path=nil)
      user = user.login if user.is_a? User
      repo = repo.name if repo.is_a? Repository
      self.class.validate_args(sha => :sha, user => :user, path => :file)
      if path
        super [user,repo,sha,path]
      else
        blob = ANONYMOUS_API.get_raw(path_for(:resource), 
              {:id => [user,repo,sha].join('/')})
        new(ANONYMOUS_API, {:text => blob})
      end  
    end  
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
ddollar-octopi-0.0.13 lib/octopi/blob.rb
fcoury-octopi-0.0.11 lib/octopi/blob.rb
fcoury-octopi-0.0.6 lib/octopi/blob.rb
fcoury-octopi-0.0.7 lib/octopi/blob.rb
fcoury-octopi-0.0.8 lib/octopi/blob.rb
fcoury-octopi-0.0.9 lib/octopi/blob.rb
fcoury-octopi-0.1.0 lib/octopi/blob.rb
philnash-octopi-0.0.11 lib/octopi/blob.rb
philnash-octopi-0.0.12 lib/octopi/blob.rb
octopi-0.1.0 lib/octopi/blob.rb
octopi-0.0.9 lib/octopi/blob.rb