esruby 0.0.11 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d42dbf349bcea95903d0de6774803ab39bd5fe32
4
- data.tar.gz: b1b862fa53cf9ffdfbc8e0dc6f339084551f1ac6
3
+ metadata.gz: d614cc7210c710ff67fdffaba4e7eac223438211
4
+ data.tar.gz: 4a21c975dbc5871608ec59acc9c5f980d720129d
5
5
  SHA512:
6
- metadata.gz: d654fe70e2d4d3e4a6ada3bc14c76a2913ac6ab3c1f9232b8344bb158ebcd5246d3eb276c260febc9e6a77afeb3bd76b41190babd2d9a7ec9e8c664932c452ba
7
- data.tar.gz: 168b15df66a42ad1fd0f9254afe4dd74fea26e96643ea232650fbb58bf26d5da313592dc8183bcb4bb977bca21a618a7099d89e0e8bbb5b64020b4a4aa945256
6
+ metadata.gz: 82cb55bf183e31bb6ef5fb28c4caa06befdd3400c6262d46b5db72cfeb3c03464f67500cdbc11037ac81b54fccdb26a637faa5ead14d6b11fc3482bdfcc972b7
7
+ data.tar.gz: 99639d32ffb865e6d4255fd8913cb9ef28c57cde62357a9efa32f40a7d8d3b893602bdc0b5d3764c85efcbf975ff41a1b441de48b322cfac14071166dcb5a6fe
data/README.md CHANGED
@@ -30,7 +30,6 @@ to your `.bashrc` and `.profile`
30
30
  # Try
31
31
  * create a new esruby project with `esruby new project`
32
32
  * `cd project`
33
- * download the gem `https://github.com/robfors/esruby-esruby` and put it in `gems/`
34
33
  * build the project with `esruby build config.rb`
35
34
  * you will now have `www/app.js` and `www/index.html`
36
35
  * a simple way to serve these files would be `ruby -run -e httpd www -p 4444`
data/lib/esruby/build.rb CHANGED
@@ -128,6 +128,7 @@ module ESRuby
128
128
  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}"
129
129
  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}"
130
130
  #if build.build_mode == 'production'
131
+ # ENV["EMCC_CLOSURE_ARGS"] = "--language_in=ECMASCRIPT6" #possibly allow setting output: --language_out=ECMASCRIPT6
131
132
  # 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}"
132
133
  #else
133
134
  FileUtils.cp("#{build_directory}/output.js", "#{output}")
@@ -48,6 +48,11 @@ MRuby::CrossBuild.new('app') do |conf|
48
48
  end
49
49
 
50
50
 
51
+ # we monkey patch the mruby build process to extract the list of gems
52
+ # this allows the esruby config.rb file to accept any format of gem listing that
53
+ # mruby's build_config.rb accepts without reimplementing a bunch of mruby's
54
+ # functionally
55
+ # the esruby build process will simply pass each gem entry without interpreting it
51
56
  module MRuby
52
57
  module Gem
53
58
  class List
@@ -1,19 +1,37 @@
1
1
  # This file sets up the build environment for a webruby project.
2
2
  ESRuby::Build.new do |conf|
3
3
 
4
+ # set the path of the esruby project
5
+ # all other paths specified in this config file will be expanded
6
+ # relative to this path
4
7
  conf.project_directory = File.dirname(__FILE__)
5
8
 
9
+ # list as many ruby source files as you want
10
+ # keep in mind they will be executed in the order you list them
6
11
  conf.add_ruby_source 'app/app.rb'
12
+
13
+ # list as many javascript source files as you want
14
+ # keep in mind they will be executed in the order you list them
15
+ # prepended files will be executed after all of the gemss' prepended
16
+ # javascript files but before the ruby interpreter is started
17
+ # and any ruby source files are executed
7
18
  #conf.add_prepended_js_source 'app/prepend.js'
19
+ # appended files will be executed after the ruby interpreter has finished
20
+ # executing the all the ruby source files and after all of the gem's
21
+ # appended javascript files
22
+ # the interpreter will be in an idle state so you will still be able to
23
+ # make calls to it
8
24
  #conf.add_appended_js_source 'app/append.js'
9
25
 
10
- # By default, the build output directory is "build/"
11
- conf.build_directory = 'build'
26
+ # temporary build directory
27
+ # by default the build directory is "build/"
28
+ #conf.build_directory = 'build'
12
29
 
13
30
  # note: dont change this yet
14
31
  # Use :production for O2 mode build, and :development for O0 mode.
15
- # Or you can not yet use '-O0', '-O1', '-O2', '-O3', etc. directly
32
+ # Or you can use '-O0', '-O1', '-O2', '-O3', etc. directly
16
33
  # note :production mode is still having trouble working
34
+ # emscripten need to support ES6 before we can run this optimization
17
35
  #conf.build_mode = :production
18
36
  conf.build_mode = :development
19
37
 
@@ -32,6 +50,6 @@ ESRuby::Build.new do |conf|
32
50
 
33
51
  # JavaScript binding interface
34
52
  # see: https://github.com/robfors/esruby-bind for more info
35
- # conf.add_gem :github => 'robfors/esruby-bind'
53
+ #conf.add_gem :github => 'robfors/esruby-bind'
36
54
 
37
55
  end
@@ -3,8 +3,6 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
8
6
 
9
7
  <title>esruby app</title>
10
8
 
@@ -12,6 +10,6 @@
12
10
 
13
11
  </head>
14
12
  <body>
15
- <p>esruby app template</p>
13
+ <p>esruby app</p>
16
14
  </body>
17
15
  </html>
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.0.11
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Fors
@@ -439,7 +439,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
439
439
  version: '0'
440
440
  requirements: []
441
441
  rubyforge_project:
442
- rubygems_version: 2.6.11
442
+ rubygems_version: 2.4.8
443
443
  signing_key:
444
444
  specification_version: 4
445
445
  summary: Ruby running in the browser