Giter Site home page Giter Site logo

Highline v1.6.2 Error about highline HOT 6 CLOSED

jeg2 avatar jeg2 commented on July 18, 2024
Highline v1.6.2 Error

from highline.

Comments (6)

JEG2 avatar JEG2 commented on July 18, 2024

If you want to work up a patch for this I'm happy to apply it.

from highline.

davispuh avatar davispuh commented on July 18, 2024

I wouldn't say it's HighLine bug. You're passing Hash to format_statement but it doesn't make sense. It's supposed to be a string. Why Hash?

from highline.

JEG2 avatar JEG2 commented on July 18, 2024

That's a fair point. I didn't look at that error message closely enough.

from highline.

bsodmike avatar bsodmike commented on July 18, 2024

It's bubbling up through from Vagrant's use of Berkshelf

[chef] Destroying VM and associated drives...
[chef] Running cleanup tasks for 'chef_solo' provisioner...
/Users/mdesilva/.vagrant.d/gems/gems/highline-1.6.20/lib/highline.rb:711:in `format_statement': undefined method `to_str' for {"chef-server"=>"2.0.0"}:Hash (NoMethodError)
    from /Users/mdesilva/.vagrant.d/gems/gems/highline-1.6.20/lib/highline.rb:617:in `say'
    from /Users/mdesilva/.vagrant.d/gems/gems/solve-0.8.1/lib/solve/tracers/human_readable.rb:43:in `solution'
    from /Users/mdesilva/.vagrant.d/gems/gems/solve-0.8.1/lib/solve/solver.rb:124:in `resolve'
    from /Users/mdesilva/.vagrant.d/gems/gems/solve-0.8.1/lib/solve.rb:39:in `it!'
    from /Users/mdesilva/.vagrant.d/gems/gems/berkshelf-2.0.10/lib/berkshelf/resolver.rb:102:in `resolve'
    from /Users/mdesilva/.vagrant.d/gems/gems/berkshelf-2.0.10/lib/berkshelf/berksfile.rb:671:in `resolve'
    from /Users/mdesilva/.vagrant.d/gems/gems/berkshelf-2.0.10/lib/berkshelf/berksfile.rb:418:in `install'`

from highline.

JEG2 avatar JEG2 commented on July 18, 2024

Then we probably need to submit a bug to them, don't you think?

from highline.

abinoam avatar abinoam commented on July 18, 2024

The main output method in Ruby is #puts.
#puts accepts anything as argument and it just convert it into a String.
So, when we see #say or #ask we naturally think we can pass any arbitrary object, like the hash that was being passed in https://github.com/berkshelf/solve/blob/v0.8.1/lib/solve/tracers/human_readable.rb#L43 and was fixed here berkshelf/solve@6d75408 just to work along with HighLine.
What about to give #say some of the #puts superpowers?

The current problem is that #say is trying to #dup and #to_str the arguments. But some objects have problems with #dup, and others have problems with #to_str.

So, I tried to improve on this by first calling String (conversion method), and #dup only after we have a String.

from highline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.