galaaz 2.0.0 → 2.1.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 +25 -5
- data/README.md +119 -94
- data/Rakefile +17 -10
- data/bin/galaaz-jruby +3 -6
- data/bin/galaaz-ruby +16 -0
- data/bin/galaaz_ruby_env.inc.sh +36 -0
- data/bin/gbookdown +2 -3
- data/bin/gknit +2 -3
- data/bin/gstudio +4 -4
- data/bin/run_all_rspec +6 -5
- data/bin/run_example +10 -7
- data/bin/run_old_rspec +6 -5
- data/bin/run_rspec +9 -8
- data/bin/run_slow_rspec +6 -5
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-gfm/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-gfm/scatter_plot_rb.png +0 -0
- data/blogs/gknit/gknit_files/figure-gfm/bubble-1.png +0 -0
- data/blogs/gknit/gknit_files/figure-gfm/diverging_bar.png +0 -0
- data/blogs/manual/manual.Rmd +22 -19
- data/blogs/manual/manual.md +119 -94
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/violin_with_jitter.png +0 -0
- data/blogs/test/test.md +10 -0
- data/examples/50Plots_MasterList/ScatterPlot.rb +2 -1
- data/examples/50Plots_MasterList/scatter_plot.rb +1 -0
- data/examples/bioconductor_deseq2_airway/bench_galaaz_three_same_process.rb +1 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz.rb +1 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz_optimized.rb +1 -0
- data/examples/islr/all.rb +1 -0
- data/examples/islr/ch2.spec.rb +1 -0
- data/examples/islr/ch3.spec.rb +1 -0
- data/examples/islr/ch3_boston.rb +1 -0
- data/examples/islr/ch3_multiple_regression.rb +1 -0
- data/examples/islr/ch6.spec.rb +1 -0
- data/examples/islr/x_y_rnorm.jpg +0 -0
- data/examples/misc/ggplot.rb +2 -1
- data/examples/misc/moneyball.rb +1 -0
- data/examples/misc/subsetting.rb +1 -0
- data/examples/multithread_shards_to_r/shards_to_r.rb +1 -0
- data/examples/sthda_ggplot/all.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/density_gg.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_area.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_density.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_dotplot.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_freqpoly.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_histogram.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/histogram_density.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/stat.rb +1 -0
- data/examples/sthda_ggplot/one_variable_discrete/bar.rb +1 -0
- data/examples/sthda_ggplot/qplots/box_violin_dot.rb +1 -0
- data/examples/sthda_ggplot/qplots/scatter_plots.rb +1 -0
- data/examples/sthda_ggplot/scatter_gg.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_bin2d.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_density2d.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_hex.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_point.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_smooth.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/misc.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_function/geom_area.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_bar.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_boxplot.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_dotplot.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_jitter.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_line.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_violin.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_disc/geom_jitter.rb +1 -0
- data/examples/sthda_ggplot/two_variables_error/geom_crossbar.rb +1 -0
- data/lib/R_interface/rvector.rb +15 -0
- data/lib/galaaz_ruby.rb +34 -0
- data/lib/new_bridge/envelope.rb +2 -2
- data/specs/gknit_include_engine_spec.rb +2 -2
- data/specs/gknit_install_timeout_report_spec.rb +2 -2
- data/specs/gknit_internal_error_report_spec.rb +2 -2
- data/specs/gknit_vector_map_output_spec.rb +2 -2
- data/version.rb +1 -1
- metadata +39 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0fc6f307a98f073e4ad49a39f5b4fcfddbd948c9054722caea814c16d6be62fa
|
|
4
|
+
data.tar.gz: d899ca8013e16d158cb1c035a3e8d1393b3d377782fad502b09d1e81d9eb868a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a73ce81b2b86550af39562adc7d1566746c5239d0b74688c8d1d1cef52bb5371ab5449cb3dbe3d6b14b2608e1c33e3289937f745a9749c7c425f026a4d8f8659
|
|
7
|
+
data.tar.gz: 3d84d7e16f678ed8b13920585099df2ae641293ae74f65e7920d7bd7ee42c971deaa9c7dd1985343fb2eadf17be582d3922eecf3d20d009bfc45180f762b7b26
|
data/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
Galaaz **2.1** keeps the **galaaz2_0** integration line as the main development branch and marks
|
|
6
|
+
**CRuby + JRuby** NewBridge support as a released milestone (R-on-Rails positioning).
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- First-class **CRuby** NewBridge path alongside JRuby (engine-aware launchers, cold-install /
|
|
11
|
+
CI coverage for both).
|
|
12
|
+
- Docs: treat JRuby and CRuby as equal supported runtimes for the bridge.
|
|
13
|
+
- [Documentation/ROADMAP_ARROW_RUBY_R.md](Documentation/ROADMAP_ARROW_RUBY_R.md) — roadmap for
|
|
14
|
+
Ruby↔R Arrow IPC / mmap handoff (stage B) then shared-memory bus (stage C).
|
|
15
|
+
|
|
16
|
+
### Notes
|
|
17
|
+
|
|
18
|
+
- Git branch **`galaaz2_0`** remains the integration branch name; the gem version is **2.1.0**.
|
|
19
|
+
- Apache Arrow **zero-copy shared RAM** is still future work (see the roadmap); today’s helpers
|
|
20
|
+
build R-side tables after a handoff, then use proxy / Remote Control calls.
|
|
21
|
+
|
|
3
22
|
## 2.0.0
|
|
4
23
|
|
|
5
|
-
Galaaz 2.0 drives **GNU R** from **JRuby** over a process bridge. It is not the older GraalVM / TruffleRuby / FastR stack, and it does not embed Renjin.
|
|
24
|
+
Galaaz 2.0 drives **GNU R** from **JRuby** or **CRuby** over a process bridge. It is not the older GraalVM / TruffleRuby / FastR stack, and it does not embed Renjin. Both Rubies are supported for NewBridge (tested on **JRuby 10.1.1.0** with **Java 21**, and **CRuby 3.3.12**).
|
|
6
25
|
|
|
7
26
|
### Added
|
|
8
27
|
|
|
9
|
-
- NewBridge:
|
|
28
|
+
- NewBridge: Ruby talks to standard GNU R (CRAN / Bioconductor, including compiled packages).
|
|
10
29
|
- Native gatekeeper under `ext/new_bridge` (Rcpp / C++); compile after install with `make -C ext/new_bridge all`.
|
|
11
30
|
- Optional Apache Arrow helpers for large tables on the R side.
|
|
12
31
|
- Rendered manuals, blogs, and examples on [GitHub Pages](https://rbotafogo.github.io/galaaz/).
|
|
13
|
-
- Ubuntu cold-install proof (`docker/cold-install`) and GitHub Actions CI for the fast suite plus
|
|
32
|
+
- Ubuntu cold-install proof (`docker/cold-install` for JRuby, `docker/cold-install-cruby` for CRuby) and GitHub Actions CI for the fast suite on both engines plus those images.
|
|
33
|
+
- Engine-aware launchers (`GALAAZ_RUBY`, `bin/galaaz-ruby`) so the same NewBridge runs under JRuby or CRuby.
|
|
14
34
|
|
|
15
35
|
### Changed
|
|
16
36
|
|
|
17
37
|
- The gem ships sources, specs, and examples; it does not pack prebuilt `.so` objects or knitted HTML/PDF.
|
|
18
|
-
- The supported install is `
|
|
38
|
+
- The supported install is `gem install galaaz` (under JRuby or CRuby), then compile the gatekeeper (see the README). A git clone is for contributors.
|
|
19
39
|
|
|
20
40
|
### Known limits
|
|
21
41
|
|
|
22
42
|
- Primary targets are Linux (x86_64) and macOS; on Windows use WSL2. Native Windows is not supported.
|
|
23
|
-
- `grun`, `gknit_Rscript`, and the polyglot path in `gknit-draft` are leftover from the Graal era; use `galaaz-jruby` / `gknit
|
|
43
|
+
- `grun`, `gknit_Rscript`, and the polyglot path in `gknit-draft` are leftover from the Graal era; use `galaaz-jruby` / `gknit` (or `GALAAZ_RUBY=ruby` for CRuby).
|
|
24
44
|
- The gatekeeper must be compiled on the install machine (Rcpp + C++ toolchain); it is not a prebuilt binary in the gem.
|
|
25
45
|
- Multi-runtime Docker R (Phase 4.5) is a slow integration spec, not part of cold-install CI.
|
|
26
46
|
- The gknit installation-timeout spec is skipped pending a dedicated pass; SimpleCov is a development gem and is not installed in the smoke image.
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Galaaz Manual"
|
|
3
|
-
subtitle: "
|
|
3
|
+
subtitle: "R-on-Rails: GNU R meets Ruby for the web"
|
|
4
4
|
author: "Rodrigo Botafogo"
|
|
5
|
-
tags: [Galaaz, Ruby, JRuby, R, "GNU R", ggplot2, knitr, dplyr, Bioconductor, Arrow]
|
|
5
|
+
tags: [Galaaz, "R-on-Rails", Ruby, Rails, JRuby, R, "GNU R", ggplot2, knitr, dplyr, Bioconductor, Arrow]
|
|
6
6
|
date: "2026"
|
|
7
7
|
bibliography: "../../examples/Bibliography/stats.bib"
|
|
8
8
|
output:
|
|
@@ -28,64 +28,64 @@ fontsize: 11pt
|
|
|
28
28
|
|
|
29
29
|
# Introduction
|
|
30
30
|
|
|
31
|
-
Galaaz is
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
not
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Ruby
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Implementing a complete scientific computing infrastructure would take too long.
|
|
62
|
-
|
|
63
|
-
**Galaaz 2.0** couples **JRuby** (Ruby on the JVM) with **GNU R**—the same R you use for
|
|
64
|
-
CRAN and Bioconductor. Ruby and R run in **separate processes**; the **Galaaz bridge**
|
|
65
|
-
sends requests to R and returns results to Ruby. From your point of view you still write
|
|
66
|
-
Ruby: `R.c(...)`, `R.library('ggplot2')`, `~R[:mtcars]`, and dplyr-style chains on R objects.
|
|
67
|
-
You do not need to learn R syntax to get a lot done, though reading R documentation for
|
|
68
|
-
individual packages remains useful.
|
|
69
|
-
|
|
70
|
-
Earlier experiments with Galaaz used Oracle’s **GraalVM** with TruffleRuby and FastR so that
|
|
71
|
-
Ruby and R could share one runtime. That path is no longer the focus: **standard GNU R**
|
|
72
|
-
gives full compatibility with the R package ecosystem (including compiled extensions and
|
|
73
|
-
Bioconductor) while JRuby gives a mature Ruby with **real multithreading** for application
|
|
74
|
-
and I/O code.
|
|
31
|
+
**Galaaz is R-on-Rails:** keep **GNU R** for statistics, graphics, and the CRAN /
|
|
32
|
+
Bioconductor ecosystem, and use **Ruby** (with **Rails** when you need a web app) for
|
|
33
|
+
everything R was never meant to own—HTTP, auth, databases, background jobs, HTML, APIs.
|
|
34
|
+
|
|
35
|
+
The primary audience is the **R scientist** who already has models, dplyr/ggplot pipelines,
|
|
36
|
+
and domain knowledge, and wants a **one-person path to production on the web**. Learning
|
|
37
|
+
enough Ruby and Rails to ship an app is usually easier than hiring (or becoming) a dedicated
|
|
38
|
+
web-and-stats dual specialist. Ruby developers gain full access to R libraries as a
|
|
39
|
+
secondary benefit; the design priority is **R workflow first, web second**.
|
|
40
|
+
|
|
41
|
+
Galaaz does **not** re-implement scientific libraries in Ruby. Ruby and R run in **separate
|
|
42
|
+
processes**; the **Galaaz bridge** sends requests to standard **GNU R** and returns typed
|
|
43
|
+
results. You keep calling familiar ideas from Ruby (`R.c(...)`, `R.library('ggplot2')`,
|
|
44
|
+
`~R[:mtcars]`, dplyr-style chains) while Rails (or plain Ruby) owns the application shell.
|
|
45
|
+
|
|
46
|
+
**Python** remains a strong competitor for end-to-end data science stacks (NumPy, pandas,
|
|
47
|
+
SciPy, scikit-learn, Django/Flask). Galaaz’s bet is different: if your science already lives
|
|
48
|
+
in **R**, do not rewrite it in Python to get a website—**put R on Rails**.
|
|
49
|
+
|
|
50
|
+
Ruby is a dynamic, object-oriented language that became widely known through **Ruby on Rails**
|
|
51
|
+
(RoR). It remains a practical choice for web applications and general-purpose scripting.
|
|
52
|
+
Until Galaaz, Ruby lacked a tight, ecosystem-complete bridge to GNU R. Library wrapping
|
|
53
|
+
(one gem per package) does not scale; Galaaz wraps **the R language**, so thousands of R
|
|
54
|
+
packages are available without a new handcrafted wrapper for each one.
|
|
55
|
+
|
|
56
|
+
**Galaaz 2.0** supports **JRuby** and **CRuby** equally for the same NewBridge protocol.
|
|
57
|
+
Pick the Ruby that fits your app: JRuby when you want real multithreading for web and I/O;
|
|
58
|
+
CRuby when you prefer MRI. R remains the same **GNU R** you use interactively—including
|
|
59
|
+
compiled extensions and Bioconductor. Earlier GraalVM / TruffleRuby / FastR experiments
|
|
60
|
+
are no longer the focus.
|
|
75
61
|
|
|
76
62
|
The bridge handles **communication and typing** between the two worlds; large tables can
|
|
77
63
|
also flow through **Apache Arrow** on the R side when you use the optional helpers described
|
|
78
64
|
later in this manual.
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
To improve performance, Python often wraps more efficient C libraries. For the
|
|
82
|
-
Python developer, the existence of such C libraries is hidden. The problem with
|
|
83
|
-
library wrapping is that for any new library, there is the need to handcraft a new
|
|
84
|
-
wrapper.
|
|
66
|
+
## R-on-Rails: the one-person app for R scientists
|
|
85
67
|
|
|
86
|
-
|
|
87
|
-
in
|
|
88
|
-
|
|
68
|
+
If you already think in R, the usual web options are painful: Shiny for some apps, or a full
|
|
69
|
+
rewrite in another stack. **R-on-Rails** means:
|
|
70
|
+
|
|
71
|
+
1. **Keep your science in R** — packages, formulas, plots, Bioconductor, the same engine as RStudio.
|
|
72
|
+
2. **Learn enough Ruby/Rails** — routes, controllers, views, jobs, auth—not a second statistics career.
|
|
73
|
+
3. **Call R from the app** — Galaaz loads R behind the scenes; long jobs can complete asynchronously
|
|
74
|
+
while Rails stays responsive (see later sections on the bridge and `R::Async`).
|
|
75
|
+
4. **Ship alone when you need to** — one developer can own both the analysis and the product UI,
|
|
76
|
+
without waiting for a separate “stats engineer” and “Rails engineer.”
|
|
77
|
+
|
|
78
|
+
Typical shape:
|
|
79
|
+
|
|
80
|
+
- Interactive exploration and reports: **gstudio**, **gknit** (R Markdown with Ruby chunks).
|
|
81
|
+
- Product: a **Rails** (or Sinatra) app that calls `R.*` for the heavy statistical steps.
|
|
82
|
+
- Scale for many users: more **R worker processes/containers** behind the app (R is single-threaded
|
|
83
|
+
per process); the Ruby web tier scales separately (JRuby threads or a multi-process CRuby
|
|
84
|
+
setup). Galaaz’s instance manager is the starting point for that pattern—not a rewrite of
|
|
85
|
+
every algorithm à la enterprise ScaleR.
|
|
86
|
+
|
|
87
|
+
Rubyists are welcome: the same bridge exposes CRAN to application code. The **intended** on-ramp,
|
|
88
|
+
though, is **R scientist → small Rails app**, not “hire a stats team to teach Rails developers R.”
|
|
89
89
|
|
|
90
90
|
## What does Galaaz mean
|
|
91
91
|
|
|
@@ -108,10 +108,11 @@ The Galaaz repository ships many helpers under **`bin/`**. When working from a *
|
|
|
108
108
|
them as **`bin/<name>`** from the project root (or `./bin/<name>`). If you install the **gem**,
|
|
109
109
|
only a subset is guaranteed on your `PATH` (see the gemspec: **`galaaz`**, **`gstudio`**, **`gknit`**, **`grun`**, **`gknit-draft`**); for development and CI, prefer the **`bin/`** copies so JVM flags and paths stay correct.
|
|
110
110
|
|
|
111
|
-
Below, **current (Galaaz 2.0 + JRuby + GNU R)** means the tool
|
|
112
|
-
**`
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
Below, **current (Galaaz 2.0 + JRuby or CRuby + GNU R)** means the tool uses **`bin/galaaz-ruby`**
|
|
112
|
+
/ **`GALAAZ_RUBY`** (default: `ruby` on `PATH`) and applies JVM flags only when the interpreter is
|
|
113
|
+
JRuby (`bin/galaaz_jruby_env.inc.sh` / `lib/galaaz_jruby.rb`). **`bin/galaaz-jruby`** forces JRuby.
|
|
114
|
+
**Legacy** means the script still targets **GraalVM** polyglot Ruby / FastR-era invocation and is
|
|
115
|
+
**not** expected to work on a typical JRuby or CRuby NewBridge setup.
|
|
115
116
|
|
|
116
117
|
**Table layout:** names in the first column are **`bin/`** filenames (run as `bin/<name>` from the repo root). Long options and examples sit **outside** the tables so PDF columns stay readable.
|
|
117
118
|
|
|
@@ -131,14 +132,24 @@ expected to work on a typical JRuby-only setup.
|
|
|
131
132
|
<td style="text-align:left;"> WSL2 helper: Docker checks; optional TinyTeX or poppler for gKnit PDF. </td>
|
|
132
133
|
<td style="text-align:left;"> Yes* </td>
|
|
133
134
|
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td style="text-align:left;"> galaaz-ruby </td>
|
|
137
|
+
<td style="text-align:left;"> Selected Ruby (default: ruby on PATH) with repo lib/ on LOAD_PATH; JVM flags only on JRuby. </td>
|
|
138
|
+
<td style="text-align:left;"> Yes </td>
|
|
139
|
+
</tr>
|
|
134
140
|
<tr>
|
|
135
141
|
<td style="text-align:left;"> galaaz-jruby </td>
|
|
136
|
-
<td style="text-align:left;">
|
|
142
|
+
<td style="text-align:left;"> Thin wrapper that forces JRuby (same flags as galaaz-ruby under JRuby). </td>
|
|
137
143
|
<td style="text-align:left;"> Yes </td>
|
|
138
144
|
</tr>
|
|
145
|
+
<tr>
|
|
146
|
+
<td style="text-align:left;"> galaaz_ruby_env.inc.sh </td>
|
|
147
|
+
<td style="text-align:left;"> Sourced by bash wrappers; sets GALAAZ_RUBY_BIN and optional JVM args. </td>
|
|
148
|
+
<td style="text-align:left;"> Yes† </td>
|
|
149
|
+
</tr>
|
|
139
150
|
<tr>
|
|
140
151
|
<td style="text-align:left;"> galaaz_jruby_env.inc.sh </td>
|
|
141
|
-
<td style="text-align:left;"> Sourced
|
|
152
|
+
<td style="text-align:left;"> Sourced when the interpreter is JRuby; sets GALAAZ_REQUIRED_JRUBY_J_ARGS. </td>
|
|
142
153
|
<td style="text-align:left;"> Yes† </td>
|
|
143
154
|
</tr>
|
|
144
155
|
<tr>
|
|
@@ -153,11 +164,13 @@ expected to work on a typical JRuby-only setup.
|
|
|
153
164
|
|
|
154
165
|
† Not run directly.
|
|
155
166
|
|
|
156
|
-
**`galaaz-jruby` examples** (from repo root):
|
|
167
|
+
**`galaaz-ruby` / `galaaz-jruby` examples** (from repo root):
|
|
157
168
|
|
|
158
169
|
```text
|
|
170
|
+
bin/galaaz-ruby my_script.rb
|
|
171
|
+
GALAAZ_RUBY=jruby bin/galaaz-ruby my_script.rb
|
|
159
172
|
bin/galaaz-jruby my_script.rb
|
|
160
|
-
bin/galaaz-
|
|
173
|
+
bin/galaaz-ruby -S rspec
|
|
161
174
|
```
|
|
162
175
|
|
|
163
176
|
## Interactive use, examples, and Rake
|
|
@@ -173,17 +186,17 @@ bin/galaaz-jruby -S rspec
|
|
|
173
186
|
<tbody>
|
|
174
187
|
<tr>
|
|
175
188
|
<td style="text-align:left;"> gstudio </td>
|
|
176
|
-
<td style="text-align:left;"> IRB or Pry with Galaaz preloaded (
|
|
189
|
+
<td style="text-align:left;"> IRB or Pry with Galaaz preloaded (ruby on PATH; JVM flags on JRuby). </td>
|
|
177
190
|
<td style="text-align:left;"> Yes </td>
|
|
178
191
|
</tr>
|
|
179
192
|
<tr>
|
|
180
193
|
<td style="text-align:left;"> run_example </td>
|
|
181
|
-
<td style="text-align:left;"> Run one Ruby file using the same
|
|
194
|
+
<td style="text-align:left;"> Run one Ruby file using the same Ruby/JVM setup as tests. </td>
|
|
182
195
|
<td style="text-align:left;"> Yes </td>
|
|
183
196
|
</tr>
|
|
184
197
|
<tr>
|
|
185
198
|
<td style="text-align:left;"> galaaz </td>
|
|
186
|
-
<td style="text-align:left;"> Forward arguments to rake (needs rake;
|
|
199
|
+
<td style="text-align:left;"> Forward arguments to rake (needs rake; same GALAAZ_RUBY as other launchers). </td>
|
|
187
200
|
<td style="text-align:left;"> Yes </td>
|
|
188
201
|
</tr>
|
|
189
202
|
</tbody>
|
|
@@ -202,7 +215,7 @@ bin/galaaz-jruby -S rspec
|
|
|
202
215
|
<tbody>
|
|
203
216
|
<tr>
|
|
204
217
|
<td style="text-align:left;"> gknit </td>
|
|
205
|
-
<td style="text-align:left;"> Knit .Rmd via JRuby and R Markdown render. </td>
|
|
218
|
+
<td style="text-align:left;"> Knit .Rmd via ruby on PATH (JRuby or CRuby) and R Markdown render. </td>
|
|
206
219
|
<td style="text-align:left;"> Yes </td>
|
|
207
220
|
</tr>
|
|
208
221
|
<tr>
|
|
@@ -212,8 +225,8 @@ bin/galaaz-jruby -S rspec
|
|
|
212
225
|
</tr>
|
|
213
226
|
<tr>
|
|
214
227
|
<td style="text-align:left;"> gknit-draft.rb </td>
|
|
215
|
-
<td style="text-align:left;"> Ruby entry: GKnit.draft (use with
|
|
216
|
-
<td style="text-align:left;">
|
|
228
|
+
<td style="text-align:left;"> Ruby entry: GKnit.draft (use with galaaz-ruby + LOAD_PATH). </td>
|
|
229
|
+
<td style="text-align:left;"> Yes </td>
|
|
217
230
|
</tr>
|
|
218
231
|
<tr>
|
|
219
232
|
<td style="text-align:left;"> gknit_Rscript </td>
|
|
@@ -290,21 +303,23 @@ Prefer **`galaaz-jruby`** for **`gknit-draft`** workflows until that wrapper mat
|
|
|
290
303
|
</tbody>
|
|
291
304
|
</table>
|
|
292
305
|
|
|
293
|
-
For day-to-day **2.0** use, rely on **`bin/galaaz-jruby
|
|
306
|
+
For day-to-day **2.0** use, rely on **`bin/galaaz-ruby`** (or **`bin/galaaz-jruby`** when you want to force JRuby), **`bin/gstudio`**, **`bin/gknit`**, **`bin/run_example`**, **`bin/run_rspec`** / **`bin/run_all_rspec`**, and **`bin/galaaz-bootstrap`** on WSL when using Dockerized R. Treat **`grun`**, **`gknit_Rscript`**, and the polyglot **`ruby`** invocation in **`gknit-draft`** as **legacy** until they are ported to the same launcher path as **`gknit`**.
|
|
294
307
|
|
|
295
308
|
# System Compatibility
|
|
296
309
|
|
|
297
310
|
Typical development and CI targets:
|
|
298
311
|
|
|
299
312
|
* **Linux** — recent Ubuntu LTS or comparable distributions (x86_64).
|
|
300
|
-
* **macOS** — recent releases with JRuby and GNU R available.
|
|
313
|
+
* **macOS** — recent releases with JRuby or CRuby and GNU R available.
|
|
301
314
|
* **Windows** — use **WSL2** (same Linux stack as above); native Windows is not the primary target.
|
|
302
315
|
|
|
303
316
|
The native **gatekeeper** component under `ext/new_bridge` is built with `make` and a C++ toolchain; see the project `README` if compilation fails on your platform.
|
|
304
317
|
|
|
305
318
|
# Dependencies
|
|
306
319
|
|
|
307
|
-
* **
|
|
320
|
+
* **Ruby** — **JRuby** or **CRuby** (both supported for NewBridge). Tested with **JRuby 10.1.1.0**
|
|
321
|
+
(+ **JDK 21**) and **CRuby 3.3.12**. Use `bin/galaaz-ruby` (honors `GALAAZ_RUBY`) or plain
|
|
322
|
+
`gem install galaaz` under the Ruby you choose.
|
|
308
323
|
* **GNU R** — `R` and `Rscript` on your `PATH` (tested with **4.3.3**), plus a C++ toolchain (`g++`, `make`) and the **Rcpp** package to compile the gatekeeper.
|
|
309
324
|
* **galaaz gem** — runtime dependency `msgpack` is pulled in by `gem install`.
|
|
310
325
|
* Optional: **Docker** — if you run R in a container (common on WSL2); see bootstrap below.
|
|
@@ -314,29 +329,34 @@ The native **gatekeeper** component under `ext/new_bridge` is built with `make`
|
|
|
314
329
|
|
|
315
330
|
The supported install is **`gem install` + compile the gatekeeper**. You do not need a git clone.
|
|
316
331
|
|
|
317
|
-
1. Install **JRuby
|
|
332
|
+
1. Install **JRuby** (and a compatible **JDK**) **or CRuby 3.3+**, plus **GNU R** (with `Rscript` and a C++ compiler).
|
|
318
333
|
2. In R, install **Rcpp**: `install.packages("Rcpp")`.
|
|
319
|
-
3. Install the gem: `jruby -S gem install galaaz`
|
|
334
|
+
3. Install the gem: `jruby -S gem install galaaz` (or `gem install galaaz` under CRuby).
|
|
320
335
|
4. Compile the native gatekeeper from the installed gem:
|
|
321
336
|
|
|
322
337
|
```
|
|
323
|
-
gem_dir="$(
|
|
338
|
+
gem_dir="$(ruby -e "puts Gem::Specification.find_by_name('galaaz').full_gem_path")"
|
|
339
|
+
# under JRuby: gem_dir="$(jruby -e "puts Gem::Specification.find_by_name('galaaz').full_gem_path")"
|
|
324
340
|
make -C "${gem_dir}/ext/new_bridge" all
|
|
325
341
|
```
|
|
326
342
|
|
|
327
|
-
5. Ensure **`R`** starts GNU R and can install packages (network access to CRAN when you first call `R.install_and_loads`). For **Apache Arrow** on Java 9+, pass `-J--add-opens=java.base/java.nio=ALL-UNNAMED` to JRuby (from a checkout, `bin/galaaz-jruby` does this).
|
|
343
|
+
5. Ensure **`R`** starts GNU R and can install packages (network access to CRAN when you first call `R.install_and_loads`). For **Apache Arrow** on Java 9+, pass `-J--add-opens=java.base/java.nio=ALL-UNNAMED` to JRuby (from a checkout, `bin/galaaz-jruby` does this; on CRuby this flag is not needed).
|
|
328
344
|
|
|
329
345
|
For **gKnit**, **knitr**, **rmarkdown**, and LaTeX (PDF output), install the corresponding R packages, **Pandoc**, and a TeX distribution if you need PDF; the repository includes helpers such as **`bin/install-tinytex`** where appropriate.
|
|
330
346
|
|
|
331
|
-
A **table of all `bin/` scripts** (bootstrap,
|
|
347
|
+
A **table of all `bin/` scripts** (bootstrap, Ruby launcher, gstudio, gknit, test runners, and which ones are legacy) is in the section **Command-line tools (`bin/`)** earlier in this manual.
|
|
332
348
|
|
|
333
349
|
### From a repository checkout (contributors)
|
|
334
350
|
|
|
335
|
-
1. Install **bundler** if needed, then run **`
|
|
351
|
+
1. Install **bundler** if needed, then run **`bundle install`** with your chosen Ruby
|
|
352
|
+
(`jruby -S bundle install` or CRuby `bundle install`) in the repository root.
|
|
336
353
|
2. Build the bridge native code: **`make -C ext/new_bridge all`** (or **`rake compile_gatekeeper`**).
|
|
337
|
-
3. Run scripts with **`bin/galaaz-
|
|
354
|
+
3. Run scripts with **`bin/galaaz-ruby`** (uses `ruby` on `PATH`; set **`GALAAZ_RUBY=jruby`** or
|
|
355
|
+
**`GALAAZ_RUBY=ruby`** to force an engine). Spec runners: **`bin/run_rspec`** /
|
|
356
|
+
**`bin/run_all_rspec`** (same `GALAAZ_RUBY` rule). **`bin/galaaz-jruby`** remains a thin
|
|
357
|
+
wrapper that forces JRuby.
|
|
338
358
|
|
|
339
|
-
Maintainers can prove a
|
|
359
|
+
A **gstudio** try image (JRuby + R + Galaaz already installed) is **`docker run --rm -it ghcr.io/rbotafogo/galaaz-try:gstudio`** (or **`./docker/try-gstudio/run.sh`** from a checkout). Maintainers can prove a RubyGems install on a throwaway Ubuntu machine (no repo inside the container) with **`./docker/cold-install/run.sh published-specs`** (JRuby) or **`./docker/cold-install-cruby/run.sh published-specs`** (CRuby).
|
|
340
360
|
|
|
341
361
|
## Windows + WSL2 (optional: Docker / R in a container)
|
|
342
362
|
|
|
@@ -404,11 +424,13 @@ WSL integration is enabled for the distro where Galaaz is installed.
|
|
|
404
424
|
|
|
405
425
|
> galaaz master_list:scatter_plot
|
|
406
426
|
|
|
407
|
-
# JRuby, multithreading, and the R bridge
|
|
427
|
+
# JRuby, CRuby, multithreading, and the R bridge
|
|
408
428
|
|
|
409
|
-
Galaaz 2.0
|
|
410
|
-
I/O-bound work (HTTP clients, database
|
|
411
|
-
|
|
429
|
+
Galaaz 2.0 supports **JRuby** and **CRuby** equally for NewBridge. On **JRuby**, your
|
|
430
|
+
application can use **real parallel threads** for I/O-bound work (HTTP clients, database
|
|
431
|
+
connections, message consumers, and so on). On **CRuby**, prefer multi-process scaling for
|
|
432
|
+
CPU-bound concurrency. R itself is still executed in a **single GNU R process** behind the
|
|
433
|
+
Galaaz bridge (use multiple R workers when you need more R throughput).
|
|
412
434
|
|
|
413
435
|
When several Ruby threads call into R at the same time, the bridge **serializes** those calls:
|
|
414
436
|
each request is matched to a reply using an internal per-call **queue**, so you do not need to
|
|
@@ -488,19 +510,22 @@ the outcome to storage, and notify the client (poll, WebSocket, Turbo Stream, et
|
|
|
488
510
|
Ruby pattern above is only to show **when** the result exists (inside the block, or after data
|
|
489
511
|
written there is observed elsewhere). Runnable specs live in **`new_bridge_specs/eval_r_async_spec.rb`**.
|
|
490
512
|
|
|
491
|
-
## Galaaz + Rails (
|
|
513
|
+
## Galaaz + Rails (R-on-Rails) integration baseline
|
|
492
514
|
|
|
493
|
-
This
|
|
494
|
-
The
|
|
515
|
+
This is the practical **R-on-Rails** starter: an R scientist’s analysis behind a small Rails
|
|
516
|
+
app. The baseline we used in WSL aimed at:
|
|
495
517
|
|
|
496
|
-
1. Rails boots under **JRuby
|
|
518
|
+
1. Rails boots under **JRuby or CRuby** (same bridge; see Installation).
|
|
497
519
|
2. Galaaz is loaded from a local checkout (before publishing to RubyGems).
|
|
498
|
-
3. A request path can execute **`R.eval(...)`** and return a result.
|
|
520
|
+
3. A request path can execute **`R.eval(...)`** (or `R.*`) and return a result.
|
|
521
|
+
|
|
522
|
+
You keep statistical work in R; Rails owns HTTP, sessions, and HTML. See **R-on-Rails: the
|
|
523
|
+
one-person app for R scientists** in the Introduction for the product framing.
|
|
499
524
|
|
|
500
|
-
### 1) Create the app with
|
|
525
|
+
### 1) Create the app with Ruby-friendly options
|
|
501
526
|
|
|
502
|
-
Rails defaults can pull gems that are
|
|
503
|
-
extension paths
|
|
527
|
+
Rails defaults can pull gems that are awkward on some setups (for example sqlite native
|
|
528
|
+
extension paths on JRuby, or deployment extras you do not need). A minimal app avoids early friction:
|
|
504
529
|
|
|
505
530
|
```bash
|
|
506
531
|
cd /home/rbotafogo/desenv_linux
|
|
@@ -788,7 +813,7 @@ puts vec.map { |x| x + 2 }
|
|
|
788
813
|
|
|
789
814
|
This manual has been formatted using gKnit. gKnit uses knitr and R Markdown to knit
|
|
790
815
|
a document in Ruby or R and output it in any of the available formats for R Markdown.
|
|
791
|
-
gKnit runs with **JRuby**, **GNU R**, and Galaaz. In gKnit, Ruby variables are persisted between
|
|
816
|
+
gKnit runs with **JRuby or CRuby**, **GNU R**, and Galaaz. In gKnit, Ruby variables are persisted between
|
|
792
817
|
chunks, making it an ideal solution for literate programming. Also, since it is based
|
|
793
818
|
on Galaaz, Ruby chunks can have access to R variables and combining Ruby with R in one
|
|
794
819
|
document is natural.
|
|
@@ -4923,8 +4948,8 @@ arguments.
|
|
|
4923
4948
|
|
|
4924
4949
|
* Fork it
|
|
4925
4950
|
* Create your feature branch (`git checkout -b my-new-feature`)
|
|
4926
|
-
* Write tests — use **`bin/run_rspec`** or **`bin/run_all_rspec`**
|
|
4927
|
-
the load path match **`docs/testing.md`**
|
|
4951
|
+
* Write tests — use **`bin/run_rspec`** or **`bin/run_all_rspec`** (JRuby or CRuby via
|
|
4952
|
+
**`GALAAZ_RUBY`**) so JVM flags and the load path match **`docs/testing.md`**
|
|
4928
4953
|
* Commit your changes (`git commit -am 'Add some feature'`)
|
|
4929
4954
|
* Push to the branch (`git push origin my-new-feature`)
|
|
4930
4955
|
* Open a pull request
|
data/Rakefile
CHANGED
|
@@ -26,7 +26,7 @@ require 'rake/testtask'
|
|
|
26
26
|
require 'shellwords'
|
|
27
27
|
|
|
28
28
|
require_relative 'version'
|
|
29
|
-
require_relative 'lib/
|
|
29
|
+
require_relative 'lib/galaaz_ruby'
|
|
30
30
|
|
|
31
31
|
#----------------------------------------------------------------------------------------
|
|
32
32
|
#
|
|
@@ -34,9 +34,15 @@ require_relative 'lib/galaaz_jruby'
|
|
|
34
34
|
|
|
35
35
|
class MakeTask < Rake::TaskLib
|
|
36
36
|
|
|
37
|
-
#
|
|
37
|
+
# Ruby prefix for running Galaaz. Uses `ruby` on PATH unless GALAAZ_RUBY is set.
|
|
38
|
+
# JVM flags only when the selected interpreter is JRuby (see lib/galaaz_ruby.rb).
|
|
39
|
+
def self.galaaz_ruby_invocation
|
|
40
|
+
GalaazRuby.shell_invocation('lib')
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Alias kept for existing call sites; same as galaaz_ruby_invocation.
|
|
38
44
|
def self.galaaz_jruby_invocation
|
|
39
|
-
|
|
45
|
+
galaaz_ruby_invocation
|
|
40
46
|
end
|
|
41
47
|
|
|
42
48
|
#----------------------------------------------------------------------------------------
|
|
@@ -56,14 +62,15 @@ class MakeTask < Rake::TaskLib
|
|
|
56
62
|
end
|
|
57
63
|
|
|
58
64
|
#----------------------------------------------------------------------------------------
|
|
59
|
-
# Run example or spec with
|
|
65
|
+
# Run example or spec with Galaaz Ruby (ruby on PATH; GALAAZ_RUBY overrides)
|
|
60
66
|
#----------------------------------------------------------------------------------------
|
|
61
67
|
|
|
62
68
|
def make_task
|
|
69
|
+
inv = MakeTask.galaaz_ruby_invocation
|
|
63
70
|
if @rspec
|
|
64
|
-
sh %{ #{
|
|
71
|
+
sh %{ #{inv} -S bundle exec rspec #{@filepath}.rb -f documentation }
|
|
65
72
|
else
|
|
66
|
-
sh %{ #{
|
|
73
|
+
sh %{ #{inv} -S bundle exec ruby #{@filepath}.rb }
|
|
67
74
|
end
|
|
68
75
|
end
|
|
69
76
|
|
|
@@ -81,8 +88,8 @@ end
|
|
|
81
88
|
|
|
82
89
|
# Run each .rb file in a directory (for groups that don't have an all.rb)
|
|
83
90
|
def run_each_file(file_list)
|
|
84
|
-
inv = MakeTask.
|
|
85
|
-
file_list.each { |f| sh "#{inv} #{f}" }
|
|
91
|
+
inv = MakeTask.galaaz_ruby_invocation
|
|
92
|
+
file_list.each { |f| sh "#{inv} -S bundle exec ruby #{f}" }
|
|
86
93
|
end
|
|
87
94
|
|
|
88
95
|
geoms = FileList['examples/sthda_ggplot/**/*.rb']
|
|
@@ -240,10 +247,10 @@ task :compile_gatekeeper do
|
|
|
240
247
|
Dir.chdir('ext/new_bridge') { sh 'make all' }
|
|
241
248
|
end
|
|
242
249
|
|
|
243
|
-
desc 'Run specs/ and new_bridge_specs/
|
|
250
|
+
desc 'Run specs/ and new_bridge_specs/ with SimpleCov (same idea as bin/run_all_rspec; GALAAZ_RUBY overrides)'
|
|
244
251
|
task :specs_all_with_new_bridge => [:compile_gatekeeper] do
|
|
245
252
|
root = File.expand_path(__dir__)
|
|
246
|
-
inv = MakeTask.
|
|
253
|
+
inv = MakeTask.galaaz_ruby_invocation
|
|
247
254
|
top = Dir[File.join(root, 'specs', '*_spec.rb')] + Dir[File.join(root, 'specs', '*.spec.rb')]
|
|
248
255
|
files = top.sort.map { |p| Shellwords.escape(p) }.join(' ')
|
|
249
256
|
nb = Shellwords.escape(File.join(root, 'new_bridge_specs'))
|
data/bin/galaaz-jruby
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Run jruby with Galaaz-required JVM flags and lib/ on the load path.
|
|
3
|
+
# Thin JRuby wrapper around bin/galaaz-ruby (forces jruby).
|
|
3
4
|
# Optional: GALAAZ_JRUBY_OPTS (space-separated extra -J... or jruby args).
|
|
4
5
|
#
|
|
5
6
|
# Usage: bin/galaaz-jruby path/to/script.rb [args...]
|
|
6
7
|
# bin/galaaz-jruby -S rspec specs/foo_spec.rb
|
|
7
8
|
set -e
|
|
8
9
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exec jruby -I "$ROOT/lib" \
|
|
12
|
-
$GALAAZ_REQUIRED_JRUBY_J_ARGS \
|
|
13
|
-
${GALAAZ_JRUBY_OPTS:-} \
|
|
14
|
-
"$@"
|
|
10
|
+
export GALAAZ_RUBY=jruby
|
|
11
|
+
exec "$ROOT/bin/galaaz-ruby" "$@"
|
data/bin/galaaz-ruby
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run Galaaz with the selected Ruby (default: ruby on PATH; JRuby or CRuby).
|
|
3
|
+
# JVM flags are applied only when the interpreter is JRuby.
|
|
4
|
+
#
|
|
5
|
+
# Usage: bin/galaaz-ruby path/to/script.rb [args...]
|
|
6
|
+
# GALAAZ_RUBY=jruby bin/galaaz-ruby path/to/script.rb
|
|
7
|
+
# GALAAZ_RUBY=ruby bin/galaaz-ruby path/to/script.rb
|
|
8
|
+
# bin/galaaz-ruby -S rspec specs/foo_spec.rb
|
|
9
|
+
set -e
|
|
10
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
11
|
+
# shellcheck source=galaaz_ruby_env.inc.sh
|
|
12
|
+
source "$ROOT/bin/galaaz_ruby_env.inc.sh"
|
|
13
|
+
# shellcheck disable=SC2086
|
|
14
|
+
exec "$GALAAZ_RUBY_BIN" -I "$ROOT/lib" \
|
|
15
|
+
$GALAAZ_RUBY_J_ARGS \
|
|
16
|
+
"$@"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Galaaz Ruby interpreter selection for bin/* launchers.
|
|
2
|
+
# Source from bin/*.sh: source "$ROOT/bin/galaaz_ruby_env.inc.sh"
|
|
3
|
+
#
|
|
4
|
+
# Sets:
|
|
5
|
+
# GALAAZ_RUBY_BIN — interpreter to exec (default: ruby on PATH)
|
|
6
|
+
# GALAAZ_RUBY_J_ARGS — JVM -J flags when that interpreter is JRuby; empty on CRuby
|
|
7
|
+
#
|
|
8
|
+
# JRuby and CRuby are both first-class. Override with GALAAZ_RUBY=jruby, GALAAZ_RUBY=ruby,
|
|
9
|
+
# or a full path. Extra JRuby flags: GALAAZ_JRUBY_OPTS="-J-Xmx4g" (ignored on CRuby).
|
|
10
|
+
|
|
11
|
+
GALAAZ_RUBY_BIN="${GALAAZ_RUBY:-ruby}"
|
|
12
|
+
|
|
13
|
+
_galaaz_ruby_base="$(basename -- "$GALAAZ_RUBY_BIN")"
|
|
14
|
+
_galaaz_ruby_engine="$("$GALAAZ_RUBY_BIN" -e 'print RUBY_ENGINE' 2>/dev/null || true)"
|
|
15
|
+
case "$_galaaz_ruby_base" in
|
|
16
|
+
jruby|jruby.*)
|
|
17
|
+
_galaaz_is_jruby=1
|
|
18
|
+
;;
|
|
19
|
+
*)
|
|
20
|
+
if [[ "$_galaaz_ruby_engine" == "jruby" ]]; then
|
|
21
|
+
_galaaz_is_jruby=1
|
|
22
|
+
else
|
|
23
|
+
_galaaz_is_jruby=0
|
|
24
|
+
fi
|
|
25
|
+
;;
|
|
26
|
+
esac
|
|
27
|
+
|
|
28
|
+
if [[ "$_galaaz_is_jruby" -eq 1 ]]; then
|
|
29
|
+
# shellcheck source=galaaz_jruby_env.inc.sh
|
|
30
|
+
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/galaaz_jruby_env.inc.sh"
|
|
31
|
+
GALAAZ_RUBY_J_ARGS="$GALAAZ_REQUIRED_JRUBY_J_ARGS ${GALAAZ_JRUBY_OPTS:-}"
|
|
32
|
+
else
|
|
33
|
+
GALAAZ_REQUIRED_JRUBY_J_ARGS=''
|
|
34
|
+
GALAAZ_RUBY_J_ARGS=''
|
|
35
|
+
fi
|
|
36
|
+
unset _galaaz_ruby_base _galaaz_ruby_engine _galaaz_is_jruby
|
data/bin/gbookdown
CHANGED
|
@@ -58,7 +58,6 @@ end
|
|
|
58
58
|
EOF
|
|
59
59
|
|
|
60
60
|
libx = File.expand_path('../lib', File.dirname(__FILE__))
|
|
61
|
-
require File.join(libx, '
|
|
62
|
-
|
|
63
|
-
exec "jruby #{jvm_args} -I#{libx} -e #{Shellwords.escape(code)}"
|
|
61
|
+
require File.join(libx, 'galaaz_ruby')
|
|
62
|
+
exec "#{GalaazRuby.shell_invocation(libx)} -e #{Shellwords.escape(code)}"
|
|
64
63
|
|
data/bin/gknit
CHANGED
|
@@ -215,11 +215,10 @@ end
|
|
|
215
215
|
EOF
|
|
216
216
|
|
|
217
217
|
libx = File.expand_path('../lib', File.dirname(__FILE__))
|
|
218
|
-
require File.join(libx, '
|
|
219
|
-
jvm_args = GalaazJRuby.shell_j_arg_string
|
|
218
|
+
require File.join(libx, 'galaaz_ruby')
|
|
220
219
|
ENV['GALAAZ_CALLBACK_TIMEOUT_MS'] = options[:callback_timeout_ms].to_s if !options[:callback_timeout_ms].nil?
|
|
221
220
|
ENV['GALAAZ_BRIDGE_TIMEOUT_SEC'] = options[:bridge_timeout_sec].to_s if !options[:bridge_timeout_sec].nil?
|
|
222
|
-
exec "
|
|
221
|
+
exec "#{GalaazRuby.shell_invocation(libx)} -e #{Shellwords.escape(code)}"
|
|
223
222
|
|
|
224
223
|
=begin
|
|
225
224
|
# how to call rmarkdown::render with a parameter list
|
data/bin/gstudio
CHANGED
|
@@ -41,13 +41,13 @@ end.parse!
|
|
|
41
41
|
|
|
42
42
|
bin_dir = File.expand_path('..', __FILE__)
|
|
43
43
|
libx = File.expand_path('../../lib', __FILE__)
|
|
44
|
-
require File.join(libx, '
|
|
45
|
-
|
|
44
|
+
require File.join(libx, 'galaaz_ruby')
|
|
45
|
+
inv = GalaazRuby.shell_invocation(Shellwords.escape(libx))
|
|
46
46
|
|
|
47
47
|
if options[:pry]
|
|
48
48
|
puts "Loading PRY and Galaaz... Please wait!"
|
|
49
|
-
exec "
|
|
49
|
+
exec "#{inv} -S pry -r #{Shellwords.escape(File.join(bin_dir, 'gstudio_pry.rb'))}"
|
|
50
50
|
else
|
|
51
51
|
puts "Loading IRB and Galaaz... Please wait!"
|
|
52
|
-
exec "
|
|
52
|
+
exec "#{inv} -S irb -r #{Shellwords.escape(File.join(bin_dir, 'gstudio_irb.rb'))}"
|
|
53
53
|
end
|