Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code snippet from the doc fails #1

Closed
melezhik opened this issue Feb 7, 2023 · 3 comments
Closed

Code snippet from the doc fails #1

melezhik opened this issue Feb 7, 2023 · 3 comments

Comments

@melezhik
Copy link

melezhik commented Feb 7, 2023

Hi! I try to run a code snippet extracted from the module doc and it fails:

19:19:45 :: # VERTICAL BAR CHART
19:19:45 :: use Terminal::Graphing::BarChart::Vertical;
19:19:45 :: 
19:19:45 :: my $x_and_y_axis_graph = Terminal::Graphing::BarChart::Vertical.new(
19:19:45 ::     data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
19:19:45 ::     bar_length => 10,
19:19:45 ::     x_axis_labels => <a b c d e f g h i j k>,
19:19:45 ::     y_axis_labels => <0 1 2 3 4 5 6 7 8 9>
19:19:45 :: );
19:19:45 :: 
19:19:45 :: # to get the string version of the graph
19:19:45 :: $x_and_y_axis_graph.generate();
19:19:45 :: 
19:19:45 :: # to print the graph to Standard Out
19:19:45 :: $x_and_y_axis_graph.print();
19:19:46 :: Using rakudo from /var/.sparrowdo/env/main/.sparrowdo/rakudo-moar-2022.12-01-linux-x86_64-gcc:
19:19:46 :: Welcome to Rakudo™ v2022.12.
19:19:46 :: Implementing the Raku® Programming Language v6.d.
19:19:46 :: Built on MoarVM version 2022.12.
19:19:46 :: run raku -I lib /home/worker/.sparrow6/tmp/3122/code.raku ...
19:19:46 :: warn: good_doc failed
[task stderr]
19:19:46 :: ===SORRY!=== Error while compiling /home/worker/.sparrow6/tmp/3122/code.raku
19:19:46 :: ===SORRY!=== Error while compiling /var/.sparrowdo/env/main/.sparrowdo/source/lib/Terminal/Graphing/BarChart/Vertical.rakumod (Terminal::Graphing::BarChart::Vertical)
19:19:46 :: ===SORRY!=== Error while compiling /var/.sparrowdo/env/main/.sparrowdo/source/lib/Terminal/Graphing/BarChart/Core.rakumod (Terminal::Graphing::BarChart::Core)
19:19:46 :: Could not find Listicles in:
19:19:46 ::     /var/.sparrowdo/env/main/.sparrowdo/source/lib
19:19:46 ::     /home/worker/.raku
19:19:46 ::     /var/.sparrowdo/env/main/.sparrowdo/rakudo-moar-2022.12-01-linux-x86_64-gcc/share/perl6/site
19:19:46 ::     /var/.sparrowdo/env/main/.sparrowdo/rakudo-moar-2022.12-01-linux-x86_64-gcc/share/perl6/vendor
19:19:47 ::     /var/.sparrowdo/env/main/.sparrowdo/rakudo-moar-2022.12-01-linux-x86_64-gcc/share/perl6/core
19:19:47 ::     CompUnit::Repository::AbsolutePath<68945232>
19:19:47 ::     CompUnit::Repository::NQP<72095928>
19:19:47 ::     CompUnit::Repository::Perl5<72095968>
19:19:47 :: at /var/.sparrowdo/env/main/.sparrowdo/source/lib/Terminal/Graphing/BarChart/Core.rakumod (Terminal::Graphing::BarChart::Core):2

The full report is available here - https://ci.sparrowhub.io/report/2887

HTH

@melezhik melezhik changed the title Code snipped from the doc fails Code snippet from the doc fails Feb 7, 2023
@melezhik
Copy link
Author

melezhik commented Feb 7, 2023

Listicles dependency is not declared ? looks like it's but not installed ... hmmm

@melezhik
Copy link
Author

melezhik commented Feb 7, 2023

sorry, it's my fault, the pipeline is incorrect ...

@melezhik
Copy link
Author

melezhik commented Feb 7, 2023

looks good now:

[task run: task.bash - good-doc]
[dump code: task.bash]
[1] set -e
[2] 
[3] cd $dir
[4] 
[5] cat $file
[6] 
[7] rakudo_path=$(config rakudo_path)
[8] 
[9] if ! test -z $rakudo_path; then
[10]   echo "Using rakudo from $rakudo_path:"
[11]   eval "$($rakudo_path/scripts/set-env.sh --quiet)"
[12]   raku --version
[13] fi
[14] 
[15] echo "run raku -I lib $file ..."
[16] 
[17] raku -I lib $file || echo "warn: good_doc failed"
[18] 
[task stdout]
19:42:26 :: 
19:42:26 :: # VERTICAL BAR CHART
19:42:26 :: use Terminal::Graphing::BarChart::Vertical;
19:42:26 :: 
19:42:26 :: my $x_and_y_axis_graph = Terminal::Graphing::BarChart::Vertical.new(
19:42:26 ::     data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
19:42:26 ::     bar_length => 10,
19:42:26 ::     x_axis_labels => <a b c d e f g h i j k>,
19:42:26 ::     y_axis_labels => <0 1 2 3 4 5 6 7 8 9>
19:42:26 :: );
19:42:26 :: 
19:42:26 :: # to get the string version of the graph
19:42:26 :: $x_and_y_axis_graph.generate();
19:42:26 :: 
19:42:26 :: # to print the graph to Standard Out
19:42:26 :: $x_and_y_axis_graph.print();
19:42:27 :: run raku -I lib /home/worker/.sparrow6/tmp/17411/code.raku ...
19:42:27 :: 9 │                     █
19:42:27 :: 8 │                   █ █
19:42:27 :: 7 │                 █ █ █
19:42:27 :: 6 │               █ █ █ █
19:42:27 :: 5 │             █ █ █ █ █
19:42:27 :: 4 │           █ █ █ █ █ █
19:42:27 :: 3 │         █ █ █ █ █ █ █
19:42:27 :: 2 │       █ █ █ █ █ █ █ █
19:42:27 :: 1 │     █ █ █ █ █ █ █ █ █
19:42:27 :: 0 │   █ █ █ █ █ █ █ █ █ █
19:42:27 ::    ──────────────────────
19:42:27 ::     a b c d e f g h i j k

https://ci.sparrowhub.io/report/2889

@melezhik melezhik closed this as completed Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant