Skip to content

Commit 7094169

Browse files
committed
generate setup-opal.js from opal.min.js and opal-parser.min.js for smalruby3-desktop.
1 parent 94ef272 commit 7094169

File tree

11 files changed

+23
-18
lines changed

11 files changed

+23
-18
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ npm-*
1717
# generated translation files
1818
/translations
1919
/locale
20+
21+
# generated opal files
22+
/static/javascripts/setup-opal.js

LEGAL

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ test/unit/lib/ruby-generator.test.jsx
4646

4747
These files are licensed under the MIT License (see the file LICENSE).
4848

49-
static/javascripts/opal.js
50-
static/javascripts/opal.min.js
51-
static/javascripts/opal-parser.js
52-
static/javascripts/opal-parser.min.js
49+
opal/opal.js
50+
opal/opal.min.js
51+
opal/opal-parser.js
52+
opal/opal-parser.min.js
5353

5454
These files are licensed under the MIT License
5555
(see https://github.com/opal/opal/blob/master/LICENSE ).

opal/config-opal-parser.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Opal.load('opal-parser');
2+
Opal.load('parser');
3+
Opal.load('parser/ruby23');
4+
Opal.Parser.CurrentRuby = Opal.Parser.Ruby23;

opal/config-opal.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Opal.load('opal');
2+
Opal.config.unsupported_features_severity = 'ignore';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
"description": "GraphicaL User Interface for creating and running Smalruby 3.0 projects",
55
"main": "./dist/smalruby3-gui.js",
66
"scripts": {
7-
"build": "npm run clean && webpack --progress --colors --bail",
8-
"clean": "rimraf ./build && mkdirp build && rimraf ./dist && mkdirp dist",
7+
"setup-opal": "if [ ! -e ./static/javascripts/setup-opal.js ]; then mkdir -p ./static/javascripts && (cd opal && cat opal.min.js config-opal.js opal-parser.min.js config-opal-parser.js > ../static/javascripts/setup-opal.js); fi",
8+
"build": "npm run clean && npm run setup-opal && webpack --progress --colors --bail",
9+
"clean": "rimraf ./static/javascripts/setup-opal.js && rimraf ./build && mkdirp build && rimraf ./dist && mkdirp dist",
910
"deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"Build for $(git log --pretty=format:%H -n1)\"",
1011
"prune": "./prune-gh-pages.sh",
1112
"i18n:push": "tx-push-src scratch-editor interface translations/en.json",
1213
"i18n:src": "rimraf ./translations/messages/src && babel src > tmp.js && rimraf tmp.js && build-i18n-src ./translations/messages/src ./translations/ && npm run i18n:push",
13-
"start": "webpack-dev-server",
14+
"start": "npm run setup-opal && webpack-dev-server",
1415
"test": "npm run test:lint && npm run test:unit && npm run build && npm run test:integration",
1516
"test:integration": "jest --runInBand test[\\\\/]integration",
1617
"test:lint": "eslint . --ext .js,.jsx",
1718
"test:unit": "jest test[\\\\/]unit",
1819
"test:smoke": "jest --runInBand test[\\\\/]smoke",
19-
"watch": "webpack --progress --colors --watch"
20+
"watch": "npm run setup-opal && webpack --progress --colors --watch"
2021
},
2122
"author": "Ruby Programming Shounendan",
2223
"license": "BSD-3-Clause",

src/playground/index.ejs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,7 @@
1414
</script>
1515
<!-- /Sentry -->
1616
<% } %>
17-
<script src="static/javascripts/opal.min.js"
18-
onload="Opal.load('opal');
19-
Opal.config.unsupported_features_severity = 'ignore';">
20-
</script>
21-
<script src="static/javascripts/opal-parser.min.js"
22-
onload="Opal.load('opal-parser');
23-
Opal.load('parser');
24-
Opal.load('parser/ruby23');
25-
Opal.Parser.CurrentRuby = Opal.Parser.Ruby23;">
26-
</script>
17+
<script src="static/javascripts/setup-opal.js"></script>
2718
</head>
2819
<body>
2920
</body>

0 commit comments

Comments
 (0)