esruby 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f83c4bc99e505210308204d172ef590d38be10fffef77266dbbac4391b25f021
4
- data.tar.gz: 94959709df300badc78dc4d2f15cafe77e41b6e377aaa6f2a688062bc7836ad1
3
+ metadata.gz: 7bf021af36d9a903dcc2b8e518ccbb3d38c694eef0d9f649ce93a169ac0aafd0
4
+ data.tar.gz: 8bae64f3191ca9ddcfa223eb1dfd104e39ee6aec9aa4d123b8923289012c7638
5
5
  SHA512:
6
- metadata.gz: 733f130ed20b96ba50ba48c1f2ae7b234c02e58ea5d03788cf0d1b271f97561574f432ac5173ce1937e8ab7a021f3aaeae40816622dc57e02e38b6c7d1035933
7
- data.tar.gz: e6ad27ef2da2a27a1cbabae8bd61049ecb394c54dbda8515b8724969f58838fcce0ce9c2cf7e4adc37753c2fc4df88837fd40976aac84051493623ce7ae73abf
6
+ metadata.gz: 8dc47a21efba8732a65b644609b56fdf5e07acc7ca7870c6d0cac68eb2f9d34c0bfed27f664a9b78684a686c4b2fe27fa4d9de42be91a85e510383d12bfa5c99
7
+ data.tar.gz: c3d78c1c8ec27d9627d88219d8c67889db89c4af56d6f92ada2d3962f7f3329fa493a3b9d70638075517850728b389c3652d9575313ec1b3f67ba8f704d65758
@@ -34,7 +34,6 @@ module ESRuby
34
34
  end
35
35
 
36
36
  def load_gems
37
- gem_paths = JSON.parse(File.read(gem_paths_file))
38
37
  gem_paths.each do |gem_path|
39
38
  esruby_spec_path = "#{gem_path}/esruby_gem"
40
39
  load(esruby_spec_path) if File.file?(esruby_spec_path)
@@ -42,10 +41,22 @@ module ESRuby
42
41
  nil
43
42
  end
44
43
 
44
+ def gem_paths
45
+ JSON.parse(File.read(gem_paths_file))
46
+ end
47
+
45
48
  def gem_paths_file
46
49
  "#{build_directory}/gem_paths.json"
47
50
  end
48
51
 
52
+ def cxx_include_argument
53
+ paths = []
54
+ paths << "#{mruby_directory}/include"
55
+ paths += gem_paths.map { |gem_path| "#{gem_path}/include" }
56
+ arguments = paths.map { |path| "-I #{path}" }
57
+ argument = arguments.join(" ")
58
+ end
59
+
49
60
  def prepended_js_sources
50
61
  js_files = []
51
62
  Gem::Specification.specifications.each do |specification|
@@ -125,9 +136,9 @@ module ESRuby
125
136
  js_arguments += " "
126
137
  js_arguments += appended_js_sources.map { |path| "--post-js #{path}" }.join(" ")
127
138
  RakeFileUtils.sh "#{mrbc} -B app -o #{build_directory}/app.c #{ruby_sources.join(" ")}"
128
- 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} -s ALLOW_MEMORY_GROWTH=1"
129
- RakeFileUtils.sh "emcc -std=c++11 --bind -I #{mruby_directory}/include #{gem_directory}/resources/cpp/main.cpp -o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
130
- RakeFileUtils.sh "emcc --bind -I #{mruby_directory}/include -o #{build_directory}/output.js #{build_directory}/app.o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
139
+ RakeFileUtils.sh "emcc --bind #{cxx_include_argument} #{build_directory}/app.c -o #{build_directory}/app.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
140
+ RakeFileUtils.sh "emcc -std=c++11 --bind #{cxx_include_argument} #{gem_directory}/resources/cpp/main.cpp -o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
141
+ RakeFileUtils.sh "emcc --bind #{cxx_include_argument} -o #{build_directory}/output.js #{build_directory}/app.o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
131
142
  #if build.build_mode == 'production'
132
143
  # ENV["EMCC_CLOSURE_ARGS"] = "--language_in=ECMASCRIPT6" #possibly allow setting output: --language_out=ECMASCRIPT6
133
144
  # sh "java -jar #{PROJECT_DIRECTORY}/emsdk/emscripten/incoming/third_party/closure-compiler/compiler.jar --js #{build.absolute_build_directory}/output.js --js_output_file #{build.absolute_output}"
@@ -1,10 +1,10 @@
1
- #include "/media/file_server/file_drive/projects/esruby/esruby-esruby/include/esruby.hpp"
1
+ #include "esruby.hpp"
2
2
 
3
3
  // we need to load the esruby bindings here, see issue:
4
4
  // https://github.com/kripken/emscripten/issues/5537
5
5
  // although you can observe that the bindings in esruby-bind do work
6
6
  // so im not sure what the problem is
7
- // idealy i would like to use a compiler option like EXPORTED_FUNCTIONS, for classes
7
+ // idealy i would like to use a compiler option like EXPORTED_FUNCTIONS, but for classes
8
8
  EMSCRIPTEN_BINDINGS(esruby)
9
9
  {
10
10
  emscripten::class_<ESRuby>("ESRuby")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Fors