opal 1.0.0.beta1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 177badfdfa61374be53c577fbff53d85bbc9cfc56e3484c1c8f655acb999a25c
4
- data.tar.gz: 7e90a56d44fad14c1179ff6b1d480cd88a15bef1f47014557c4937eaf6fc6611
3
+ metadata.gz: ac47d199e5b2b08d136d657bd37057499f8cd33a54f0425a7c38bc22b38edfc6
4
+ data.tar.gz: 033f276409e5eb6fb23230122219a7c421b8f1cb5dbb55170895037069e384b9
5
5
  SHA512:
6
- metadata.gz: 8570dc8f8cefd28d8b22350fb62bb61814d523b06850c4f1813b46add943794e04aac4e82fef56cbc891ac3fdb989587fb57239db802d5af875c0ae59d591823
7
- data.tar.gz: b4f312923cd14c347fddf33c469fda80ce585f7224d7877666b41be1717c0231515f36c408580c18e8422bd2aac5f87856c972025a11f78252097b48d944be5c
6
+ metadata.gz: 1ce98841f00d27ee8265120b794ab27c08d1d54e66327a5767aeffe27299d95211a0222f075d7e279603b5c0136750baf90b76b99667e234c0af8025284a160b
7
+ data.tar.gz: bce1e56997d1803f9443e3cd4e889e709f5d0f8c15e69729206e893599524df504d453de8b2d16e4b4c015d9e7b39dab74ebeba7314d60243a9512ad883fb903
@@ -0,0 +1 @@
1
+ open_collective: opal
@@ -0,0 +1,77 @@
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - "*-stable"
8
+ - "*/ci-check"
9
+ pull_request:
10
+ branches:
11
+ - master
12
+
13
+ jobs:
14
+ rake:
15
+ name: ${{ matrix.combo.name || matrix.combo.ruby }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ combo:
20
+ - name: current-ruby
21
+ command: bin/rake
22
+ ruby: 2.7
23
+ - name: previous-ruby
24
+ ruby: 2.6
25
+ - name: older-ruby
26
+ ruby: 2.5
27
+ - name: windows
28
+ # These two fail because of broken stacktraces on windows: minitest_node_nodejs mspec_nodejs
29
+ command: bundle exec rake rspec minitest_nodejs
30
+ ruby: 2.7
31
+ os: windows-latest
32
+ - name: lint
33
+ command: bin/rake lint
34
+ ruby: 2.7
35
+ - name: timezone
36
+ ruby: 2.7
37
+
38
+ # Currently failing:
39
+ # - ruby: truffleruby
40
+ # - ruby: jruby
41
+ # - ruby: ruby-head
42
+
43
+ runs-on: ${{ matrix.combo.os || 'ubuntu-latest' }}
44
+ steps:
45
+ - uses: actions/checkout@v2
46
+ - uses: ruby/setup-ruby@v1
47
+ with:
48
+ ruby-version: ${{ matrix.combo.ruby }}
49
+ # NOTE: Bundler 2.2.0 fails to install libv8
50
+ # https://github.com/rubyjs/libv8/issues/310
51
+ bundler: "2.1.4"
52
+ bundler-cache: true
53
+ - run: ruby bin/git-submodule-fast-install
54
+ - run: bundle lock
55
+ - uses: actions/cache@v2
56
+ with:
57
+ path: vendor/bundle
58
+ key: ${{ runner.os }}-${{ matrix.combo.ruby }}-gems-${{ github.ref }}-${{ hashFiles('**/Gemfile.lock') }}
59
+ restore-keys: |
60
+ ${{ runner.os }}-${{ matrix.combo.ruby }}-gems-${{ github.ref }}
61
+ ${{ runner.os }}-${{ matrix.combo.ruby }}-gems-master
62
+ ${{ runner.os }}-${{ matrix.combo.ruby }}-gems-
63
+ - uses: actions/cache@v2
64
+ with:
65
+ path: node_modules
66
+ key: ${{ runner.os }}-npm-${{ github.ref }}-${{ hashFiles('**/yarn.lock') }}
67
+ restore-keys: |
68
+ ${{ runner.os }}-npm-${{ github.ref }}
69
+ ${{ runner.os }}-npm-master
70
+ ${{ runner.os }}-npm-
71
+ - run: yarn install
72
+ - name: bundle install
73
+ run: |
74
+ bundle config path vendor/bundle
75
+ bundle install --jobs 4 --retry 3
76
+ bundle clean
77
+ - run: ${{ matrix.combo.command || 'bin/rake rspec' }}
@@ -15,15 +15,47 @@ Changes are grouped as follows:
15
15
 
16
16
 
17
17
 
18
- ## [Unreleased](https://github.com/opal/opal/compare/v0.11.4...HEAD) - unreleased
18
+ ## [1.0.4](https://github.com/opal/opal/compare/v1.0.3...1.0.4) - 2020-12-13
19
19
 
20
20
 
21
- <!--
22
- Whitespace conventions:
23
- - 4 spaces before ## titles
24
- - 2 spaces before ### titles
25
- - 1 spaces before normal text
26
- -->
21
+ ### Fixed
22
+
23
+ - [Backported] Using the `--map` / `-P` CLI option was only working in conjunction with other options ([#1974](https://github.com/opal/opal/pull/1974))
24
+
25
+
26
+
27
+
28
+ ## [1.0.3](https://github.com/opal/opal/compare/v1.0.2...v1.0.3) - 2020-02-01
29
+
30
+
31
+ ### Fixed
32
+
33
+ - Fixed compiling code with Unicode chars from Opal with opal-parser ([#2074](https://github.com/opal/opal/pull/2074))
34
+
35
+
36
+
37
+
38
+ ## [1.0.2](https://github.com/opal/opal/compare/v1.0.1...v1.0.2) - 2019-12-15
39
+
40
+
41
+ - Increase the timeout for starting Chrome within the Chrome runner ([#2037](https://github.com/opal/opal/pull/2037))
42
+ - Run the Opal code within the body inside Chrome runner, it fixes an issue in opal-rspec ([#2037](https://github.com/opal/opal/pull/2037))
43
+
44
+
45
+
46
+
47
+ ## [1.0.1](https://github.com/opal/opal/compare/v1.0.0...v1.0.1) - 2019-12-08
48
+
49
+
50
+ ### Changed
51
+
52
+ - Relaxed parser version requirement ([#2013](https://github.com/opal/opal/pull/2013))
53
+
54
+
55
+
56
+
57
+ ## [1.0.0](https://github.com/opal/opal/compare/v0.11.4...v1.0.0) - 2019-05-12
58
+
27
59
 
28
60
  ### Added
29
61
 
@@ -149,6 +181,16 @@ Whitespace conventions:
149
181
  - Fixed compilation of empty/whitespace-only x-strings ([#1811](https://github.com/opal/opal/pull/1811))
150
182
  - Fix `||=` assignments on constants when the constant is not yet defined ([#1935](https://github.com/opal/opal/pull/1935))
151
183
  - Fix `String#chomp` to return an empty String when `arg == self` ([#1936](https://github.com/opal/opal/pull/1936))
184
+ - Fix methods of `Comparable` when `<=>` does not return Numeric ([#1945](https://github.com/opal/opal/pull/1945))
185
+ - Fix `Class#native_alias` error message ([#1946](https://github.com/opal/opal/pull/1946))
186
+ - Fix `gmt_offset` (alias `utc_offset`) should return 0 if the date is UTC ([#1941](https://github.com/opal/opal/pull/1941))
187
+ - `exceptionDetails.stackTrace` can be undefined ([#1955](https://github.com/opal/opal/pull/1955))
188
+ - Implement `String#each_codepoint` and `String#codepoints` (#1944, #1947)
189
+ - [internal] Terminate statement with semi-colon and remove unecessary semi-colon ([#1948](https://github.com/opal/opal/pull/1948))
190
+ - Some steps toward "strict mode" ([#1953](https://github.com/opal/opal/pull/1953))
191
+ - Preserve `Exception.stack`, in some cases the backtrace was lost ([#1963](https://github.com/opal/opal/pull/1963))
192
+ - Make `String#ascii_only?` a little less wrong ([#1951](https://github.com/opal/opal/pull/1951))
193
+ - Minor fixes to `::Native` ([#1957](https://github.com/opal/opal/pull/1957))
152
194
 
153
195
 
154
196
 
data/Gemfile CHANGED
@@ -48,8 +48,8 @@ end unless ENV['CI']
48
48
 
49
49
  group :doc do
50
50
  gem 'redcarpet' unless RUBY_ENGINE == 'truffleruby'
51
- end
51
+ end unless ENV['CI']
52
52
 
53
53
  platforms :ruby, :mswin, :mswin64, :mingw, :x64_mingw do
54
- gem 'c_lexer', '2.5.3.0.0' unless RUBY_ENGINE == 'truffleruby'
54
+ gem 'c_lexer', '~> 2.6' unless RUBY_ENGINE == 'truffleruby'
55
55
  end
data/README.md CHANGED
@@ -1,23 +1,31 @@
1
- # Opal
2
-
3
- [![Build Status (Linux)](https://img.shields.io/travis/opal/opal/master.svg?style=flat)](https://travis-ci.org/opal/opal)
4
- [![Build Status (Windows)](https://ci.appveyor.com/api/projects/status/jtsvwl8tfgn3u67n/branch/master?svg=true)](https://ci.appveyor.com/project/elia/opal/branch/master)
5
- [![Gem Version](https://img.shields.io/gem/v/opal.svg?style=flat)](https://badge.fury.io/rb/opal)
6
- [![Code Climate](https://img.shields.io/codeclimate/github/opal/opal.svg?style=flat)](https://codeclimate.com/github/opal/opal)
7
- [![Coverage Status](https://coveralls.io/repos/opal/opal/badge.svg?branch=master&service=github)](https://coveralls.io/github/opal/opal?branch=elia%2Fcoveralls)
8
-
9
-
10
- Opal is a Ruby to JavaScript source-to-source compiler. It also has an
11
- implementation of the Ruby corelib.
12
-
13
- Opal is [hosted on GitHub](https://github.com/opal/opal). Chat is available on *Gitter* at [opal/opal](https://gitter.im/opal/opal) (also available as IRC at `irc.gitter.im`).
14
- Ask questions on [stackoverflow (tag #opalrb)](https://stackoverflow.com/questions/ask?tags=opalrb). Get the [Opalist newsletter](http://opalist.co) for updates and community news.
15
-
16
- [![Inline docs](https://inch-ci.org/github/opal/opal.svg?branch=master&style=flat)](https://opalrb.com/docs)
17
- [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/opal/opal?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
18
- [![Stack Overflow](https://img.shields.io/badge/stackoverflow-%23opalrb-orange.svg?style=flat)](https://stackoverflow.com/questions/ask?tags=opalrb)
19
- [![Backers on Open Collective](https://opencollective.com/opal/backers/badge.svg)](#backers)
20
- [![Sponsors on Open Collective](https://opencollective.com/opal/sponsors/badge.svg)](#sponsors)
1
+ <h1 align="center">
2
+ <img src="https://secure.gravatar.com/avatar/88298620949a6534d403da2e356c9339?s=420"
3
+ align="center" title="Opal logo by Elia Schito" width="105" height="105" />
4
+ <br/>
5
+ Opal <br/>
6
+ <img src="https://img.shields.io/badge/Opal-Ruby%20💛%20JavaScript-yellow.svg?logo=ruby&style=social&logoColor=777"/>
7
+ </h1>
8
+
9
+ <p align="center">
10
+ <em><strong>Opal</strong> is a Ruby to JavaScript source-to-source compiler.<br>
11
+ It also has an implementation of the Ruby <code>corelib</code> and <code>stdlib</code>.</em>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <strong>Community:</strong><br>
16
+ <a href="https://stackoverflow.com/questions/ask?tags=opalrb"><img src="https://img.shields.io/badge/stackoverflow-%23opalrb-orange.svg?style=flat" alt="Stack Overflow" title="" /></a>
17
+ <a href="#backers"><img src="https://opencollective.com/opal/backers/badge.svg" alt="Backers on Open Collective" title="" /></a>
18
+ <a href="#sponsors"><img src="https://opencollective.com/opal/sponsors/badge.svg" alt="Sponsors on Open Collective" title="" /></a>
19
+ <a href="https://gitter.im/opal/opal?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter" title="" /></a>
20
+ <a href="https://opalrb.com/docs"><img src="https://img.shields.io/badge/docs-updated-blue.svg" alt="Documentation" title="" /></a>
21
+ <br>
22
+ <strong>Code:</strong><br>
23
+ <a href="https://badge.fury.io/rb/opal"><img src="https://img.shields.io/gem/v/opal.svg?style=flat" alt="Gem Version" title="" /></a>
24
+ <a href="https://travis-ci.org/opal/opal"><img src="https://img.shields.io/travis/opal/opal/master.svg?style=flat" alt="Build Status (Linux)" title="" /></a>
25
+ <a href="https://ci.appveyor.com/project/elia/opal/branch/master"><img src="https://ci.appveyor.com/api/projects/status/jtsvwl8tfgn3u67n/branch/master?svg=true" alt="Build Status (Windows)" title="" /></a>
26
+ <a href="https://codeclimate.com/github/opal/opal"><img src="https://img.shields.io/codeclimate/maintainability-percentage/opal/opal.svg" alt="Code Climate" title="" /></a>
27
+ <a href="https://coveralls.io/github/opal/opal?branch=elia%2Fcoveralls"><img src="https://coveralls.io/repos/opal/opal/badge.svg?branch=master&amp;service=github" alt="Coverage Status" title="" /></a>
28
+ </p>
21
29
 
22
30
  ## Usage
23
31
 
@@ -1,133 +1,3 @@
1
- <!--
2
- Whitespace conventions:
3
- - 4 spaces before ## titles
4
- - 2 spaces before ### titles
5
- - 1 spaces before normal text
6
- -->
7
-
8
- ### Added
9
-
10
- - Added `Module#prepend` and completely overhauled the module and class inheritance system (#1826)
11
- - Methods and properties are now assigned with `Object.defineProperty()` as non-enumerable (#1821)
12
- - Backtrace now includes the location inside the source file for syntax errors (#1814)
13
- - Added support for a faster C-implemented lexer, it's enough to add `gem 'c_lexer` to the `Gemfile` (#1806)
14
- - Added `Date#to_n` that returns the JavaScript Date object (in native.rb). (#1779, #1792)
15
- - Added `Array#pack` (supports only `C, S, L, Q, c, s, l, q, A, a` formats). (#1723)
16
- - Added `String#unpack` (supports only `C, S, L, Q, S>, L>, Q>, c, s, l, q, n, N, v, V, U, w, A, a, Z, B, b, H, h, u, M, m` formats). (#1723)
17
- - Added `File#symlink?` for Node.js. (#1725)
18
- - Added `Dir#glob` for Node.js (does not support flags). (#1727)
19
- - Added support for a static folder in the "server" CLI runner via the `OPAL_CLI_RUNNERS_SERVER_STATIC_FOLDER` env var
20
- - Added the CLI option `--runner-options` that allows passing arbitrary options to the selected runner, currently the only runner making use of them is `server` accepting `port` and `static_folder`
21
- - Added a short helper to navigate constants manually: E.g. `Opal.$$.Regexp.$$.IGNORECASE` (see docs for "Compiled Ruby")
22
- - Added initial support for OpenURI module (using XMLHttpRequest on browser and [xmlhttprequest](https://www.npmjs.com/package/xmlhttprequest) on Node). (#1735)
23
- - Added `String#prepend` to the list of unsupported methods (because String are immutable in JavaScript)
24
- - Added methods (most introduced in 2.4/2.5):
25
- * `Array#prepend` (#1757)
26
- * `Array#append` (#1757)
27
- * `Array#max` (#1757)
28
- * `Array#min` (#1757)
29
- * `Complex#finite?` (#1757)
30
- * `Complex#infinite?` (#1757)
31
- * `Complex#infinite?` (#1757)
32
- * `Date#to_time` (#1757)
33
- * `Date#next_year` (#1885)
34
- * `Date#prev_year` (#1885)
35
- * `Hash#slice` (#1757)
36
- * `Hash#transform_keys` (#1757)
37
- * `Hash#transform_keys!` (#1757)
38
- * `Numeric#finite?` (#1757)
39
- * `Numeric#infinite?` (#1757)
40
- * `Numeric#infinite?` (#1757)
41
- * `Integer#allbits?` (#1757)
42
- * `Integer#anybits?` (#1757)
43
- * `Integer#digits` (#1757)
44
- * `Integer#nobits?` (#1757)
45
- * `Integer#pow` (#1757)
46
- * `Integer#remainder` (#1757)
47
- * `Integer.sqrt` (#1757)
48
- * `Random.urandom` (#1757)
49
- * `String#delete_prefix` (#1757)
50
- * `String#delete_suffix` (#1757)
51
- * `String#casecmp?` (#1757)
52
- * `Kernel#yield_self` (#1757)
53
- * `String#unpack1` (#1757)
54
- * `String#to_r` (#1842)
55
- * `String#to_c` (#1842)
56
- * `String#match?` (#1842)
57
- * `String#unicode_normalize` returns self (#1842)
58
- * `String#unicode_normalized?` returns true (#1842)
59
- * `String#[]=` throws `NotImplementedError`(#1836)
60
-
61
- - Added support of the `pattern` argument for `Enumerable#all?`, `Enumerable#any?`, `Enumerable#none?`. (#1757)
62
- - Added `ndigits` option support to `Number#floor`, `Number#ceil`, `Number#truncate`. (#1757)
63
- - Added `key` and `receiver` attributes to the `KeyError`. (#1757)
64
- - Extended `Struct.new` to support `keyword_init` option. (#1757)
65
- - Added a new `Opal::Config.missing_require_severity` option and relative `--missing-require` CLI flag. This option will command how the builder will behave when a required file is missing. Previously the behavior was undefined and partly controlled by `dynamic_require_severity`. Not to be confused with the runtime config option `Opal.config.missing_require_severity;` which controls the runtime behavior.
66
- - Added `Matrix` (along with the internal MRI utility `E2MM`)
67
- - Use shorter helpers for constant lookups, `$$` for relative (nesting) lookups and `$$$` for absolute (qualified) lookups
68
- - Add support for the Mersenne Twister random generator, the same used by CRuby/MRI (#657 & #1891)
69
- - [Nodejs] Added support for binary data in `OpenURI` (#1911, #1920)
70
- - [Nodejs] Added support for binary data in `File#read` (#1919, #1921)
71
- - [Nodejs] Added support for `File#readlines` (#1882)
72
- - [Nodejs] Added support for `ENV#[]`, `ENV#[]=`, `ENV#key?`, `ENV#has_key?`, `ENV#include?`, `ENV#member?`, `ENV#empty?`, `ENV#keys`, `ENV#delete` and `ENV#to_s` (#1928)
73
-
74
-
75
- ### Changed
76
-
77
- - **BREAKING** The dot (`.`) character is no longer replaced with [\s\S] in a multiline regexp passed to Regexp#match and Regexp#match? (#1796, #1795)
78
- * You're advised to always use [\s\S] instead of . in a multiline regexp, which is portable between Ruby and JavaScript
79
- - **BREAKING** `Kernel#format` (and `sprintf` alias) are now in a dedicated module `corelib/kernel/format` and available exclusively in `opal` (#1930)
80
- * Previously the methods were part of the `corelib/kernel` module and available in both `opal` and `opal/mini`
81
- - Filename extensions are no longer stripped from filenames internally, resulting in better error reporting (#1804)
82
- - The internal API for CLI runners has changed, now it's just a callable object
83
- - The `--map` CLI option now works only in conjunction with `--compile` (or `--runner compiler`)
84
- - The `node` CLI runner now adds its `NODE_PATH` entry instead of replacing the ENV var altogether
85
- - Added `--disable-web-security` option flag to the Chrome headless runner to be able to do `XMLHttpRequest`
86
- - Migrated parser to 2.5. Bump RUBY_VERSION to 2.5.0.
87
- - Exceptions raised during the compilation now add to the backtrace the current location of the opal file if available (#1814).
88
- - Better use of `displayName` on functions and methods and more readable temp variable names (#1910)
89
- - Source-maps are now inlined and already contain sources, incredibly more stable and precise (#1856)
90
-
91
-
92
- ### Deprecated
93
-
94
- - The CLI `--server-port 1234` option is now deprecated in favor of using `--runner-options='{"port": 1234}'`
95
- - Including `::Native` is now deprecated because it generates conflicts with core classes in constant lookups (both `Native::Object` and `Native::Array` exist). Instead `Native::Werapper` should be used.
96
- - Using `node_require 'my_module'` to access the native `require()` function in Node.js is deprecated in favor of <code>\`require('my_module')\`</code> because static builders need to parse the call in order to function (#1886).
97
-
98
-
99
- ### Removed
100
-
101
- - The `node` CLI runner no longer supports passing extra node options via the `NODE_OPT` env var, instead Node.js natively supports the `NODE_OPTIONS` env var.
102
- - The gem "hike" is no longer an external dependency and is now an internal dependency available as `Opal::Hike` (#1881)
103
- - Removed the internal Opal class `Marshal::BinaryString` (#1914)
104
- - Removed Racc, as it's now replaced by the parser gem (#1880)
105
-
106
-
107
-
108
1
  ### Fixed
109
2
 
110
- - Fix handling of trailing semicolons and JavaScript returns inside x-strings, the behavior is now well defined and covered by proper specs (#1776)
111
- - Fixed singleton method definition to return method name. (#1757)
112
- - Allow passing number of months to `Date#next_month` and `Date#prev_month`. (#1757)
113
- - Fixed `pattern` argument handling for `Enumerable#grep` and `Enumerable#grep_v`. (#1757)
114
- - Raise `ArgumentError` instead of `TypeError` from `Numeric#step` when step is not a number. (#1757)
115
- - At run-time `LoadError` wasn't being raised even with `Opal.config.missing_require_severity;` set to `'error'`.
116
- - Fixed `Kernel#public_methods` to return instance methods if the argument is set to false. (#1848)
117
- - Fixed an issue in `String#gsub` that made it start an infinite loop when used recursively. (#1879)
118
- - `Kernel#exit` was using status 0 when a number or a generic object was provided, now accepts numbers and tries to convert objects with `#to_int` (#1898, #1808).
119
- - Fixed metaclass inheritance in subclasses of Module (#1901)
120
- - `Method#to_proc` now correctly sets parameters and arity on the resulting Proc (#1903)
121
- - Fixed bridged classes having their prototype removed from the original chain by separating them from the Ruby class (#1909)
122
- - Improve `String#to_proc` performance (#1888)
123
- - Fixed/updated the examples (#1887)
124
- - `Opal.ancestors()` now returns false for when provided with JS-falsy objects (#1839)
125
- - When subclassing now the constant is set before calling `::inherited` (#1838)
126
- - `String#to_sym` now returns the string literal (#1835)
127
- - `String#center` now correctly checks length (#1833)
128
- - `redo` inside `while` now works properly (#1820)
129
- - Fixed compilation of empty/whitespace-only x-strings (#1811)
130
- - Fix `||=` assignments on constants when the constant is not yet defined (#1935)
131
- - Fix `String#chomp` to return an empty String when `arg == self` (#1936)
132
- - Fix methods of `Comparable` when `<=>` does not return Numeric (#1945)
133
- - Fix Class#native_alias error message (#1946)
3
+ - [Backported] Using the `--map` / `-P` CLI option was only working in conjunction with other options (#1974)
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ def system(*args)
4
+ puts "== command: #{args.inspect}"
5
+ super
6
+ end
7
+
8
+ def system!(*args)
9
+ system(*args) or raise "== command failed: #{args.inspect}"
10
+ end
11
+
12
+
13
+ Dir.chdir "#{__dir__}/.."
14
+ Dir.mkdir 'tmp' unless File.directory? 'tmp'
15
+
16
+ system 'git submodule --quiet deinit --all -f 2> /dev/null'
17
+
18
+ modules = {}
19
+ `git config -f #{__dir__}/../.gitmodules --list`.lines.each do |line|
20
+ fullkey, value = line.split('=', 2)
21
+ _, name, key = fullkey.split('.', 3)
22
+ modules[name] ||= {}
23
+ modules[name][key.to_sym] = value.strip
24
+ end
25
+
26
+ `git submodule`.lines.each do |line|
27
+ sha1, name = line[1..-1].scan(/^(?<sha1>\w+) (?<name>\S+)/).first
28
+ modules[name][:sha1] = sha1
29
+ end
30
+
31
+ modules.map do |name, config|
32
+ puts "== installing #{name}..."
33
+ url, sha1, path = config.values_at(:url, :sha1, :path)
34
+ dir = File.dirname(path)
35
+ url.sub!(/\.git$/, '')
36
+
37
+ Thread.new do
38
+ system! "curl -L #{url}/archive/#{sha1}.zip -o #{sha1}.zip"
39
+
40
+ system! "unzip -q #{sha1}.zip -d #{dir}"
41
+ system! "rm #{sha1}.zip"
42
+
43
+ system! "rm -rf #{path}" if File.directory? path
44
+ system! "mv #{dir}/*-#{sha1} #{path}"
45
+ print "== completed installing #{name}.\n"
46
+ end
47
+ end.each(&:join)
48
+
49
+ system! 'git submodule init'
data/bin/setup CHANGED
@@ -3,6 +3,10 @@ set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
+ gem install bundler --conservative
7
+
6
8
  bundle update
7
9
 
8
10
  git submodule update --init
11
+
12
+ bin/yarn install
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path('..', __dir__)
3
+ Dir.chdir(APP_ROOT) do
4
+ begin
5
+ exec "yarnpkg", *ARGV
6
+ rescue Errno::ENOENT
7
+ $stderr.puts "Yarn executable was not detected in the system."
8
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ exit 1
10
+ end
11
+ end
@@ -0,0 +1,18 @@
1
+ # Releasing
2
+
3
+ _This guide is a work-in-progress._
4
+
5
+ ## Updating the version
6
+
7
+ - Update `lib/opal/version.rb`
8
+ - Update `opal/corelib/constants.rb` with the same version number along with release dates
9
+
10
+ ## Updating the changelog
11
+
12
+ - Ensure all the unreleased changes are documented in UNRELEASED.md
13
+ - Run `bin/rake changelog VERSION=v1.2.3` specifying the version number you're about to release
14
+
15
+ ## The commit
16
+
17
+ - Commit the updated changelog along with the version bump using this commmit message:
18
+ "Release v1.2.3"