schacon / showoff

moved to puppetlabs/showoff!
2.41k stars 13 forks source link

Make it work with GLI 2.0 #193

Closed chastell closed 11 years ago

chastell commented 12 years ago

Small fix to make Showoff work with the newly-released GLI 2.0.

tomash commented 12 years ago

+1, been bitten by it recently.

tomash commented 12 years ago

ok, actually this change does not make everything work. i now get


[2012-08-19 11:36:28] INFO  WEBrick 1.3.1
[2012-08-19 11:36:28] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
== Sinatra/1.3.2 has taken the stage on 9090 for development with backup from WEBrick
[2012-08-19 11:36:28] INFO  WEBrick::HTTPServer#start: pid=6245 port=9090
[2012-08-19 11:36:32] ERROR TypeError: can't convert String into Integer
    /home/tomek/.rvm/gems/ruby-1.9.2-p290@showoff/bundler/gems/showoff-6defc51d1588/lib/showoff.rb:66:in `[]'
    /home/tomek/.rvm/gems/ruby-1.9.2-p290@showoff/bundler/gems/showoff-6defc51d1588/lib/showoff.rb:66:in `initialize'
    /home/tomek/.rvm/gems/ruby-1.9.2-p290@showoff/gems/sinatra-1.3.2/lib/sinatra/base.rb:1329:in `new'
tomash commented 12 years ago

(same with ruby 1.9.3-p194)

TylerBrock commented 12 years ago

+1

alexch commented 12 years ago

A more reliable (albeit temporary) fix would be to set the dependency in the gemspec, e.g.

s.add_dependency "gli","~> 1.2"

or

s.add_dependency "gli","1.6.0"

("gem list -r --all gli" shows that 1.6 was the most recent pre-2.0 release)

Naturally, making it really work with GLI 2.0 would be best.

nstielau commented 12 years ago

+1

chastell commented 12 years ago

@tomash: I can’t replicate your case; can you share your showoff.json file?

zhum commented 11 years ago

+1 !!!

tomash commented 11 years ago

"can't convert string into integer" happens with showoff.json that's just an array (not a hash)

[ 
  {"section":"intro"},
  {"section":"rails4"}
]

worked fine previously

chastell commented 11 years ago

I think the array-only version hasn’t been supported for quite a while now. Try

{
  "name": "What’s New in Rails 4?",
  "sections": [
    {"section":"intro"},
    {"section":"rails4"}
  ]
}
tomash commented 11 years ago

yep, did it already and it works indeed