Comments (6)
If you want to work up a patch for this I'm happy to apply it.
from highline.
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.
That's a fair point. I didn't look at that error message closely enough.
from highline.
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.
Then we probably need to submit a bug to them, don't you think?
from highline.
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)
- Proc validation displays ruby object on invalid HOT 8
- Incosistent behavior when ask with a validator and readline=true HOT 9
- undefined method 'default_instance' HOT 3
- Default Highline Example on GithubGives Error HOT 5
- HighLine Terminal::IOConsole#restore_mode does not work with StringIO HOT 3
- System extensions depend on now-internalized JRuby dependencies HOT 14
- consider exposing Readline.completion_proc via HighLine::Question#selection HOT 3
- default value has to be a string HOT 14
- Ctrl-C improperly handled when q.echo = false HOT 6
- Issues with echo: false and not on TTY HOT 7
- Can't get terminal_size HOT 11
- echo=false or echo='*' requires extra character after enter on Windows HOT 6
- Possible to accept multiple selections with `.in` and `.default`? HOT 5
- test failing when ruby is built against libedit instead of readline HOT 3
- Have to set convert type in order for `.in` to work with array
- 2.1.0 was released, but tag is missing in repository HOT 2
- Make Highline Ruby 3.3 and reline compatible HOT 1
- Update tests for Reline (as the substitute of Readline)
- Add `abbrev` to gemspec HOT 2
- `ask()` causes `Readline`-related error on Ruby 3.3 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highline.