Skip to content
This repository has been archived by the owner on Feb 9, 2019. It is now read-only.

Setting invalid instance variable name #8

Open
dewski opened this issue Jul 11, 2012 · 3 comments
Open

Setting invalid instance variable name #8

dewski opened this issue Jul 11, 2012 · 3 comments

Comments

@dewski
Copy link
Contributor

dewski commented Jul 11, 2012

Using Ruby 1.9.3p0:

➜  ~  irb              
irb(main):001:0> require 'swish'
=> true
irb(main):002:0> Dribbble::Player.find 'garrett'
NameError: `@content-type' is not allowed as an instance variable name
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/swish-0.8.1/lib/dribbble/base.rb:11:in `instance_variable_set'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/swish-0.8.1/lib/dribbble/base.rb:11:in `block in initialize'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1519:in `block in each_header'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1518:in `each'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1518:in `each_header'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/httparty-0.8.3/lib/httparty/response.rb:54:in `method_missing'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/swish-0.8.1/lib/dribbble/base.rb:10:in `initialize'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/swish-0.8.1/lib/dribbble/player.rb:4:in `new'
    from /Users/dewski/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/swish-0.8.1/lib/dribbble/player.rb:4:in `find'
    from (irb):2
    from /Users/dewski/.rbenv/versions/1.9.3-p0/bin/irb:12:in `<main>'
irb(main):003:0> exit
@dewski
Copy link
Contributor Author

dewski commented Jul 11, 2012

Looks like it's due to Dribbble returning 500 errors. Not sure if this would be an appropriate response for that though.

@semanticart
Copy link
Collaborator

Thanks for the report. We should definitely raise a less misleading error. I'll talk to @jeremyw and we'll see what we can do.

@rscherf
Copy link

rscherf commented Nov 11, 2015

I'm seeing this again. Any ideas on a fix?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants