joelmoss-grit 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/grit/blob.rb +9 -0
  3. metadata +3 -2
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 5
3
+ :patch: 6
4
4
  :major: 1
data/lib/grit/blob.rb CHANGED
@@ -51,6 +51,15 @@ module Grit
51
51
  guesses.first ? guesses.first.simplified : DEFAULT_MIME_TYPE
52
52
  end
53
53
 
54
+ # Returns true if the contents of this blob looks like
55
+ # binary data, false otherwise
56
+ def binary?
57
+ data[0..1024].include?("\000")
58
+ rescue Grit::Git::GitTimeout
59
+ # assuming binary for large blobs might be a tad too clever...
60
+ return true
61
+ end
62
+
54
63
  # The blame information for the given file at the given commit
55
64
  #
56
65
  # Returns Array: [Grit::Commit, Array: [<line>]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joelmoss-grit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -81,6 +81,7 @@ files:
81
81
  - LICENSE
82
82
  has_rdoc: false
83
83
  homepage: http://github.com/mojombo/grit
84
+ licenses:
84
85
  post_install_message:
85
86
  rdoc_options:
86
87
  - --charset=UTF-8
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  requirements: []
102
103
 
103
104
  rubyforge_project: grit
104
- rubygems_version: 1.2.0
105
+ rubygems_version: 1.3.5
105
106
  signing_key:
106
107
  specification_version: 3
107
108
  summary: Grit is a Ruby library for extracting information from a git repository in an object oriented manner.