github/linguist — pull request #1775 by pchaigno (2014-11-26 20:50:55+00:00)
Title: Blob data passed as a string in Generated

While working on the issue with UTF-8 encoding I came across [this comment](https://github.com/github/linguist/blob/master/lib/linguist/generated.rb#L6-L8):
(There is also a [TODO](https://github.com/github/linguist/blob/master/lib/linguist/generated.rb#L40) on this in the same file.)
```ruby
class Generated
# Public: Is the blob a generated file?
#
# name - String filename
# data - String blob data. A block also maybe passed in for lazy
# loading. This behavior is deprecated and you should always
# pass in a String.
#
# Return true or false
def self.generated?(name, data)
new(name, data).generated?
end
```

This pull request changes `blob_helper.rb` to give a string directly to `Generated.generated?`.
A few tests in `test_blob.test_generated` were relying on the fact that the files to test were not always read.
Thus, I had to add a new samples and remove a few tests:
- I removed the test on `project.pbxproj` because [it doesn't appear to be a XML file](https://github.com/search?q=xml+extension%3A.pbxproj&type=Code&utf8=%E2%9C%93) and I don't know what language it is, so I don't know where to put it.
- I removed the two tests for Godep because the samples would need to be in a `Godeps` folder in order to be detected as generated. This is not currently possible (maybe later with the `test/fixtures/` folder to come).

I'm not sure I did the right thing so I'd very like some more experienced :eyes: on this.
/cc @bkeepers @arfon