Method: Gitgo::Repo#read
- Defined in:
- lib/gitgo/repo.rb
#read(sha) ⇒ Object
Reads and deserializes the specified hash of attrs. If sha does not indicate a blob that deserializes as JSON then read returns nil.
302 303 304 305 306 307 308 |
# File 'lib/gitgo/repo.rb', line 302 def read(sha) begin JSON.parse(git.get(:blob, sha).data) rescue JSON::ParserError, Errno::EISDIR nil end end |