I may be totally wrong, but I don't  see the "result" variable being used inside the block so what gets returned is the last element. My guess is you want a list of  package_filenames generated by all the package_rules, not just the  package_filenames generated by the last package rule in package_rules.
```ruby
[1, 2, 3, 9].inject([]) { |result, element|  element } # => returns 9
```
what you probably want is

```ruby
[1, 2, 3, 9].inject([]) { |result, element|  result + [element] } # => returns [1,2,3,9] 
```