piotrmurach / github

Ruby interface to GitHub API

Home Page:https://piotrmurach.github.io/github

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined to_hash for Array in Response Wrapper

Merovex opened this issue · comments

commented

/ruby-2.3.1/gems/github_api-0.14.5/lib/github_api/response_wrapper.rb:97:in to_hash': undefined methodto_hash' for []:Array (NoMethodError)

Perhaps catch this error and provide a more helpful response? :)

require 'awesome_print'
require 'github'

issues = Github::Client::Issues.new user: 'piotrmurach', repo: 'github'

ap issues

ap issues.milestones.list state: 'open'

@Merovex It seems to error is coming from awsome_print.

When I don't include awesome_print I am getting expected result.

2.3.1 :008 > p issues.milestones.list state: 'open'
#<Github::ResponseWrapper @body="[]">
=> #<Github::ResponseWrapper @body="[]"> 

But, when I include awesome_print I get error you mentioned so I think you should check in awesome_print gem instead of this.