esruby 0.0.8 → 0.0.9
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/README.md +6 -5
- data/lib/esruby/build.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4a8a81262ba6285384d5346b58cdc2022ba9624
|
4
|
+
data.tar.gz: bfff4025687aeed38eb7048ab2667986903e6f74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b4eccc319bbc4c23958d287920e51a37c35b4b2101e1b6748d63cf2d34717fe88ad7c3a48179fec8ae906e0ab08a4ef2fef4ee756a994ee1da2ffc728178233
|
7
|
+
data.tar.gz: 8c42461e416dbd33d53ab2fe903e96a5782b9ec87cacdfc2029991406adaeb7054e16e6a6e70afbd07966e99e7b0770b10292f91832eb38193e3a24a5244c00c
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# ESRuby
|
2
|
-
This project brings *mruby* to the browser. It uses *emscripten*
|
3
|
-
(https://github.com/
|
4
|
-
JavaScript (ECMAScript) and runs in the browser. It is heavily based off *webruby* (https://github.com/xxuejie/webruby) but has been adjusted to work with the updates to *emscripten* and *mruby*.
|
2
|
+
This project brings *mruby* to the browser. It uses [*emscripten*](https://github.com/kripken/emscripten) to compile the mruby source code into
|
3
|
+
JavaScript (ECMAScript) and runs in the browser. It is heavily based off [*webruby*](https://github.com/xxuejie/webruby) but has been adjusted to work with the updates to *emscripten* and *mruby*.
|
5
4
|
|
6
5
|
# Install
|
7
6
|
*ESRuby* depends on [emsdk](http://kripken.github.io/emscripten-site/index.html) to provide a tool chain consisting of *emscripten* and *LLVM*. Although the tool chain is available from `apt-get` we will need to build emscripten from source using my branch as I have introduced some new features that have not made it into the release yet.
|
8
7
|
|
9
8
|
* we will start with a clean instance of Ubuntu 16.04 with ruby MRI installed
|
9
|
+
* `sudo apt-get install build-essential cmake`
|
10
|
+
* `sudo apt-get install default-jre-headless` # you will need a recent version of java if you want to run [*Closure Compiler*](https://github.com/google/closure-compiler) when compiling any apps with optimization enabled
|
10
11
|
* `cd` to a directory where you want *emsdk* downloaded
|
11
12
|
* `git clone https://github.com/juj/emsdk.git`
|
12
13
|
* `cd emsdk`
|
@@ -23,7 +24,7 @@ JavaScript (ECMAScript) and runs in the browser. It is heavily based off *webrub
|
|
23
24
|
* optional: make the last command persistent by adding\
|
24
25
|
`[ -f /path_to_emsdk/emsdk_env.sh ] && source /path_to_emsdk/emsdk_env.sh > /dev/null 2>&1`\
|
25
26
|
to your `.bashrc` and `.profile`
|
26
|
-
* verify emsdk
|
27
|
+
* verify the *emsdk* environment has been successfully setup with `emcc -v`, errors in red are normal
|
27
28
|
* install this gem with `gem install esruby`
|
28
29
|
|
29
30
|
# Try
|
@@ -35,7 +36,7 @@ to your `.bashrc` and `.profile`
|
|
35
36
|
* the app with be available at http://localhost:4444
|
36
37
|
|
37
38
|
# Binding with JS
|
38
|
-
Explore my [esruby-bind](https://github.com/robfors/esruby-bind) gem that binds the Ruby and JS
|
39
|
+
Explore my [esruby-bind](https://github.com/robfors/esruby-bind) gem that binds the Ruby and JS environments together.
|
39
40
|
|
40
41
|
# License
|
41
42
|
|
data/lib/esruby/build.rb
CHANGED
@@ -113,6 +113,7 @@ module ESRuby
|
|
113
113
|
def build_app
|
114
114
|
mrbc = "#{mruby_directory}/bin/mrbc"
|
115
115
|
js_arguments = prepended_js_sources.map { |path| "--pre-js #{path}" }.join(" ")
|
116
|
+
js_arguments += " "
|
116
117
|
js_arguments += appended_js_sources.map { |path| "--post-js #{path}" }.join(" ")
|
117
118
|
RakeFileUtils.sh "#{mrbc} -B app -o #{build_directory}/app.c #{ruby_sources.join(" ")}"
|
118
119
|
RakeFileUtils.sh "emcc --bind -I #{mruby_directory}/include #{build_directory}/app.c -o #{build_directory}/app.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument}"
|