isomorfeus 1.0.0.zeta6
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 +7 -0
- data/LICENSE +21 -0
- data/bin/isomorfeus +33 -0
- data/bin/yandle +9 -0
- data/lib/isomorfeus/cli.rb +33 -0
- data/lib/isomorfeus/console.rb +21 -0
- data/lib/isomorfeus/installer/databases/arangodb.rb +13 -0
- data/lib/isomorfeus/installer/new_project.rb +56 -0
- data/lib/isomorfeus/installer/options_mangler.rb +16 -0
- data/lib/isomorfeus/installer/rack_servers.rb +11 -0
- data/lib/isomorfeus/installer/templates/.gitignore.erb +25 -0
- data/lib/isomorfeus/installer/templates/.gitkeep.erb +0 -0
- data/lib/isomorfeus/installer/templates/Gemfile.erb +28 -0
- data/lib/isomorfeus/installer/templates/Procfile.erb +3 -0
- data/lib/isomorfeus/installer/templates/ProcfileDebug.erb +3 -0
- data/lib/isomorfeus/installer/templates/anonymous_policy.rb.erb +4 -0
- data/lib/isomorfeus/installer/templates/app.rb.erb +57 -0
- data/lib/isomorfeus/installer/templates/app_loader.rb.erb +8 -0
- data/lib/isomorfeus/installer/templates/application.css.erb +0 -0
- data/lib/isomorfeus/installer/templates/application.js.erb +25 -0
- data/lib/isomorfeus/installer/templates/application_common.js.erb +13 -0
- data/lib/isomorfeus/installer/templates/application_ssr.js.erb +23 -0
- data/lib/isomorfeus/installer/templates/application_web_worker.js.erb +6 -0
- data/lib/isomorfeus/installer/templates/arango_config.rb.erb +19 -0
- data/lib/isomorfeus/installer/templates/config.ru.erb +23 -0
- data/lib/isomorfeus/installer/templates/debug.js.erb +131 -0
- data/lib/isomorfeus/installer/templates/development.js.erb +110 -0
- data/lib/isomorfeus/installer/templates/development_ssr.js.erb +111 -0
- data/lib/isomorfeus/installer/templates/hello_component.rb.erb +6 -0
- data/lib/isomorfeus/installer/templates/iodine_config.rb.erb +14 -0
- data/lib/isomorfeus/installer/templates/isomorfeus_loader.rb.erb +16 -0
- data/lib/isomorfeus/installer/templates/isomorfeus_web_worker_loader.rb.erb +2 -0
- data/lib/isomorfeus/installer/templates/my_app.rb.erb +11 -0
- data/lib/isomorfeus/installer/templates/navigation_links.rb.erb +9 -0
- data/lib/isomorfeus/installer/templates/not_found_404_component.rb.erb +7 -0
- data/lib/isomorfeus/installer/templates/package.json.erb +42 -0
- data/lib/isomorfeus/installer/templates/production.js.erb +91 -0
- data/lib/isomorfeus/installer/templates/spec_helper.rb.erb +22 -0
- data/lib/isomorfeus/installer/templates/test_spec.rb.erb +13 -0
- data/lib/isomorfeus/installer/templates/welcome_component.rb.erb +6 -0
- data/lib/isomorfeus/installer.rb +257 -0
- data/lib/isomorfeus/version.rb +3 -0
- metadata +211 -0
@@ -0,0 +1,110 @@
|
|
1
|
+
// require requirements used below
|
2
|
+
const path = require('path');
|
3
|
+
const webpack = require('webpack');
|
4
|
+
const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
|
5
|
+
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
|
6
|
+
|
7
|
+
const common_config = {
|
8
|
+
target: 'web',
|
9
|
+
context: path.resolve(__dirname, '../isomorfeus'),
|
10
|
+
mode: "development",
|
11
|
+
optimization: {
|
12
|
+
removeAvailableModules: false,
|
13
|
+
removeEmptyChunks: false,
|
14
|
+
minimize: false // dont minimize in development, to speed up hot reloads
|
15
|
+
},
|
16
|
+
performance: {
|
17
|
+
maxAssetSize: 20000000,
|
18
|
+
maxEntrypointSize: 20000000
|
19
|
+
},
|
20
|
+
devtool: false,
|
21
|
+
output: {
|
22
|
+
filename: '[name].js',
|
23
|
+
path: path.resolve(__dirname, '../public/assets'),
|
24
|
+
publicPath: 'http://localhost:3035/assets/'
|
25
|
+
},
|
26
|
+
externals: { crypto: 'Crypto' },
|
27
|
+
resolve: { plugins: [new OwlResolver('resolve', 'resolved')] }, // resolve ruby files
|
28
|
+
plugins: [
|
29
|
+
// both for hot reloading
|
30
|
+
new webpack.HotModuleReplacementPlugin(),
|
31
|
+
// watch for added files in opal dir
|
32
|
+
new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '../isomorfeus') ] })
|
33
|
+
],
|
34
|
+
module: {
|
35
|
+
rules: [
|
36
|
+
{
|
37
|
+
test: /\.s[ac]ss$/,
|
38
|
+
use: [ "style-loader" , "css-loader",
|
39
|
+
{
|
40
|
+
loader: "sass-loader",
|
41
|
+
options: {
|
42
|
+
sassOptions: { includePaths: [path.resolve(__dirname, '../isomorfeus/styles')] },
|
43
|
+
sourceMap: false
|
44
|
+
}
|
45
|
+
}
|
46
|
+
]
|
47
|
+
},
|
48
|
+
{
|
49
|
+
test: /\.css$/,
|
50
|
+
use: ["style-loader", "css-loader"]
|
51
|
+
},
|
52
|
+
{
|
53
|
+
test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
|
54
|
+
use: ["file-loader"]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
test: /(\.js)?\.rb$/,
|
58
|
+
use: [
|
59
|
+
{
|
60
|
+
loader: 'opal-webpack-loader', // opal-webpack-loader will compile and include ruby files in the pack
|
61
|
+
options: {
|
62
|
+
sourceMap: false,
|
63
|
+
hmr: true,
|
64
|
+
hmrHook: 'Opal.Isomorfeus.$force_render()'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
]
|
68
|
+
}
|
69
|
+
]
|
70
|
+
},
|
71
|
+
// configuration for webpack-dev-server
|
72
|
+
devServer: {
|
73
|
+
open: false,
|
74
|
+
lazy: false,
|
75
|
+
port: 3035,
|
76
|
+
hot: true,
|
77
|
+
// hotOnly: true,
|
78
|
+
inline: true,
|
79
|
+
https: false,
|
80
|
+
disableHostCheck: true,
|
81
|
+
headers: {
|
82
|
+
"Access-Control-Allow-Origin": "*",
|
83
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
84
|
+
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
|
85
|
+
},
|
86
|
+
watchOptions: {
|
87
|
+
// in case of problems with hot reloading uncomment the following two lines:
|
88
|
+
// aggregateTimeout: 250,
|
89
|
+
// poll: 50,
|
90
|
+
ignored: /\bnode_modules\b/
|
91
|
+
},
|
92
|
+
contentBase: path.resolve(__dirname, 'public'),
|
93
|
+
useLocalIp: false
|
94
|
+
}
|
95
|
+
};
|
96
|
+
|
97
|
+
const browser_config = {
|
98
|
+
entry: { application: [path.resolve(__dirname, '../isomorfeus/imports/application.js')] }
|
99
|
+
};
|
100
|
+
|
101
|
+
//const web_worker_config = {
|
102
|
+
// target: 'webworker',
|
103
|
+
// entry: { web_worker: [path.resolve(__dirname, '../isomorfeus/imports/application_web_worker.js')] },
|
104
|
+
// externals: { crypto: 'Crypto' }
|
105
|
+
//};
|
106
|
+
|
107
|
+
const browser = Object.assign({}, common_config, browser_config);
|
108
|
+
// const web_worker = Object.assign({}, common_config, web_worker_config);
|
109
|
+
|
110
|
+
module.exports = [ browser ];
|
@@ -0,0 +1,111 @@
|
|
1
|
+
// require requirements used below
|
2
|
+
const path = require('path');
|
3
|
+
const webpack = require('webpack');
|
4
|
+
const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
|
5
|
+
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
|
6
|
+
|
7
|
+
const common_config = {
|
8
|
+
target: 'node',
|
9
|
+
context: path.resolve(__dirname, '../isomorfeus'),
|
10
|
+
mode: "development",
|
11
|
+
optimization: {
|
12
|
+
removeAvailableModules: false,
|
13
|
+
removeEmptyChunks: false,
|
14
|
+
minimize: false // dont minimize in development, to speed up hot reloads
|
15
|
+
},
|
16
|
+
performance: {
|
17
|
+
maxAssetSize: 20000000,
|
18
|
+
maxEntrypointSize: 20000000
|
19
|
+
},
|
20
|
+
devtool: false,
|
21
|
+
output: {
|
22
|
+
// webpack-dev-server keeps the output in memory
|
23
|
+
filename: '[name].js',
|
24
|
+
path: path.resolve(__dirname, '../public/assets'),
|
25
|
+
publicPath: 'http://localhost:3036/assets/'
|
26
|
+
},
|
27
|
+
resolve: {
|
28
|
+
plugins: [
|
29
|
+
// this makes it possible for webpack to find ruby files
|
30
|
+
new OwlResolver('resolve', 'resolved')
|
31
|
+
]
|
32
|
+
},
|
33
|
+
plugins: [
|
34
|
+
// dont split ssr asset in chunks
|
35
|
+
new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),
|
36
|
+
// watch for added files in opal dir
|
37
|
+
new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '../isomorfeus') ] })
|
38
|
+
],
|
39
|
+
module: {
|
40
|
+
rules: [
|
41
|
+
{
|
42
|
+
// loader for .scss files
|
43
|
+
// test means "test for for file endings"
|
44
|
+
test: /\.s[ac]ss$/,
|
45
|
+
use: [ "style-loader", "css-loader",
|
46
|
+
{
|
47
|
+
loader: "sass-loader",
|
48
|
+
options: {
|
49
|
+
sassOptions: { includePaths: [path.resolve(__dirname, '../isomorfeus/styles')] },
|
50
|
+
sourceMap: false
|
51
|
+
}
|
52
|
+
}
|
53
|
+
]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
// loader for .css files
|
57
|
+
test: /\.css$/,
|
58
|
+
use: [ "style-loader", "css-loader" ]
|
59
|
+
},
|
60
|
+
{
|
61
|
+
test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
|
62
|
+
use: [ "file-loader" ]
|
63
|
+
},
|
64
|
+
{
|
65
|
+
// opal-webpack-loader will compile and include ruby files in the pack
|
66
|
+
test: /(\.js)?\.rb$/,
|
67
|
+
use: [
|
68
|
+
{
|
69
|
+
loader: 'opal-webpack-loader',
|
70
|
+
options: {
|
71
|
+
sourceMap: false,
|
72
|
+
hmr: false,
|
73
|
+
hmrHook: 'Opal.Isomorfeus.$force_render()'
|
74
|
+
}
|
75
|
+
}
|
76
|
+
]
|
77
|
+
}
|
78
|
+
]
|
79
|
+
},
|
80
|
+
// configuration for webpack-dev-server
|
81
|
+
devServer: {
|
82
|
+
open: false,
|
83
|
+
lazy: false,
|
84
|
+
port: 3036,
|
85
|
+
hot: false,
|
86
|
+
inline: true,
|
87
|
+
https: false,
|
88
|
+
disableHostCheck: true,
|
89
|
+
headers: {
|
90
|
+
"Access-Control-Allow-Origin": "*",
|
91
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
92
|
+
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
|
93
|
+
},
|
94
|
+
watchOptions: {
|
95
|
+
// in case of problems with hot reloading uncomment the following two lines:
|
96
|
+
// aggregateTimeout: 250,
|
97
|
+
// poll: 50,
|
98
|
+
ignored: /\bnode_modules\b/
|
99
|
+
},
|
100
|
+
contentBase: path.resolve(__dirname, 'public'),
|
101
|
+
useLocalIp: false
|
102
|
+
}
|
103
|
+
};
|
104
|
+
|
105
|
+
const ssr_config = {
|
106
|
+
entry: { application_ssr: [path.resolve(__dirname, '../isomorfeus/imports/application_ssr.js')] }
|
107
|
+
};
|
108
|
+
|
109
|
+
const ssr = Object.assign({}, common_config, ssr_config);
|
110
|
+
|
111
|
+
module.exports = ssr;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'etc'
|
2
|
+
Iodine.threads = ENV['THREADS'] ? ENV['THREADS'].to_i : 4
|
3
|
+
Iodine.workers = ENV['WORKERS'] ? ENV['WORKERS'].to_i : Etc.nprocessors
|
4
|
+
|
5
|
+
Iodine.on_state(:enter_child) do
|
6
|
+
Isomorfeus.connect_to_arango if Isomorfeus.arango_configured?
|
7
|
+
end
|
8
|
+
|
9
|
+
if ENV['REDIS_URL']
|
10
|
+
Iodine::PubSub.default = Iodine::PubSub::Redis.new(ENV['REDIS_URL'])
|
11
|
+
puts "* Using Redis for pub/sub."
|
12
|
+
else
|
13
|
+
puts "* Using Iodine for pub/sub within the process cluster."
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'opal'
|
2
|
+
require 'isomorfeus-redux'
|
3
|
+
require 'isomorfeus-react'
|
4
|
+
require 'isomorfeus-policy'
|
5
|
+
require 'isomorfeus-transport'
|
6
|
+
require 'isomorfeus-data'
|
7
|
+
require 'isomorfeus-i18n'
|
8
|
+
require 'isomorfeus-operation'
|
9
|
+
|
10
|
+
require_tree 'policies', :autoload
|
11
|
+
require_tree 'channels', :autoload
|
12
|
+
require_tree 'data', :autoload
|
13
|
+
require_tree 'operations', :autoload
|
14
|
+
require_tree 'components', :autoload
|
15
|
+
|
16
|
+
Isomorfeus.start_app!
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class <%= app_class %> < LucidApp::Base
|
2
|
+
render do
|
3
|
+
Router(location: props.location) do
|
4
|
+
Switch do
|
5
|
+
Route(path: '/', exact: true, component: HelloComponent.JS[:react_component])
|
6
|
+
Route(path: '/welcome', exact: true, component: WelcomeComponent.JS[:react_component])
|
7
|
+
Route(component: NotFound404Component.JS[:react_component])
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= application_name %>",
|
3
|
+
"private": true,
|
4
|
+
"dependencies": {
|
5
|
+
"opal-webpack-loader": "^0.9.9",
|
6
|
+
"react": "^16.12.0",
|
7
|
+
"react-deep-force-update": "^2.1.3",
|
8
|
+
"react-dom": "^16.12.0",
|
9
|
+
"react-jss": "^10.0.0",
|
10
|
+
"react-router": "^5.1.2",
|
11
|
+
"react-router-dom": "^5.1.2",
|
12
|
+
"redux": "^4.0.4",
|
13
|
+
"ws": "^7.2.0"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"debug": "webpack-dev-server --config=webpack/debug.js",
|
17
|
+
"development": "webpack-dev-server --config=webpack/development.js",
|
18
|
+
"development_ssr": "webpack-dev-server --config=webpack/development_ssr.js",
|
19
|
+
"production_build": "parallel-webpack --config=webpack/production.js"
|
20
|
+
},
|
21
|
+
"devDependencies": {
|
22
|
+
"compression-webpack-plugin": "^3.0.0",
|
23
|
+
"css-loader": "^3.2.0",
|
24
|
+
"extra-watch-webpack-plugin": "^1.0.3",
|
25
|
+
"file-loader": "^4.2.0",
|
26
|
+
"jsdom": "15.2.1",
|
27
|
+
"node-sass": "^4.13.0",
|
28
|
+
"parallel-webpack": "^2.4.0",
|
29
|
+
"puppeteer": "2.0.0",
|
30
|
+
"sass-loader": "^8.0.0",
|
31
|
+
"style-loader": "^1.0.0",
|
32
|
+
"terser-webpack-plugin": "^2.2.1",
|
33
|
+
"webpack": "^4.41.2",
|
34
|
+
"webpack-assets-manifest": "^3.1.1",
|
35
|
+
"webpack-cli": "^3.3.10",
|
36
|
+
"webpack-dev-server": "^3.9.0"
|
37
|
+
},
|
38
|
+
"optionalDependencies": {
|
39
|
+
"bufferutil": "^4.0.1",
|
40
|
+
"utf-8-validate": "^5.0.2"
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
const path = require('path');
|
2
|
+
const OwlResolver = require('opal-webpack-loader/resolver');
|
3
|
+
const CompressionPlugin = require("compression-webpack-plugin"); // for gzipping the packs
|
4
|
+
const TerserPlugin = require('terser-webpack-plugin'); // for minifying the packs
|
5
|
+
const WebpackAssetsManifest = require('webpack-assets-manifest');
|
6
|
+
|
7
|
+
const common_config = {
|
8
|
+
context: path.resolve(__dirname, '../isomorfeus'),
|
9
|
+
mode: "production",
|
10
|
+
optimization: {
|
11
|
+
minimize: true, // minimize
|
12
|
+
minimizer: [new TerserPlugin({ parallel: true, cache: true, terserOptions: { output: { comments: false }}})]
|
13
|
+
},
|
14
|
+
performance: {
|
15
|
+
maxAssetSize: 20000000,
|
16
|
+
maxEntrypointSize: 20000000
|
17
|
+
},
|
18
|
+
output: {
|
19
|
+
filename: '[name]-[chunkhash].js', // include fingerprint in file name, so browsers get the latest
|
20
|
+
path: path.resolve(__dirname, '../public/assets'),
|
21
|
+
publicPath: '/assets/'
|
22
|
+
},
|
23
|
+
resolve: { plugins: [new OwlResolver('resolve', 'resolved')] }, // resolve ruby files
|
24
|
+
module: {
|
25
|
+
rules: [
|
26
|
+
{
|
27
|
+
test: /\.s[ac]ss$/,
|
28
|
+
use: ["style-loader", "css-loader",
|
29
|
+
{
|
30
|
+
loader: "sass-loader",
|
31
|
+
options: {
|
32
|
+
sassOptions: { includePaths: [path.resolve(__dirname, '../isomorfeus/styles')] },
|
33
|
+
sourceMap: false
|
34
|
+
}
|
35
|
+
}
|
36
|
+
]
|
37
|
+
},
|
38
|
+
{
|
39
|
+
test: /\.css$/,
|
40
|
+
use: ["style-loader", "css-loader"]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
|
44
|
+
use: ["file-loader"]
|
45
|
+
},
|
46
|
+
{
|
47
|
+
test: /(\.js)?\.rb$/,
|
48
|
+
use: [
|
49
|
+
{
|
50
|
+
loader: 'opal-webpack-loader', // opal-webpack-loader will compile and include ruby files in the pack
|
51
|
+
options: { sourceMap: false, hmr: false }
|
52
|
+
}
|
53
|
+
]
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
};
|
58
|
+
|
59
|
+
const browser_config = {
|
60
|
+
target: 'web',
|
61
|
+
entry: { application: [path.resolve(__dirname, '../isomorfeus/imports/application.js')] },
|
62
|
+
plugins: [
|
63
|
+
new CompressionPlugin({ test: /^((?!application_ssr).)*$/, cache: true }), // gzip compress, exclude application_ssr.js
|
64
|
+
new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
|
65
|
+
],
|
66
|
+
externals: { crypto: 'Crypto' }
|
67
|
+
};
|
68
|
+
|
69
|
+
const ssr_config = {
|
70
|
+
target: 'node',
|
71
|
+
entry: { application_ssr: [path.resolve(__dirname, '../isomorfeus/imports/application_ssr.js')] },
|
72
|
+
plugins: [
|
73
|
+
new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
|
74
|
+
]
|
75
|
+
};
|
76
|
+
|
77
|
+
//const web_worker_config = {
|
78
|
+
// target: 'webworker',
|
79
|
+
// entry: { web_worker: [path.resolve(__dirname, '../isomorfeus/imports/application_web_worker.js')] },
|
80
|
+
// plugins: [
|
81
|
+
// new CompressionPlugin({ test: /^((?!application_ssr).)*$/, cache: true }), // gzip compress, exclude application_ssr.js
|
82
|
+
// new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
|
83
|
+
// ],
|
84
|
+
// externals: { crypto: 'Crypto' }
|
85
|
+
//};
|
86
|
+
|
87
|
+
const browser = Object.assign({}, common_config, browser_config);
|
88
|
+
const ssr = Object.assign({}, common_config, ssr_config);
|
89
|
+
// const web_worker = Object.assign({}, common_config, web_worker_config);
|
90
|
+
|
91
|
+
module.exports = [ browser, ssr ];
|
@@ -0,0 +1,22 @@
|
|
1
|
+
ENV['NODE_PATH'] = File.join(File.expand_path('..', __dir__), 'node_modules')
|
2
|
+
ENV['RACK_ENV'] = 'test'
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'rspec'
|
5
|
+
require 'rspec/expectations'
|
6
|
+
require 'isomorfeus-puppetmaster'
|
7
|
+
require_relative '../<%= app_require %>'
|
8
|
+
|
9
|
+
Isomorfeus.zeitwerk.setup
|
10
|
+
Isomorfeus.zeitwerk.eager_load
|
11
|
+
|
12
|
+
ASSETS_COMPILED ||= system('yarn run production_build')
|
13
|
+
|
14
|
+
Isomorfeus::Puppetmaster.download_path = File.join(Dir.pwd, 'download_path_tmp')
|
15
|
+
Isomorfeus::Puppetmaster.driver = :chromium
|
16
|
+
Isomorfeus::Puppetmaster.server = :<%= rack_server %>
|
17
|
+
Isomorfeus::Puppetmaster.app = <%= app_class %>
|
18
|
+
Isomorfeus::Puppetmaster.boot_app
|
19
|
+
|
20
|
+
RSpec.configure do |config|
|
21
|
+
config.include Isomorfeus::Puppetmaster::DSL
|
22
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'opal-webpack-loader compiled successfully' do
|
4
|
+
it 'and opal code can be executed in the browser' do
|
5
|
+
doc = visit('/')
|
6
|
+
expect(doc.evaluate_script('1 + 4')).to eq(5)
|
7
|
+
expect(doc.evaluate_script('typeof Opal')).to include('object')
|
8
|
+
result = doc.evaluate_ruby do
|
9
|
+
1 + 5
|
10
|
+
end
|
11
|
+
expect(result).to eq(6)
|
12
|
+
end
|
13
|
+
end
|