opscode/chef — pull request #2149 by JeanMertz (2014-10-02 13:50:51+00:00)
Title: knife upload fails due to "wrong" ruby syntax in files/* file

I am trying to upload my newly created [transip](https://github.com/kabisa-cookbooks/transip) cookbook.

In this cookbook, I [vendor gems][], which is something I like to try and see how that works, compared to using something like `chef_gem`.

However, when trying to upload the cookbook, `knife` errors out during the Ruby test:

```
FATAL: Cookbook file files/debian-6.0.10/vendor/gems/macaddr-1.7.1/test/mac_test.rb has a ruby syntax error:
FATAL: ./transip/files/debian-6.0.10/vendor/gems/macaddr-1.7.1/test/mac_test.rb:24: BEGIN is permitted only at toplevel
FATAL: BEGIN {
FATAL: ^
```

I am unsure what happens in this file exactly, but it seems some meta-like ruby code.

I couldn't find any way to completely disable ruby testing when uploading, but I think it makes sense to *not* check any ruby files in `files/` as they don't affect the workings of the cookbook, and I should be free to put whatever I want in that directory without letting Chef worry about it.

[vendor gems]: https://sethvargo.com/using-gems-with-chef/

**edit** I do see that the uploader code calls `Chefignore.new`, but I of course want my files to be uploaded, so I can't add them to my `chefignore` file