Sha256: 9b3b301dae7eb504d44c64da4da0f86dea7b80a0cb89e20bd2f59f0a4aadf0eb

Contents?: true

Size: 644 Bytes

Versions: 26

Compression:

Stored size: 644 Bytes

Contents

require File.join(File.dirname(__FILE__), "resource")
module Octopi
  class Blob < Base
    attr_accessor :text, :data, :name, :sha, :size, :mode, :mime_type
    include Resource
    set_resource_name "blob"

    resource_path "/blob/show/:id"

    def self.find(options={})
      ensure_hash(options)
      user, repo = gather_details(options)
      sha = options[:sha]
      path = options[:path]
      
      self.validate_args(sha => :sha, user => :user)
      
      if path
        super [user, repo, sha, path]
      else
        Api.api.get_raw(path_for(:resource), {:id => [user, repo, sha].join('/')})
      end  
    end  
  end
end

Version data entries

26 entries across 26 versions & 4 rubygems

Version Path
octopi-0.4.5 lib/octopi/blob.rb
octopi-0.4.4 lib/octopi/blob.rb
octopi-0.4.3 lib/octopi/blob.rb
octopi-0.4.2 lib/octopi/blob.rb
octopi-0.4.1 lib/octopi/blob.rb
octopi-0.4.0 lib/octopi/blob.rb
octopi-0.3.0 lib/octopi/blob.rb
dcuddeback-octopi-0.2.12 lib/octopi/blob.rb
dcuddeback-octopi-0.2.11 lib/octopi/blob.rb
dcuddeback-octopi-0.2.9 lib/octopi/blob.rb
dcuddeback-octopi-0.2.8 lib/octopi/blob.rb
devver-octopi-0.2.14 lib/octopi/blob.rb
tpitale-octopi-0.3.0 lib/octopi/blob.rb
devver-octopi-0.2.13 lib/octopi/blob.rb
devver-octopi-0.2.12 lib/octopi/blob.rb
octopi-0.2.8 lib/octopi/blob.rb
devver-octopi-0.2.11 lib/octopi/blob.rb
devver-octopi-0.2.10 lib/octopi/blob.rb
devver-octopi-0.2.9 lib/octopi/blob.rb
devver-octopi-0.2.8 lib/octopi/blob.rb