galaaz 0.4.10 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/LICENSE +0 -0
- data/README.md +3123 -882
- data/Rakefile +62 -41
- data/bin/galaaz-bootstrap +137 -0
- data/bin/galaaz-jruby +14 -0
- data/bin/galaaz_jruby_env.inc.sh +6 -0
- data/bin/gbookdown +64 -0
- data/bin/gknit +223 -6
- data/bin/gknit-draft +105 -0
- data/bin/gknit-draft.rb +28 -0
- data/bin/gknit_Rscript +127 -0
- data/bin/grun +27 -1
- data/bin/gstudio +49 -4
- data/bin/{gstudio.rb → gstudio_irb.rb} +0 -0
- data/bin/gstudio_pry.rb +7 -0
- data/bin/install-tinytex +6 -0
- data/bin/run_all_rspec +43 -0
- data/bin/run_example +14 -0
- data/bin/run_old_rspec +19 -0
- data/bin/run_rspec +23 -0
- data/bin/run_rspec_subset +38 -0
- data/bin/run_slow_rspec +19 -0
- data/blogs/R-on-Rails-Planning-Document.md +940 -0
- data/blogs/README.md +100 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +38 -66
- data/blogs/galaaz_ggplot/galaaz_ggplot.log +754 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.md +364 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.tex +607 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/scatter_plot_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/scatter_plot_rb.png +0 -0
- data/blogs/galaaz_ggplot/midwest.Rmd +3 -3
- data/blogs/galaaz_ggplot/midwest_external_png +0 -0
- data/blogs/gknit/gknit.Rmd +52 -55
- data/blogs/gknit/gknit.md +94 -94
- data/blogs/gknit/gknit_files/figure-html/bubble-1.png +0 -0
- data/blogs/gknit/gknit_files/figure-html/diverging_bar.png +0 -0
- data/blogs/gknit/lst.rds +0 -0
- data/blogs/gknit/model.rb +1 -1
- data/blogs/gknit/stats.bib +0 -0
- data/blogs/manual/include_model_local_repro.Rmd +14 -0
- data/blogs/manual/include_model_local_repro.md +75 -0
- data/blogs/manual/lst.rds +0 -0
- data/blogs/manual/manual.Rmd +1582 -196
- data/blogs/manual/manual.log +1786 -0
- data/blogs/manual/manual.md +3107 -890
- data/blogs/manual/manual.tex +3018 -1086
- data/blogs/manual/manual_files/figure-html/bubble-1.png +0 -0
- data/blogs/manual/manual_files/figure-html/diverging_bar.png +0 -0
- data/blogs/manual/manual_files/figure-latex/bubble-1.png +0 -0
- data/blogs/manual/model.rb +41 -0
- data/blogs/nse_dplyr/nse_dplyr.Rmd +277 -151
- data/blogs/nse_dplyr/nse_dplyr.log +928 -0
- data/blogs/nse_dplyr/nse_dplyr.md +457 -293
- data/blogs/oh_my/not_so.rb +0 -0
- data/blogs/oh_my/oh_my.Rmd +1234 -25
- data/blogs/oh_my/oh_my.log +804 -0
- data/blogs/oh_my/oh_my.md +1808 -228
- data/blogs/oh_my/oh_my.tex +821 -0
- data/blogs/oh_my/old.Rmd +15 -14
- data/blogs/ruby_plot/ruby_plot.Rmd +58 -82
- data/blogs/ruby_plot/ruby_plot.log +885 -0
- data/blogs/ruby_plot/ruby_plot.md +71 -103
- data/blogs/ruby_plot/ruby_plot.tex +940 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
- data/blogs/test/test.Rmd +14 -0
- data/examples/50Plots_MasterList/Images/midwest-scatterplot.PNG +0 -0
- data/examples/50Plots_MasterList/ScatterPlot.rb +0 -0
- data/examples/50Plots_MasterList/scatter_plot.rb +0 -0
- data/examples/Bibliography/master.bib +50 -0
- data/examples/Bibliography/stats.bib +72 -0
- data/examples/R/calc.R +0 -0
- data/examples/R/java_interop.R +0 -0
- data/examples/bioconductor_deseq2_airway/Documentation/DESeq2-airway-walkthrough.md +56 -0
- data/examples/bioconductor_deseq2_airway/bench_galaaz_three_same_process.rb +53 -0
- data/examples/bioconductor_deseq2_airway/bench_r_three_same_process.R +34 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz.rb +33 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz_optimized.rb +34 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_minimal.R +30 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_pipeline_for_bench.R +36 -0
- data/examples/islr/all.rb +13 -0
- data/examples/islr/ch2.spec.rb +37 -7
- data/examples/islr/ch3.spec.rb +11 -2
- data/examples/islr/ch3_boston.rb +27 -0
- data/examples/islr/ch3_multiple_regression.rb +0 -0
- data/examples/islr/ch6.spec.rb +24 -1
- data/examples/islr/x_y_rnorm.jpg +0 -0
- data/examples/latex_templates/Test-acm_article/Makefile +16 -0
- data/examples/latex_templates/Test-acm_article/Test-acm_article.Rmd +65 -0
- data/examples/latex_templates/Test-acm_article/acm_proc_article-sp.cls +1670 -0
- data/examples/latex_templates/Test-acm_article/sensys-abstract.cls +703 -0
- data/examples/latex_templates/Test-acm_article/sigproc.bib +59 -0
- data/examples/latex_templates/Test-acs_article/Test-acs_article.Rmd +260 -0
- data/examples/latex_templates/Test-acs_article/acs-Test-acs_article.bib +11 -0
- data/examples/latex_templates/Test-acs_article/acs-my_output.bib +11 -0
- data/examples/latex_templates/Test-acs_article/acstest.bib +17 -0
- data/examples/latex_templates/Test-aea_article/AEA.cls +1414 -0
- data/{blogs/gknit/marshal.dump → examples/latex_templates/Test-aea_article/BibFile.bib} +0 -0
- data/examples/latex_templates/Test-aea_article/Test-aea_article.Rmd +108 -0
- data/examples/latex_templates/Test-aea_article/aea.bst +1269 -0
- data/examples/latex_templates/Test-aea_article/multicol.sty +853 -0
- data/examples/latex_templates/Test-aea_article/references.bib +0 -0
- data/examples/latex_templates/Test-aea_article/setspace.sty +546 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.Rmd +256 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.pdfsync +3397 -0
- data/examples/latex_templates/Test-ams_article/Test-ams_article.Rmd +215 -0
- data/examples/latex_templates/Test-ams_article/amstest.bib +436 -0
- data/examples/latex_templates/Test-asa_article/Test-asa_article.Rmd +153 -0
- data/examples/latex_templates/Test-asa_article/agsm.bst +1353 -0
- data/examples/latex_templates/Test-asa_article/bibliography.bib +233 -0
- data/examples/latex_templates/Test-ieee_article/IEEEtran.bst +2409 -0
- data/examples/latex_templates/Test-ieee_article/IEEEtran.cls +6346 -0
- data/examples/latex_templates/Test-ieee_article/Test-ieee_article.Rmd +175 -0
- data/examples/latex_templates/Test-ieee_article/mybibfile.bib +20 -0
- data/examples/latex_templates/Test-rjournal_article/RJournal.sty +335 -0
- data/examples/latex_templates/Test-rjournal_article/RJreferences.bib +18 -0
- data/examples/latex_templates/Test-rjournal_article/Test-rjournal_article.Rmd +52 -0
- data/examples/latex_templates/Test-springer_article/Test-springer_article.Rmd +65 -0
- data/examples/latex_templates/Test-springer_article/bibliography.bib +26 -0
- data/examples/latex_templates/Test-springer_article/spbasic.bst +1658 -0
- data/examples/latex_templates/Test-springer_article/spmpsci.bst +1512 -0
- data/examples/latex_templates/Test-springer_article/spphys.bst +1443 -0
- data/examples/latex_templates/Test-springer_article/svglov3.clo +113 -0
- data/examples/latex_templates/Test-springer_article/svjour3.cls +1431 -0
- data/examples/misc/baseball.csv +0 -0
- data/examples/misc/ggplot.rb +3 -2
- data/examples/misc/moneyball.rb +0 -0
- data/examples/misc/subsetting.rb +0 -0
- data/examples/multithread_shards_to_r/shards_to_r.rb +67 -0
- data/examples/rmarkdown/svm-rmarkdown-anon-ms-example/svm-rmarkdown-anon-ms-example.Rmd +73 -0
- data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.Rmd +382 -0
- data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.Rmd +164 -0
- data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.Rmd +92 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/attend-grade-relationships.csv +482 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.Rmd +280 -0
- data/examples/rmarkdown/svm-xaringan-example/svm-xaringan-example.Rmd +386 -0
- data/examples/sthda_ggplot/README.md +0 -0
- data/examples/sthda_ggplot/RUN.md +41 -0
- data/examples/sthda_ggplot/all.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/density_gg.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_area.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_density.rb +2 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_dotplot.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_freqpoly.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_histogram.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/histogram_density.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/stat.rb +0 -0
- data/examples/sthda_ggplot/one_variable_discrete/bar.rb +0 -0
- data/examples/sthda_ggplot/qplots/box_violin_dot.rb +0 -0
- data/examples/sthda_ggplot/qplots/scatter_plots.rb +0 -0
- data/examples/sthda_ggplot/scatter_gg.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_bin2d.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_density2d.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_hex.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_point.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_smooth.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/misc.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_function/geom_area.rb +4 -3
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_bar.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_boxplot.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_dotplot.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_jitter.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_line.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_violin.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_disc/geom_jitter.rb +0 -0
- data/examples/sthda_ggplot/two_variables_error/geom_crossbar.rb +0 -0
- data/ext/new_bridge/Makefile +46 -0
- data/ext/new_bridge/galaaz_gatekeeper_phase0.cpp +12 -0
- data/ext/new_bridge/galaaz_gatekeeper_phase1.cpp +1639 -0
- data/lib/R_interface/galaaz_device.R +20 -0
- data/lib/R_interface/include_engine.R +109 -0
- data/lib/R_interface/new_bridge_adapter.rb +824 -0
- data/lib/R_interface/r.rb +177 -25
- data/lib/R_interface/r_arrow.rb +113 -0
- data/lib/R_interface/r_libs.R +4 -4
- data/lib/R_interface/r_methods.rb +13 -116
- data/lib/R_interface/r_module_s.rb +0 -0
- data/lib/R_interface/rbinary_operators.rb +20 -2
- data/lib/R_interface/rclosure.rb +5 -1
- data/lib/R_interface/rdata_frame.rb +34 -70
- data/lib/R_interface/rdevice.rb +125 -0
- data/lib/R_interface/rdevices.R +0 -0
- data/lib/R_interface/renvironment.rb +10 -4
- data/lib/R_interface/rexpression.rb +5 -1
- data/lib/R_interface/rindexed_object.rb +41 -13
- data/lib/R_interface/rlanguage.rb +20 -62
- data/lib/R_interface/rlist.rb +115 -25
- data/lib/R_interface/rlogical_operators.rb +0 -0
- data/lib/R_interface/rmatrix.rb +2 -11
- data/lib/R_interface/rmd_indexed_object.rb +5 -1
- data/lib/R_interface/robject.rb +348 -290
- data/lib/R_interface/rpkg.rb +1 -0
- data/lib/R_interface/rsupport.rb +610 -331
- data/lib/R_interface/rsupport_scope.rb +2 -1
- data/lib/R_interface/rsymbol.rb +50 -0
- data/lib/R_interface/ruby_callback.rb +2 -3
- data/lib/R_interface/ruby_extensions.rb +225 -175
- data/lib/R_interface/runary_operators.rb +0 -0
- data/lib/R_interface/rvector.rb +147 -31
- data/lib/galaaz.rb +0 -0
- data/lib/galaaz_jruby.rb +22 -0
- data/lib/gknit/diagnostics.rb +50 -0
- data/lib/gknit/draft.rb +111 -0
- data/lib/gknit/include_engine.rb +15 -7
- data/lib/gknit/knitr_engine.rb +223 -107
- data/lib/gknit/rb_engine.rb +3 -3
- data/lib/gknit/ruby_engine.rb +0 -0
- data/lib/gknit.rb +3 -0
- data/lib/new_bridge/bootstrap/windows_bootstrap.rb +285 -0
- data/lib/new_bridge/envelope.rb +51 -0
- data/lib/new_bridge/eval_result.rb +26 -0
- data/lib/new_bridge/framing.rb +39 -0
- data/lib/new_bridge/instance_pool_client.rb +38 -0
- data/lib/new_bridge/r_instance_manager.rb +404 -0
- data/lib/new_bridge/session_client.rb +530 -0
- data/lib/new_bridge/tcp_framed.rb +44 -0
- data/lib/new_bridge.rb +9 -0
- data/lib/util/exec_ruby.rb +95 -46
- data/lib/util/inline_file.rb +35 -30
- data/new_bridge_specs/benchmark_phase5_5_unboxing_spec.rb +96 -0
- data/new_bridge_specs/eval_r_async_spec.rb +113 -0
- data/new_bridge_specs/integration_phase5_1_concurrent_spec.rb +50 -0
- data/new_bridge_specs/integration_phase5_1_eval_spec.rb +16 -0
- data/new_bridge_specs/integration_phase5_1_r_api_spec.rb +25 -0
- data/new_bridge_specs/integration_phase5_1_smoke_spec.rb +31 -0
- data/new_bridge_specs/integration_phase5_2_dataframe_unboxing_spec.rb +19 -0
- data/new_bridge_specs/integration_phase5_2_handle_eval_unboxing_spec.rb +25 -0
- data/new_bridge_specs/integration_phase5_3_callback_args_spec.rb +28 -0
- data/new_bridge_specs/integration_phase5_3_callback_error_spec.rb +22 -0
- data/new_bridge_specs/integration_phase5_3_callback_timeout_spec.rb +28 -0
- data/new_bridge_specs/integration_phase5_3_callbacks_smoke_spec.rb +22 -0
- data/new_bridge_specs/integration_phase5_3_edge_cases_spec.rb +52 -0
- data/new_bridge_specs/integration_phase5_3_nested_spec.rb +30 -0
- data/new_bridge_specs/integration_phase5_4_concurrent_sessions_spec.rb +53 -0
- data/new_bridge_specs/integration_phase5_4_nested_session_callbacks_spec.rb +49 -0
- data/new_bridge_specs/integration_phase5_4_session_routing_spec.rb +38 -0
- data/new_bridge_specs/integration_phase5_5_stress_concurrency_spec.rb +52 -0
- data/new_bridge_specs/integration_phase5_5_unbox_walk_spec.rb +46 -0
- data/new_bridge_specs/phase0_protocol_spec.rb +96 -0
- data/new_bridge_specs/phase1_req_ret_spec.rb +66 -0
- data/new_bridge_specs/phase2_multi_instance_spec.rb +67 -0
- data/new_bridge_specs/phase3_callbacks_spec.rb +71 -0
- data/new_bridge_specs/phase4_2_hardening_spec.rb +252 -0
- data/new_bridge_specs/phase4_3_r_instance_manager_spec.rb +85 -0
- data/new_bridge_specs/phase4_nested_callbacks_spec.rb +123 -0
- data/r_requires/ggplot.rb +0 -0
- data/r_requires/knitr.rb +0 -0
- data/specs/all.rb +15 -11
- data/specs/arrow_from_ruby_batches_spec.rb +50 -0
- data/specs/arrow_semantics_spec.rb +64 -0
- data/specs/bridge_concurrent_spec.rb +46 -0
- data/specs/bridge_nested_spec.rb +25 -0
- data/specs/dataframe_semantics_spec.rb +122 -0
- data/specs/dataframe_single_index_logical_filter_spec.rb +21 -0
- data/specs/dispatch_probe_cache_spec.rb +38 -0
- data/specs/dispatch_probe_error_class_fallback_spec.rb +20 -0
- data/specs/dispatch_probe_fallback_spec.rb +18 -0
- data/specs/environment_semantics_spec.rb +89 -0
- data/specs/field_access_spec.rb +31 -0
- data/specs/figures/bg.jpeg +0 -0
- data/specs/figures/bg.png +0 -0
- data/specs/figures/bg.svg +168 -57
- data/specs/figures/dose_len.png +0 -0
- data/specs/figures/no_args.jpeg +0 -0
- data/specs/figures/no_args.png +0 -0
- data/specs/figures/no_args.svg +168 -57
- data/specs/figures/width_height.jpeg +0 -0
- data/specs/figures/width_height.png +0 -0
- data/specs/figures/width_height_units1.jpeg +0 -0
- data/specs/figures/width_height_units1.png +0 -0
- data/specs/figures/width_height_units2.jpeg +0 -0
- data/specs/figures/width_height_units2.png +0 -0
- data/specs/formula_semantics_spec.rb +81 -0
- data/specs/galaaz_util_exec_ruby_spec.rb +85 -0
- data/specs/galaaz_util_inline_file_spec.rb +54 -0
- data/specs/gknit_cli_option_permutation_spec.rb +24 -0
- data/specs/gknit_include_engine_spec.rb +72 -0
- data/specs/gknit_install_timeout_report_spec.rb +69 -0
- data/specs/gknit_internal_error_report_spec.rb +57 -0
- data/specs/gknit_vector_map_output_spec.rb +59 -0
- data/specs/globalenv_guardrail_spec.rb +52 -0
- data/specs/language_expression_semantics_spec.rb +145 -0
- data/specs/list_semantics_spec.rb +111 -0
- data/specs/new_bridge_bulk_dataframe_transfer_spec.rb +44 -0
- data/specs/new_bridge_bulk_vector_transfer_spec.rb +73 -0
- data/specs/new_bridge_callback_timeout_spec.rb +69 -0
- data/specs/new_bridge_eval_r_fallback_spec.rb +55 -0
- data/specs/nil_null_spec.rb +42 -0
- data/specs/object_build_phase2_spec.rb +53 -0
- data/specs/phase1_callback_bridge_spec.rb +84 -0
- data/specs/phase2_gknit_generic_rendering_guardrail_spec.rb +46 -0
- data/specs/phase2_gknit_no_raw_code_leakage_spec.rb +43 -0
- data/specs/phase3_gknit_generic_graphics_capture_spec.rb +71 -0
- data/specs/plot_device_semantics_spec.rb +28 -0
- data/specs/plot_snapshot_semantics_spec.rb +58 -0
- data/specs/protocol_result_spec.rb +236 -0
- data/specs/r_batch_fail_fast_spec.rb +47 -0
- data/specs/r_bridge_bootstrap_spec.rb +11 -0
- data/specs/r_devices.spec.rb +1 -1
- data/specs/r_eval.spec.rb +16 -18
- data/specs/r_function.spec.rb +1 -1
- data/specs/r_instance_manager_spec.rb +285 -0
- data/specs/r_list_apply.spec.rb +15 -15
- data/specs/r_matrix.spec.rb +0 -0
- data/specs/r_nse.spec.rb +5 -5
- data/specs/r_object_send_dispatch_spec.rb +13 -0
- data/specs/r_vector_comparator_spec.rb +8 -0
- data/specs/r_vector_creation.spec.rb +0 -0
- data/specs/r_vector_functions.spec.rb +0 -0
- data/specs/r_vector_object.spec.rb +0 -0
- data/specs/r_vector_operators.spec.rb +0 -0
- data/specs/r_vector_structured_scalar_reads_spec.rb +35 -0
- data/specs/r_vector_subsetting.spec.rb +0 -0
- data/specs/range_helper_spec.rb +21 -0
- data/specs/rsupport_scope_spec.rb +28 -0
- data/specs/rsupport_var_name_thread_safety_spec.rb +24 -0
- data/specs/scalar_character_spec.rb +44 -0
- data/specs/scoped_symbol_dsl_refinement_spec.rb +40 -0
- data/specs/session_env_bridge_spec.rb +25 -0
- data/specs/simplecov_bootstrap_spec.rb +10 -0
- data/specs/spec_helper.rb +10 -0
- data/specs/tmp.rb +41 -20
- data/specs/unboxing_recursion_regression_spec.rb +30 -0
- data/specs/unboxing_spec.rb +49 -0
- data/specs/verify_callbacks.rb +42 -0
- data/sty/galaaz.sty +0 -0
- data/version.rb +1 -1
- metadata +239 -71
- data/blogs/galaaz_ggplot/galaaz_ggplot.aux +0 -41
- data/blogs/galaaz_ggplot/galaaz_ggplot.html +0 -705
- data/blogs/galaaz_ggplot/galaaz_ggplot.out +0 -10
- data/blogs/galaaz_ggplot/galaaz_ggplot.pdf +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-latex/midwest_rb.pdf +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-latex/scatter_plot_rb.pdf +0 -0
- data/blogs/galaaz_ggplot/midwest.html +0 -188
- data/blogs/gknit/gknit.html +0 -2266
- data/blogs/gknit/gknit.pdf +0 -0
- data/blogs/gknit/gknit.tex +0 -1358
- data/blogs/manual/graph.rb +0 -29
- data/blogs/manual/manual.html +0 -2995
- data/blogs/manual/manual.pdf +0 -0
- data/blogs/manual/manual_files/figure-latex/diverging_bar.pdf +0 -0
- data/blogs/nse_dplyr/nse_dplyr.html +0 -960
- data/blogs/nse_dplyr/nse_dplyr.pdf +0 -0
- data/blogs/nse_dplyr/nse_dplyr.tex +0 -1373
- data/blogs/oh_my/oh_my.html +0 -680
- data/blogs/ruby_plot/ruby_plot.Rmd_external_figs +0 -662
- data/blogs/ruby_plot/ruby_plot.html +0 -729
- data/blogs/ruby_plot/ruby_plot.pdf +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.svg +0 -57
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.svg +0 -106
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.svg +0 -110
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.svg +0 -174
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.svg +0 -236
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.svg +0 -296
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.svg +0 -236
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.svg +0 -218
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.svg +0 -128
- data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.svg +0 -150
- data/examples/paper/paper.rb +0 -36
- data/specs/r_dataframe.spec.rb +0 -379
- data/specs/r_environment.spec.rb +0 -140
- data/specs/r_formula.spec.rb +0 -232
- data/specs/r_language.spec.rb +0 -112
- data/specs/r_list.spec.rb +0 -293
- data/specs/r_plots.spec.rb +0 -72
- data/specs/ruby_expression.spec.rb +0 -315
data/bin/gknit-draft
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# coding: utf-8
|
|
3
|
+
|
|
4
|
+
##########################################################################################
|
|
5
|
+
# @author Rodrigo Botafogo
|
|
6
|
+
#
|
|
7
|
+
# Copyright © 2018 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
|
8
|
+
# and distribute this software and its documentation, without fee and without a signed
|
|
9
|
+
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
|
10
|
+
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
|
11
|
+
# distributions.
|
|
12
|
+
#
|
|
13
|
+
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
|
14
|
+
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
|
15
|
+
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
|
16
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
+
#
|
|
18
|
+
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
19
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
|
20
|
+
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
|
21
|
+
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
|
22
|
+
# OR MODIFICATIONS.
|
|
23
|
+
##########################################################################################
|
|
24
|
+
|
|
25
|
+
require 'optionparser'
|
|
26
|
+
|
|
27
|
+
options = {}
|
|
28
|
+
|
|
29
|
+
OptionParser.new do |opts|
|
|
30
|
+
opts.banner = "Usage: gknit-draft [options] [path]"
|
|
31
|
+
opts.on("-f", "--filename FILE", "Directory and filename to create") do |opt|
|
|
32
|
+
options[:file] = opt
|
|
33
|
+
end
|
|
34
|
+
opts.on("-t", "--template TEMPLATE", "Latex template to use") do |opt|
|
|
35
|
+
options[:template] = opt
|
|
36
|
+
end
|
|
37
|
+
opts.on("-p", "--package PACKAGE", "R Package where the template is defined") do |opt|
|
|
38
|
+
options[:package] = opt
|
|
39
|
+
end
|
|
40
|
+
opts.on("-g", "--gem RubyGem", "Ruby Gem where the template is defined") do |opt|
|
|
41
|
+
options[:gem] = opt
|
|
42
|
+
end
|
|
43
|
+
opts.on("-n", "--no_dir", "If a new directory should not be created") do |opt|
|
|
44
|
+
options[:no_dir] = opt
|
|
45
|
+
end
|
|
46
|
+
opts.on("-e", "--edit EDITOR", "Editor to use to edit the file") do |opt|
|
|
47
|
+
options[:editor] = opt
|
|
48
|
+
end
|
|
49
|
+
end.parse!
|
|
50
|
+
|
|
51
|
+
#=========================================================================================
|
|
52
|
+
# Only one of 'package' or 'gem' can be given
|
|
53
|
+
#=========================================================================================
|
|
54
|
+
|
|
55
|
+
raise "You should either specify an R package or Ruby Gem where the template is defined" if
|
|
56
|
+
!options[:package].nil? && !options[:gem].nil?
|
|
57
|
+
|
|
58
|
+
#=========================================================================================
|
|
59
|
+
# If gem given, then set it as the package name
|
|
60
|
+
#=========================================================================================
|
|
61
|
+
|
|
62
|
+
is_r_package = (options[:package].nil?)? false : true
|
|
63
|
+
options[:package] =
|
|
64
|
+
(!options[:gem].nil?)? "%Q(#{options[:gem]})" : "%Q(#{options[:package]})"
|
|
65
|
+
|
|
66
|
+
#=========================================================================================
|
|
67
|
+
#
|
|
68
|
+
#=========================================================================================
|
|
69
|
+
|
|
70
|
+
options[:no_dir] = (options[:no_dir].nil?)? true : false
|
|
71
|
+
|
|
72
|
+
#=========================================================================================
|
|
73
|
+
#
|
|
74
|
+
#=========================================================================================
|
|
75
|
+
|
|
76
|
+
Dir.chdir(File.dirname(File.expand_path('.', __FILE__)))
|
|
77
|
+
|
|
78
|
+
options[:file] = "%Q(#{options[:file]}-#{options[:template]})"
|
|
79
|
+
|
|
80
|
+
code = <<-Ruby
|
|
81
|
+
require 'gknit'
|
|
82
|
+
R.install_and_loads 'xfun'
|
|
83
|
+
|
|
84
|
+
GKnit.draft(file: #{options[:file]}, template: %Q(#{options[:template]}),
|
|
85
|
+
package: #{options[:package]}, create_dir: #{options[:no_dir]},
|
|
86
|
+
is_package: #{is_r_package}, edit: true)
|
|
87
|
+
Ruby
|
|
88
|
+
|
|
89
|
+
libx = File.expand_path('../../lib', __FILE__)
|
|
90
|
+
exec %Q(ruby --polyglot --jvm -I#{libx} -e "#{code}")
|
|
91
|
+
|
|
92
|
+
# exec %Q(ruby --polyglot --jvm --experimental-options --single-threaded -I../lib -e "#{code}")
|
|
93
|
+
|
|
94
|
+
=begin
|
|
95
|
+
puts "=========="
|
|
96
|
+
full_filename = Dir.glob("gknit-templates*", base: "#{Gem.default_dir}/gems")
|
|
97
|
+
template_path = "#{Gem.default_dir}/gems/#{full_filename[0]/rmarkdown/templates/}"
|
|
98
|
+
puts template_path
|
|
99
|
+
puts "=========="
|
|
100
|
+
=end
|
|
101
|
+
|
|
102
|
+
#puts %Q(ruby --polyglot --jvm --experimental-options --single-threaded -I../lib -e "#{code}")
|
|
103
|
+
|
|
104
|
+
#exec "ruby --polyglot --jvm --experimental-options --single-threaded \
|
|
105
|
+
#-I../lib -S ./gknit-draft.rb #{options[:file]} #{options[:template]} #{options[:package]} #{options[:create_#dir]} #{is_r_package} #{options[:editor]}"
|
data/bin/gknit-draft.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
##########################################################################################
|
|
3
|
+
# @author Rodrigo Botafogo
|
|
4
|
+
#
|
|
5
|
+
# Copyright © 2018 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
|
6
|
+
# and distribute this software and its documentation, without fee and without a signed
|
|
7
|
+
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
|
8
|
+
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
|
9
|
+
# distributions.
|
|
10
|
+
#
|
|
11
|
+
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
|
12
|
+
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
|
13
|
+
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
|
14
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
15
|
+
#
|
|
16
|
+
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
17
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
|
18
|
+
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
|
19
|
+
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
|
20
|
+
# OR MODIFICATIONS.
|
|
21
|
+
##########################################################################################
|
|
22
|
+
|
|
23
|
+
require 'gknit'
|
|
24
|
+
|
|
25
|
+
R.install_and_loads 'xfun'
|
|
26
|
+
|
|
27
|
+
GKnit.draft(file: ARGV[0], template: ARGV[1], package: ARGV[2],
|
|
28
|
+
create_dir: ARGV[3], is_package: ARGV[4], edit: ARGV[5])
|
data/bin/gknit_Rscript
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# coding: utf-8
|
|
3
|
+
|
|
4
|
+
require 'optionparser'
|
|
5
|
+
|
|
6
|
+
options = {}
|
|
7
|
+
|
|
8
|
+
OptionParser.new do |opts|
|
|
9
|
+
opts.banner = "Usage: gknit [options]"
|
|
10
|
+
opts.on("-f", "--filename FILE", "The input file to be rendered. This value can also be provided without the '-f' or '--filename' flag by just giving the name of the file as an input parameter.") do |opt|
|
|
11
|
+
options[:input_file] = opt
|
|
12
|
+
end
|
|
13
|
+
opts.on("--output_format OUT_FORMAT", "The R Markdown output format to convert to. The option 'all' will render all formats defined within the file. The option can be the name of a format (e.g. 'html_document') and that will render the document to that single format. One can also use a vector of format names to render to multiple formats. Alternatively, you can pass an output format object (e.g. html_document()). If using NULL then the output format is the first one defined in the YAML frontmatter in the input file (this defaults to HTML if no format is specified there).") do |opt|
|
|
14
|
+
options[:output_format] = opt
|
|
15
|
+
end
|
|
16
|
+
opts.on("-o", "--output_file OUT_FILE", "The name of the output file. If using nil then the output filename will be based on filename for the input file. If a filename is provided, a path to the output file can also be provided. Note that the output_dir option allows for specifying the output file path as well, however, if also specifying the path, the directory must exist.") do |opt|
|
|
17
|
+
options[:output_file] = opt
|
|
18
|
+
end
|
|
19
|
+
opts.on("-d", "--output_dir OUT_DIR", "The output directory for the rendered output_file. This allows for a choice of an alternate directory to which the output file should be written (the default output directory is that of the input file). If a path is provided with a filename in output_file the directory specified here will take precedence. Please note that any directory path provided will create any necessary directories if they do not exist.") do |opt|
|
|
20
|
+
options[:output_dir] = opt
|
|
21
|
+
end
|
|
22
|
+
opts.on("-a", "--output_options OUT_OPT", "List of output options that can override the options specified in metadata (e.g. could be used to force self_contained or mathjax = 'local'). Note that this is only valid when the output format is read from metadata (i.e. not a custom format object passed to output_format).") do |opt|
|
|
23
|
+
options[:output_options] = opt
|
|
24
|
+
end
|
|
25
|
+
opts.on("-i", "--intermediates_dir INTER_DIR", "FEATURE NOT YET IMPLEMENTED! Intermediate files directory. If a path is specified then intermediate files will be written to that path. If nil, intermediate files are written to the same directory as the input file.") do |opt|
|
|
26
|
+
options[:intermediates_dir] = opt
|
|
27
|
+
end
|
|
28
|
+
opts.on("-n", "--no_clean", "Will not clean intermediate files that are created during rendering.") do |opt|
|
|
29
|
+
options[:clean] = opt
|
|
30
|
+
end
|
|
31
|
+
end.parse!
|
|
32
|
+
|
|
33
|
+
# Sets the directory
|
|
34
|
+
dir = Dir.pwd
|
|
35
|
+
|
|
36
|
+
#=========================================================================================
|
|
37
|
+
# Check if the name of the file to gKnit was given and that it exists. If not,
|
|
38
|
+
# issue error.
|
|
39
|
+
#=========================================================================================
|
|
40
|
+
|
|
41
|
+
options[:input_file] = ARGV[0] if !ARGV[0].nil?
|
|
42
|
+
raise "Input file name is required for gKnitting. Add -f FILE or --input_file FILE. For help, type gknit -h" if
|
|
43
|
+
options[:input_file].nil?
|
|
44
|
+
options[:input_file] = "#{dir}/#{options[:input_file]}"
|
|
45
|
+
raise "File #{options[:input_file]} does not exist!" if !File.exist?(options[:input_file])
|
|
46
|
+
|
|
47
|
+
#=========================================================================================
|
|
48
|
+
# Checks the output_format option. If none, pass NULL to the render function. Output
|
|
49
|
+
# format needs to be quoted.
|
|
50
|
+
#=========================================================================================
|
|
51
|
+
|
|
52
|
+
options[:output_format] =
|
|
53
|
+
(options[:output_format].nil?)? "NULL" : "\"#{options[:output_format]}\""
|
|
54
|
+
|
|
55
|
+
#=========================================================================================
|
|
56
|
+
# Checks the output_file option. If none, pass NULL to the render function. Output
|
|
57
|
+
# file name needs to be quoted.
|
|
58
|
+
#=========================================================================================
|
|
59
|
+
|
|
60
|
+
options[:output_file] =
|
|
61
|
+
(options[:output_file].nil?)? "NULL" : "\"#{options[:output_file]}\""
|
|
62
|
+
|
|
63
|
+
#=========================================================================================
|
|
64
|
+
# Checks if an output directory was given. If given and directory does not exist,
|
|
65
|
+
# create the directory. If no directory given, pass NULL to the render function.
|
|
66
|
+
#=========================================================================================
|
|
67
|
+
|
|
68
|
+
if (!options[:output_dir].nil?)
|
|
69
|
+
Dir.mkdir(options[:output_dir]) if !Dir.exist?(options[:output_dir])
|
|
70
|
+
options[:output_dir] = "\"#{options[:output_dir]}\""
|
|
71
|
+
else
|
|
72
|
+
# If not, pass NULL to the render function
|
|
73
|
+
options[:output_dir] = "NULL"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
#=========================================================================================
|
|
77
|
+
# Checks if any intermediate directory given. If not, pass NULL to the render function
|
|
78
|
+
# Calling render with options intermediates_dir is not working, requires further study
|
|
79
|
+
#=========================================================================================
|
|
80
|
+
|
|
81
|
+
if (!options[:intermediates_dir].nil?)
|
|
82
|
+
if !Dir.exist?(options[:intermediates_dir])
|
|
83
|
+
Dir.mkdir(options[:intermediates_dir])
|
|
84
|
+
options[:intermediates_dir] = "\"#{options[:intermediates_dir]}\""
|
|
85
|
+
else
|
|
86
|
+
options[:intermediates_dir] = "\"#{options[:intermediates_dir]}\""
|
|
87
|
+
end
|
|
88
|
+
else
|
|
89
|
+
options[:intermediates_dir] = "NULL"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
options[:clean] = (options[:clean].nil?)? "TRUE" : "FALSE"
|
|
93
|
+
|
|
94
|
+
#=========================================================================================
|
|
95
|
+
# Sends message to user that the gKniting process has started
|
|
96
|
+
#=========================================================================================
|
|
97
|
+
puts "================================"
|
|
98
|
+
puts "gKnitting #{options[:input_file]} with the following options:"
|
|
99
|
+
puts " * Output format: \t #{options[:output_format]}"
|
|
100
|
+
puts " * Output file: \t #{options[:output_file]}"
|
|
101
|
+
puts " * Output directory: \t #{options[:output_dir]}"
|
|
102
|
+
puts " * Clean: \t\t #{options[:clean]}"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Code to be evaluated by the R script
|
|
106
|
+
code = <<EOF
|
|
107
|
+
eval.polyglot("ruby", "$LOAD_PATH.unshift %q(/home/rbotafogo/desenv/galaaz/lib)")
|
|
108
|
+
eval.polyglot("ruby", "require %q(gknit)")
|
|
109
|
+
|
|
110
|
+
rmarkdown::render("#{options[:input_file]}", output_format = #{options[:output_format]},
|
|
111
|
+
output_file = #{options[:output_file]},
|
|
112
|
+
output_dir = #{options[:output_dir]},
|
|
113
|
+
clean = #{options[:clean]})
|
|
114
|
+
EOF
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
exec "Rscript --jvm --polyglot -e '#{code}'"
|
|
118
|
+
|
|
119
|
+
=begin
|
|
120
|
+
# how to call rmarkdown::render with a parameter list
|
|
121
|
+
# all params need to be defined in the YAML header
|
|
122
|
+
rmarkdown::render("#{options[:input_file]}", output_format = #{options[:output_format]},
|
|
123
|
+
output_file = #{options[:output_file]},
|
|
124
|
+
output_dir = #{options[:output_dir]},
|
|
125
|
+
clean = #{options[:clean]},
|
|
126
|
+
params = list(rake_clean = TRUE))
|
|
127
|
+
=end
|
data/bin/grun
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# coding: utf-8
|
|
3
|
+
|
|
4
|
+
##########################################################################################
|
|
5
|
+
# @author Rodrigo Botafogo
|
|
6
|
+
#
|
|
7
|
+
# Copyright © 2018 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
|
8
|
+
# and distribute this software and its documentation, without fee and without a signed
|
|
9
|
+
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
|
10
|
+
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
|
11
|
+
# distributions.
|
|
12
|
+
#
|
|
13
|
+
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
|
14
|
+
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
|
15
|
+
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
|
16
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
+
#
|
|
18
|
+
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
19
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
|
20
|
+
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
|
21
|
+
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
|
22
|
+
# OR MODIFICATIONS.
|
|
23
|
+
##########################################################################################
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
libx = File.expand_path('../../lib', __FILE__)
|
|
27
|
+
exec "ruby --polyglot --jvm -I#{libx} -S #{ARGV[0]}"
|
|
2
28
|
|
|
3
29
|
# Dir.chdir(File.dirname(File.expand_path('.', __FILE__)))
|
|
30
|
+
# exec "ruby --polyglot --jvm --experimental-options --single-threaded -I../lib -S #{ARGV[0]}"
|
|
4
31
|
|
|
5
|
-
exec "ruby --polyglot --jvm --experimental-options --single-threaded -S #{ARGV[0]}"
|
data/bin/gstudio
CHANGED
|
@@ -1,8 +1,53 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# coding: utf-8
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
##########################################################################################
|
|
5
|
+
# @author Rodrigo Botafogo
|
|
6
|
+
#
|
|
7
|
+
# Copyright © 2018 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
|
8
|
+
# and distribute this software and its documentation, without fee and without a signed
|
|
9
|
+
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
|
10
|
+
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
|
11
|
+
# distributions.
|
|
12
|
+
#
|
|
13
|
+
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
|
14
|
+
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
|
15
|
+
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
|
16
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
+
#
|
|
18
|
+
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
19
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
|
20
|
+
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
|
21
|
+
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
|
22
|
+
# OR MODIFICATIONS.
|
|
23
|
+
##########################################################################################
|
|
4
24
|
|
|
5
|
-
|
|
25
|
+
require 'optionparser'
|
|
26
|
+
require 'shellwords'
|
|
6
27
|
|
|
7
|
-
|
|
8
|
-
|
|
28
|
+
options = {}
|
|
29
|
+
|
|
30
|
+
OptionParser.new do |opts|
|
|
31
|
+
opts.banner = "Usage: gknit-draft [options] [path]"
|
|
32
|
+
opts.on("-i", "--irb", "Use IRB as shell") do |opt|
|
|
33
|
+
options[:irb] = opt
|
|
34
|
+
end
|
|
35
|
+
opts.on("-p", "--pry", "Use PRY as shell") do |opt|
|
|
36
|
+
options[:pry] = opt
|
|
37
|
+
end
|
|
38
|
+
end.parse!
|
|
39
|
+
|
|
40
|
+
# Dir.chdir(File.dirname(File.expand_path('.', __FILE__)))
|
|
41
|
+
|
|
42
|
+
bin_dir = File.expand_path('..', __FILE__)
|
|
43
|
+
libx = File.expand_path('../../lib', __FILE__)
|
|
44
|
+
require File.join(libx, 'galaaz_jruby')
|
|
45
|
+
jvm_args = GalaazJRuby.shell_j_arg_string
|
|
46
|
+
|
|
47
|
+
if options[:pry]
|
|
48
|
+
puts "Loading PRY and Galaaz... Please wait!"
|
|
49
|
+
exec "jruby #{jvm_args} -I#{Shellwords.escape(libx)} -S pry -r #{Shellwords.escape(File.join(bin_dir, 'gstudio_pry.rb'))}"
|
|
50
|
+
else
|
|
51
|
+
puts "Loading IRB and Galaaz... Please wait!"
|
|
52
|
+
exec "jruby #{jvm_args} -I#{Shellwords.escape(libx)} -S irb -r #{Shellwords.escape(File.join(bin_dir, 'gstudio_irb.rb'))}"
|
|
53
|
+
end
|
|
File without changes
|
data/bin/gstudio_pry.rb
ADDED
data/bin/install-tinytex
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Install TinyTeX to ~/.TinyTeX with symlinks in ~/bin (no sudo).
|
|
3
|
+
# Needed for rmarkdown pdf_document and specs/phase2_gknit_chunk_output_spec.rb.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
curl -fsSL https://raw.githubusercontent.com/rstudio/tinytex/master/tools/install-bin-unix.sh | sh
|
|
6
|
+
echo "TinyTeX installed. Ensure ~/bin is on PATH for interactive shells, or rely on the Phase 2 spec prepending it for gknit."
|
data/bin/run_all_rspec
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run default galaaz specs (specs/) and NewBridge gatekeeper specs (new_bridge_specs/)
|
|
3
|
+
# in a single RSpec process so SimpleCov produces one merged report under coverage/.
|
|
4
|
+
#
|
|
5
|
+
# Compiles ext/new_bridge (incremental make) first — required for integration specs.
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# bin/run_all_rspec
|
|
9
|
+
# bin/run_all_rspec --format documentation
|
|
10
|
+
# bin/run_all_rspec new_bridge_specs/phase0_protocol_spec.rb
|
|
11
|
+
#
|
|
12
|
+
# If the first argument is an option (starts with -), default dirs are prepended
|
|
13
|
+
# so `bin/run_all_rspec --format doc` still runs specs/ + new_bridge_specs/.
|
|
14
|
+
#
|
|
15
|
+
# For specs/ only (faster day-to-day): bin/run_rspec
|
|
16
|
+
set -e
|
|
17
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
18
|
+
# shellcheck source=galaaz_jruby_env.inc.sh
|
|
19
|
+
source "$ROOT/bin/galaaz_jruby_env.inc.sh"
|
|
20
|
+
|
|
21
|
+
echo "[run_all_rspec] compiling gatekeeper: ext/new_bridge"
|
|
22
|
+
make -C "$ROOT/ext/new_bridge" -s all
|
|
23
|
+
|
|
24
|
+
# Same top-level file set as bin/run_rspec (maxdepth 1), plus whole new_bridge_specs/ tree.
|
|
25
|
+
DEFAULT_SPECS=()
|
|
26
|
+
while IFS= read -r f; do
|
|
27
|
+
DEFAULT_SPECS+=("$f")
|
|
28
|
+
done < <(find "$ROOT/specs" -maxdepth 1 -type f \( -name '*_spec.rb' -o -name '*.spec.rb' \) | sort)
|
|
29
|
+
DEFAULT_SPECS+=( "$ROOT/new_bridge_specs" )
|
|
30
|
+
|
|
31
|
+
# With no args, run those paths. If args are only RSpec options (e.g. --format progress),
|
|
32
|
+
# prepend defaults so flags alone do not mean "run zero files".
|
|
33
|
+
if [ $# -eq 0 ]; then
|
|
34
|
+
set -- "${DEFAULT_SPECS[@]}"
|
|
35
|
+
elif [[ "${1:-}" == -* ]]; then
|
|
36
|
+
set -- "${DEFAULT_SPECS[@]}" "$@"
|
|
37
|
+
fi
|
|
38
|
+
exec jruby -I "$ROOT/lib" \
|
|
39
|
+
$GALAAZ_REQUIRED_JRUBY_J_ARGS \
|
|
40
|
+
${GALAAZ_JRUBY_OPTS:-} \
|
|
41
|
+
-S bundle exec rspec \
|
|
42
|
+
-r "$ROOT/specs/spec_helper.rb" \
|
|
43
|
+
"$@"
|
data/bin/run_example
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run a Galaaz example with required JRuby JVM flags (lib/galaaz_jruby.rb).
|
|
3
|
+
# Optional: GALAAZ_JRUBY_OPTS.
|
|
4
|
+
#
|
|
5
|
+
# Usage: bin/run_example examples/sthda_ggplot/all.rb
|
|
6
|
+
# bin/run_example examples/sthda_ggplot/one_variable_continuous/geom_density.rb
|
|
7
|
+
set -e
|
|
8
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
9
|
+
# shellcheck source=galaaz_jruby_env.inc.sh
|
|
10
|
+
source "$ROOT/bin/galaaz_jruby_env.inc.sh"
|
|
11
|
+
exec jruby -I "$ROOT/lib" \
|
|
12
|
+
$GALAAZ_REQUIRED_JRUBY_J_ARGS \
|
|
13
|
+
${GALAAZ_JRUBY_OPTS:-} \
|
|
14
|
+
"$@"
|
data/bin/run_old_rspec
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run legacy specs moved to old_specs/.
|
|
3
|
+
# Usage:
|
|
4
|
+
# bin/run_old_rspec
|
|
5
|
+
# bin/run_old_rspec old_specs/r_environment.spec.rb
|
|
6
|
+
set -e
|
|
7
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
8
|
+
# shellcheck source=galaaz_jruby_env.inc.sh
|
|
9
|
+
source "$ROOT/bin/galaaz_jruby_env.inc.sh"
|
|
10
|
+
if [ $# -eq 0 ]; then
|
|
11
|
+
shopt -s nullglob
|
|
12
|
+
SPECS=( "$ROOT"/old_specs/*.spec.rb "$ROOT"/old_specs/*_spec.rb )
|
|
13
|
+
IFS=$'\n' SPECS=( $(printf '%s\n' "${SPECS[@]}" | sort) )
|
|
14
|
+
set -- "${SPECS[@]}"
|
|
15
|
+
fi
|
|
16
|
+
exec jruby -I "$ROOT/lib" \
|
|
17
|
+
$GALAAZ_REQUIRED_JRUBY_J_ARGS \
|
|
18
|
+
${GALAAZ_JRUBY_OPTS:-} \
|
|
19
|
+
-S bundle exec rspec "$@"
|
data/bin/run_rspec
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run rspec with JVM options required for Apache Arrow (see lib/galaaz_jruby.rb).
|
|
3
|
+
# Optional JVM/jruby extras: GALAAZ_JRUBY_OPTS (space-separated).
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# bin/run_rspec # run fast specs in specs/ only
|
|
7
|
+
# bin/run_all_rspec # top-level specs/ + new_bridge_specs/ + gatekeeper compile (see docs/testing.md)
|
|
8
|
+
# bin/run_slow_rspec # run slow specs in slow-specs/
|
|
9
|
+
# bin/run_rspec specs/protocol_result_spec.rb
|
|
10
|
+
# GALAAZ_DEBUG=1 bin/run_rspec specs/r_vector_subsetting.spec.rb:61 ...
|
|
11
|
+
set -e
|
|
12
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
13
|
+
# shellcheck source=galaaz_jruby_env.inc.sh
|
|
14
|
+
source "$ROOT/bin/galaaz_jruby_env.inc.sh"
|
|
15
|
+
if [ $# -eq 0 ]; then
|
|
16
|
+
set -- $(find "$ROOT/specs" -maxdepth 1 -type f \( -name '*_spec.rb' -o -name '*.spec.rb' \) | sort)
|
|
17
|
+
fi
|
|
18
|
+
exec jruby -I "$ROOT/lib" \
|
|
19
|
+
$GALAAZ_REQUIRED_JRUBY_J_ARGS \
|
|
20
|
+
${GALAAZ_JRUBY_OPTS:-} \
|
|
21
|
+
-S bundle exec rspec \
|
|
22
|
+
-r "$ROOT/specs/spec_helper.rb" \
|
|
23
|
+
"$@"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run a small subset of specs (see Documentation/Spec_Subsets.md).
|
|
3
|
+
# Usage: bin/run_rspec_subset <number>
|
|
4
|
+
# Example: bin/run_rspec_subset 1
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
8
|
+
cd "$ROOT"
|
|
9
|
+
|
|
10
|
+
SUBNUM="${1:?Usage: bin/run_rspec_subset <number> [rspec-args...]}"
|
|
11
|
+
[ "$#" -ge 1 ] && shift
|
|
12
|
+
|
|
13
|
+
case "$SUBNUM" in
|
|
14
|
+
1) SPECS="specs/protocol_result_spec.rb" ;;
|
|
15
|
+
2) SPECS="specs/r_vector_creation.spec.rb" ;;
|
|
16
|
+
3) SPECS="specs/r_eval.spec.rb" ;;
|
|
17
|
+
4) SPECS="specs/r_vector_subsetting.spec.rb" ;;
|
|
18
|
+
5) SPECS="specs/r_list.spec.rb" ;;
|
|
19
|
+
6) SPECS="specs/r_vector_operators.spec.rb" ;;
|
|
20
|
+
7) SPECS="specs/r_dataframe.spec.rb" ;;
|
|
21
|
+
8) SPECS="specs/r_matrix.spec.rb" ;;
|
|
22
|
+
9) SPECS="specs/r_vector_object.spec.rb" ;;
|
|
23
|
+
10) SPECS="specs/r_vector_functions.spec.rb" ;;
|
|
24
|
+
11) SPECS="specs/r_language.spec.rb" ;;
|
|
25
|
+
12) SPECS="specs/r_formula.spec.rb" ;;
|
|
26
|
+
13) SPECS="specs/r_function.spec.rb" ;;
|
|
27
|
+
14) SPECS="specs/r_list_apply.spec.rb" ;;
|
|
28
|
+
15) SPECS="specs/r_nse.spec.rb" ;;
|
|
29
|
+
16) SPECS="specs/ruby_expression.spec.rb" ;;
|
|
30
|
+
17) SPECS="specs/r_environment.spec.rb" ;;
|
|
31
|
+
18) SPECS="specs/r_devices.spec.rb specs/r_plots.spec.rb" ;;
|
|
32
|
+
*)
|
|
33
|
+
echo "Unknown subset: $SUBNUM (use 1–18). See Documentation/Spec_Subsets.md"
|
|
34
|
+
exit 1
|
|
35
|
+
;;
|
|
36
|
+
esac
|
|
37
|
+
|
|
38
|
+
exec "$ROOT/bin/run_rspec" $SPECS "$@"
|
data/bin/run_slow_rspec
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run slower rspec suites from slow-specs/.
|
|
3
|
+
# Usage:
|
|
4
|
+
# bin/run_slow_rspec
|
|
5
|
+
# bin/run_slow_rspec slow-specs/phase2_gknit_chunk_output_spec.rb
|
|
6
|
+
set -e
|
|
7
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
8
|
+
# shellcheck source=galaaz_jruby_env.inc.sh
|
|
9
|
+
source "$ROOT/bin/galaaz_jruby_env.inc.sh"
|
|
10
|
+
if [ $# -eq 0 ]; then
|
|
11
|
+
shopt -s nullglob globstar
|
|
12
|
+
SPECS=( "$ROOT"/slow-specs/**/*_spec.rb "$ROOT"/slow-specs/**/*.spec.rb )
|
|
13
|
+
IFS=$'\n' SPECS=( $(printf '%s\n' "${SPECS[@]}" | sort) )
|
|
14
|
+
set -- "${SPECS[@]}"
|
|
15
|
+
fi
|
|
16
|
+
exec jruby -I "$ROOT/lib" \
|
|
17
|
+
$GALAAZ_REQUIRED_JRUBY_J_ARGS \
|
|
18
|
+
${GALAAZ_JRUBY_OPTS:-} \
|
|
19
|
+
-S bundle exec rspec "$@"
|