opal 1.7.1 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -2
- data/UNRELEASED.md +1 -0
- data/docs/cdp_common.md +1 -1
- data/docs/compiler.md +1 -1
- data/docs/index.md +1 -1
- data/docs/releasing.md +24 -8
- data/lib/opal/builder_scheduler/prefork.rb +6 -5
- data/lib/opal/cache/file_cache.rb +7 -10
- data/lib/opal/cli.rb +5 -4
- data/lib/opal/cli_runners/chrome_cdp_interface.rb +4 -2
- data/lib/opal/cli_runners/firefox_cdp_interface.rb +4 -2
- data/lib/opal/parser/patch.rb +6 -0
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/array.rb +4 -4
- data/opal/corelib/constants.rb +3 -3
- data/opal/corelib/runtime.js +3 -0
- data/spec/filters/bugs/array.rb +0 -1
- data/spec/filters/bugs/integer.rb +0 -1
- data/spec/filters/bugs/kernel.rb +0 -1
- data/spec/filters/bugs/language.rb +0 -3
- data/spec/lib/cli_spec.rb +10 -0
- data/spec/lib/rake_dist_spec.rb +1 -1
- data/spec/lib/spec_helper.rb +2 -0
- data/tasks/releasing.rake +46 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af0b92263196be9125b7ba0d1133b9a157aed0da2d91e282320ef8a8ce9a1a3
|
4
|
+
data.tar.gz: 8d05dfd7e6dcc883c27f674ddebc84e57c29e80c33b981d70118f44d869d80d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52adf7dafb792d434e9d423d0f4340df8d114071e94de6165856e8396476bfca9193ba1831464bf2f701e9978f9a7674de3590680f8a1264e542cd1f0715f2b2
|
7
|
+
data.tar.gz: 6f73fb32a7837daf9ad771a75cb0f549b0a69a968b8f18fa40d1a05f66ac61109dde51b6e9717def8942dd4068c532dc413e0fdb2541d80ab7596db3d6ed4db1
|
data/CHANGELOG.md
CHANGED
@@ -16,7 +16,7 @@ Changes are grouped as follows:
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
## [1.7.
|
19
|
+
## [1.7.3](https://github.com/opal/opal/compare/v1.7.2...v1.7.3) - 2023-03-23
|
20
20
|
|
21
21
|
|
22
22
|
<!--
|
@@ -26,9 +26,33 @@ Changes are grouped as follows:
|
|
26
26
|
### Removed
|
27
27
|
### Deprecated
|
28
28
|
### Performance
|
29
|
-
### Fixed
|
30
29
|
-->
|
31
30
|
|
31
|
+
### Fixed
|
32
|
+
|
33
|
+
- Disallow to define a singleton class for Number ([#2521](https://github.com/opal/opal/pull/2521))
|
34
|
+
- Fix eval with parser gem v3.2.1 ([#2526](https://github.com/opal/opal/pull/2526))
|
35
|
+
- Fix certain encoding issues when using Prefork ([#2527](https://github.com/opal/opal/pull/2527))
|
36
|
+
- Fix Chrome CDP interface connection ([#2528](https://github.com/opal/opal/pull/2528))
|
37
|
+
- Fix for Opal::Cache::FileCache.dir_writable? ([#2529](https://github.com/opal/opal/pull/2529))
|
38
|
+
- Fix Array#sample randomness ([#2530](https://github.com/opal/opal/pull/2530))
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
## [1.7.2](https://github.com/opal/opal/compare/v1.7.1...v1.7.2) - 2023-01-20
|
44
|
+
|
45
|
+
|
46
|
+
### Fixed
|
47
|
+
|
48
|
+
- Fix the `--debug-source-map` CLI option ([#2520](https://github.com/opal/opal/pull/2520))
|
49
|
+
- Fix links in `docs/compiler.md` ([#2519](https://github.com/opal/opal/pull/2519))
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
## [1.7.1](https://github.com/opal/opal/compare/v1.7.0...v1.7.1) - 2023-01-05
|
55
|
+
|
32
56
|
|
33
57
|
### Added
|
34
58
|
|
data/UNRELEASED.md
CHANGED
data/docs/cdp_common.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# Common CDP of Chrome, Firefox, Node and Deno
|
2
2
|
|
3
3
|
cdp_common.json documents a subset of the common CDP as reported by Chrome, version 107 and Firefox, version 106.
|
4
4
|
All entries that where marked as "experimental" or "deprecated" have been removed.
|
data/docs/compiler.md
CHANGED
@@ -27,7 +27,7 @@ code as well as a reference back to the original sexp which is useful for
|
|
27
27
|
generating source maps afterwards.
|
28
28
|
|
29
29
|
|
30
|
-
[
|
30
|
+
[parser]: https://github.com/opal/opal/tree/master/lib/opal/parser.rb
|
31
31
|
[compiler]: https://github.com/opal/opal/tree/master/lib/opal/compiler.rb
|
32
32
|
[fragments]: https://github.com/opal/opal/tree/master/lib/opal/fragment.rb
|
33
33
|
[base-node]: https://github.com/opal/opal/tree/master/lib/opal/nodes/base.rb
|
data/docs/index.md
CHANGED
@@ -8,7 +8,7 @@ The guides for earlier releases are [available here](/docs).
|
|
8
8
|
|
9
9
|
## Start here
|
10
10
|
|
11
|
-
#### [Getting Started with Opal](
|
11
|
+
#### [Getting Started with Opal](getting_started.html)
|
12
12
|
|
13
13
|
Everything you need to know to install Opal and create your first application.
|
14
14
|
|
data/docs/releasing.md
CHANGED
@@ -2,40 +2,56 @@
|
|
2
2
|
|
3
3
|
_This guide is a work-in-progress._
|
4
4
|
|
5
|
-
|
5
|
+
---
|
6
|
+
|
7
|
+
## Before the release
|
8
|
+
|
9
|
+
All of the following is now covered by `bin/rake release:prepare VERSION=v1.2.3`
|
10
|
+
|
11
|
+
### Updating the version
|
6
12
|
|
7
13
|
- Update `lib/opal/version.rb`
|
8
14
|
- Update `opal/corelib/constants.rb` with the same version number along with release dates
|
9
15
|
|
10
|
-
|
16
|
+
### Updating the changelog
|
11
17
|
|
12
18
|
- Ensure all the unreleased changes are documented in UNRELEASED.md
|
13
19
|
- [skip for pre-releases] Run `bin/rake changelog VERSION=v1.2.3` specifying the version number you're about to release
|
14
20
|
- [skip for pre-releases] Empty UNRELEASED.md
|
15
21
|
|
16
|
-
|
22
|
+
### The commit
|
17
23
|
|
18
24
|
- Commit the updated changelog along with the version bump using this commit message:
|
19
25
|
"Release v1.2.3"
|
20
|
-
|
26
|
+
|
27
|
+
---
|
28
|
+
|
29
|
+
## Release!
|
30
|
+
|
31
|
+
- Push the commit to `master`
|
32
|
+
- Run `bin/rake release` to release the new version to Rubygems
|
21
33
|
- Go to GitHub releases and create a new release from the latest tag pasting the contents from CHANGELOG.md (or UNRELEASED.md for pre-releases)
|
22
34
|
|
23
|
-
|
35
|
+
---
|
36
|
+
|
37
|
+
## After the release
|
38
|
+
|
39
|
+
### Opal docs
|
24
40
|
|
25
41
|
- Open `opal-docs` and run `bin/build v1.2.3`
|
26
42
|
- Then run `bin/deploy`
|
27
43
|
|
28
|
-
|
44
|
+
### [skip for pre-releases] Opal site
|
29
45
|
|
30
46
|
- Open `opal.github.io` and update the opal version in the `Gemfile`
|
31
47
|
- run `bin/build`
|
32
48
|
- `git push` the latest changes
|
33
49
|
|
34
|
-
|
50
|
+
### Opal CDN
|
35
51
|
|
36
52
|
- Run `bin/release v1.2.3`
|
37
53
|
|
38
|
-
|
54
|
+
### [skip for minor-releases] Prepare for the next release
|
39
55
|
|
40
56
|
- Create a new pull request that:
|
41
57
|
- Updates a version to `v1.x.0.dev` in both `lib/opal/version.rb` and `opal/corelib/constants.rb`
|
@@ -131,8 +131,8 @@ module Opal
|
|
131
131
|
|
132
132
|
class Fork
|
133
133
|
def initialize(forkset)
|
134
|
-
@parent_read, @child_write = IO.pipe
|
135
|
-
@child_read, @parent_write = IO.pipe
|
134
|
+
@parent_read, @child_write = IO.pipe(binmode: true)
|
135
|
+
@child_read, @parent_write = IO.pipe(binmode: true)
|
136
136
|
@forkset = forkset
|
137
137
|
@in_fork = false
|
138
138
|
|
@@ -252,8 +252,9 @@ module Opal
|
|
252
252
|
|
253
253
|
awaiting = 0
|
254
254
|
built = 0
|
255
|
+
should_log = $stderr.tty? && !ENV['OPAL_DISABLE_PREFORK_LOGS']
|
255
256
|
|
256
|
-
$stderr.print "\r\e[K" if
|
257
|
+
$stderr.print "\r\e[K" if should_log
|
257
258
|
|
258
259
|
loop do
|
259
260
|
events, idles = @forks.get_events(queue.length)
|
@@ -296,7 +297,7 @@ module Opal
|
|
296
297
|
end
|
297
298
|
end
|
298
299
|
|
299
|
-
if
|
300
|
+
if should_log
|
300
301
|
percent = (100.0 * built / (awaiting + built)).round(1)
|
301
302
|
str = format("[opal/builder] Building %<first>s... (%<percent>4.3g%%)\r", first: first, percent: percent)
|
302
303
|
$stderr.print str
|
@@ -307,7 +308,7 @@ module Opal
|
|
307
308
|
|
308
309
|
processed
|
309
310
|
ensure
|
310
|
-
$stderr.print "\r\e[K\r" if
|
311
|
+
$stderr.print "\r\e[K\r" if should_log
|
311
312
|
@forks.close
|
312
313
|
@forks.wait
|
313
314
|
end
|
@@ -78,19 +78,16 @@ module Opal
|
|
78
78
|
nil
|
79
79
|
end
|
80
80
|
|
81
|
-
#
|
81
|
+
# Check if we can robustly mkdir_p a directory.
|
82
82
|
def self.dir_writable?(*paths)
|
83
|
-
|
84
|
-
paths = paths.reduce([]) do |a, b|
|
85
|
-
[*a, dir = a.last ? File.expand_path(b, a.last) : b]
|
86
|
-
end
|
83
|
+
return false unless File.exist?(paths.first)
|
87
84
|
|
88
|
-
|
89
|
-
paths.
|
90
|
-
|
91
|
-
|
85
|
+
until paths.empty?
|
86
|
+
dir = File.expand_path(paths.shift, dir)
|
87
|
+
ok = File.directory?(dir) && File.writable?(dir) if File.exist?(dir)
|
88
|
+
end
|
92
89
|
|
93
|
-
dir
|
90
|
+
dir if ok
|
94
91
|
end
|
95
92
|
|
96
93
|
def self.find_dir
|
data/lib/opal/cli.rb
CHANGED
@@ -169,10 +169,11 @@ module Opal
|
|
169
169
|
|
170
170
|
compiler.compile
|
171
171
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
172
|
+
b64 = [
|
173
|
+
compiler.result,
|
174
|
+
compiler.source_map.to_json,
|
175
|
+
evals_or_file_source,
|
176
|
+
].map { |i| Base64.strict_encode64(i) }.join(',')
|
176
177
|
|
177
178
|
output.puts "https://sokra.github.io/source-map-visualization/#base64,#{b64}"
|
178
179
|
end
|
@@ -121,14 +121,16 @@ var server = http.createServer(function(req, res) {
|
|
121
121
|
|
122
122
|
// actual CDP code
|
123
123
|
|
124
|
-
CDP.List(options, function(err, targets) {
|
124
|
+
CDP.List(options, async function(err, targets) {
|
125
125
|
// default CDP port is 9222, Firefox runner is at 9333
|
126
126
|
// Lets collect clients for
|
127
127
|
// Chrome CDP starting at 9273 ...
|
128
128
|
// Firefox CDP starting 9334 ...
|
129
129
|
port_offset = targets ? targets.length + 51 : 51; // default CDP port is 9222, Node CDP port 9229, Firefox is at 9333
|
130
130
|
|
131
|
-
|
131
|
+
const {webSocketDebuggerUrl} = await CDP.Version(options);
|
132
|
+
|
133
|
+
return await CDP({target: webSocketDebuggerUrl}, function(browser_client) {
|
132
134
|
|
133
135
|
server.listen({ port: port_offset + options.port, host: options.host });
|
134
136
|
|
@@ -94,10 +94,12 @@ var server = http.createServer(function(req, res) {
|
|
94
94
|
|
95
95
|
// actual CDP code
|
96
96
|
|
97
|
-
CDP.List(options, function(err, targets) {
|
97
|
+
CDP.List(options, async function(err, targets) {
|
98
98
|
offset = targets ? targets.length + 1 : 1;
|
99
99
|
|
100
|
-
|
100
|
+
const {webSocketDebuggerUrl} = await CDP.Version(options);
|
101
|
+
|
102
|
+
return await CDP({target: webSocketDebuggerUrl}, function(browser_client) {
|
101
103
|
|
102
104
|
server.listen({port: offset + options.port, host: options.host });
|
103
105
|
|
data/lib/opal/parser/patch.rb
CHANGED
data/lib/opal/version.rb
CHANGED
data/opal/corelib/array.rb
CHANGED
@@ -1927,9 +1927,9 @@ class ::Array < `Array`
|
|
1927
1927
|
break;
|
1928
1928
|
case 2:
|
1929
1929
|
i = #{rng.rand(`self.length`)};
|
1930
|
-
j = #{rng.rand(`self.length`)};
|
1931
|
-
if (i
|
1932
|
-
j
|
1930
|
+
j = #{rng.rand(`self.length - 1`)};
|
1931
|
+
if (i <= j) {
|
1932
|
+
j++;
|
1933
1933
|
}
|
1934
1934
|
return [self[i], self[j]];
|
1935
1935
|
break;
|
@@ -1981,7 +1981,7 @@ class ::Array < `Array`
|
|
1981
1981
|
result = self.slice();
|
1982
1982
|
|
1983
1983
|
for (var c = 0; c < count; c++) {
|
1984
|
-
targetIndex = #{rng.rand(`self.length`)};
|
1984
|
+
targetIndex = #{rng.rand(`self.length - c`)} + c;
|
1985
1985
|
oldValue = result[c];
|
1986
1986
|
result[c] = result[targetIndex];
|
1987
1987
|
result[targetIndex] = oldValue;
|
data/opal/corelib/constants.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
::RUBY_PLATFORM = 'opal'
|
2
2
|
::RUBY_ENGINE = 'opal'
|
3
3
|
::RUBY_VERSION = '3.2.0'
|
4
|
-
::RUBY_ENGINE_VERSION = '1.7.
|
5
|
-
::RUBY_RELEASE_DATE = '2023-
|
4
|
+
::RUBY_ENGINE_VERSION = '1.7.3'
|
5
|
+
::RUBY_RELEASE_DATE = '2023-03-23'
|
6
6
|
::RUBY_PATCHLEVEL = 0
|
7
7
|
::RUBY_REVISION = '0'
|
8
|
-
::RUBY_COPYRIGHT = 'opal - Copyright (C)
|
8
|
+
::RUBY_COPYRIGHT = 'opal - Copyright (C) 2011-2023 Adam Beynon and the Opal contributors'
|
9
9
|
::RUBY_DESCRIPTION = "opal #{::RUBY_ENGINE_VERSION} (#{::RUBY_RELEASE_DATE} revision #{::RUBY_REVISION})"
|
data/opal/corelib/runtime.js
CHANGED
@@ -824,6 +824,9 @@
|
|
824
824
|
// @param object [Object] the ruby object
|
825
825
|
// @return [Class] the singleton class for object
|
826
826
|
Opal.get_singleton_class = function(object) {
|
827
|
+
if (object.$$is_number) {
|
828
|
+
$raise(Opal.TypeError, "can't define singleton");
|
829
|
+
}
|
827
830
|
if (object.$$meta) {
|
828
831
|
return object.$$meta;
|
829
832
|
}
|
data/spec/filters/bugs/array.rb
CHANGED
@@ -27,7 +27,6 @@ opal_filter "Array" do
|
|
27
27
|
fails "Array#rassoc calls elem == obj on the second element of each contained array" # Expected [1, "foobar"] == [2, #<MockObject:0x4a6b4 @name="foobar", @null=nil>] to be truthy but was false
|
28
28
|
fails "Array#rassoc does not check the last element in each contained but specifically the second" # Expected [1, "foobar", #<MockObject:0x4a37e @name="foobar", @null=nil>] == [2, #<MockObject:0x4a37e @name="foobar", @null=nil>, 1] to be truthy but was false
|
29
29
|
fails "Array#sample returns nil for an empty array when called without n and a Random is given" # ArgumentError: invalid argument - 0
|
30
|
-
fails "Array#sample samples evenly" # Expected 15.82 <= 13.277 to be truthy but was false
|
31
30
|
fails "Array#select returns a new array of elements for which block is true" # Expected [1] == [1, 4, 6] to be truthy but was false
|
32
31
|
fails "Array#slice can be sliced with Enumerator::ArithmeticSequence has endless range with start outside of array's bounds" # Expected [] == nil to be truthy but was false
|
33
32
|
fails "Array#slice can be sliced with Enumerator::ArithmeticSequence has range with bounds outside of array" # Expected RangeError but no exception was raised ([0, 2, 4] was returned)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Integer" do
|
3
|
-
fails "A singleton class raises a TypeError for Integer's" # Expected TypeError but got: Exception (Object.defineProperty called on non-object)
|
4
3
|
fails "Bignum is deprecated" # NameError: uninitialized constant Bignum
|
5
4
|
fails "Bignum is unified into Integer" # NameError: uninitialized constant Bignum
|
6
5
|
fails "Fixnum is deprecated" # Expected warning to match: /constant ::Fixnum is deprecated/ but got: ""
|
data/spec/filters/bugs/kernel.rb
CHANGED
@@ -134,7 +134,6 @@ opal_filter "Kernel" do
|
|
134
134
|
fails "Kernel#respond_to? throws a type error if argument can't be coerced into a Symbol" # Expected TypeError (/is not a symbol nor a string/) but no exception was raised (false was returned)
|
135
135
|
fails "Kernel#respond_to_missing? causes #respond_to? to return false if called and returning nil" # Expected nil to be false
|
136
136
|
fails "Kernel#respond_to_missing? causes #respond_to? to return true if called and not returning false" # Expected "glark" to be true
|
137
|
-
fails "Kernel#singleton_class raises TypeError for Integer" # Expected TypeError but got: Exception (Object.defineProperty called on non-object)
|
138
137
|
fails "Kernel#singleton_class raises TypeError for Symbol" # Expected TypeError but no exception was raised (#<Class:#<String:0x53aaa>> was returned)
|
139
138
|
fails "Kernel#singleton_method find a method defined on the singleton class" # NoMethodError: undefined method `singleton_method' for #<Object:0x4540a>
|
140
139
|
fails "Kernel#singleton_method only looks at singleton methods and not at methods in the class" # Expected NoMethodError == NameError to be truthy but was false
|
@@ -16,7 +16,6 @@ opal_filter "language" do
|
|
16
16
|
fails "A block yielded a single Array when non-symbol keys are in a keyword arguments Hash does not separate non-symbol keys and symbol keys and does not autosplat" # Expected [nil, {"a"=>10, "b"=>2}] == [[{"a"=>10, "b"=>2}], {}] to be truthy but was false
|
17
17
|
fails "A block yielded a single Object receives the object if it does not respond to #respond_to?" # NoMethodError: undefined method `respond_to?' for #<BasicObject:0x551e>
|
18
18
|
fails "A class definition extending an object (sclass) can use return to cause the enclosing method to return" # Expected "outer" == "inner" to be truthy but was false
|
19
|
-
fails "A class definition extending an object (sclass) raises a TypeError when trying to extend numbers" # Expected TypeError but got: Exception (Object.defineProperty called on non-object)
|
20
19
|
fails "A class definition raises TypeError if any constant qualifying the class is not a Module" # Expected TypeError but no exception was raised (nil was returned)
|
21
20
|
fails "A class definition raises TypeError if the constant qualifying the class is nil" # Expected TypeError but no exception was raised (nil was returned)
|
22
21
|
fails "A class definition raises a TypeError if inheriting from a metaclass" # Expected TypeError but no exception was raised (nil was returned)
|
@@ -50,7 +49,6 @@ opal_filter "language" do
|
|
50
49
|
fails "A nested method definition creates an instance method when evaluated in an instance method" # NoMethodError: undefined method `an_instance_method' for #<DefSpecNested:0x1064c>
|
51
50
|
fails "A number literal can be a decimal literal with trailing 'r' to represent a Rational" # Expected (5404319552844595/18014398509481984) == (3/10) to be truthy but was false
|
52
51
|
fails "A number literal can be a float literal with trailing 'r' to represent a Rational" # Expected (5030569068109113/288230376151711740) == (136353847812057/7812500000000000) to be truthy but was false
|
53
|
-
fails "A singleton class doesn't have singleton class" # Expected TypeError but got: Exception (Object.defineProperty called on non-object)
|
54
52
|
fails "A singleton class raises a TypeError for symbols" # Expected TypeError but no exception was raised (#<Class:#<String:0x9093e>> was returned)
|
55
53
|
fails "A singleton method definition can be declared for a global variable" # TypeError: can't define singleton
|
56
54
|
fails "A singleton method definition raises FrozenError with the correct class name" # Expected "can't modify frozen Class: #<Class:#<Object:0x10574>>".start_with? "can't modify frozen object" to be truthy but was false
|
@@ -325,7 +323,6 @@ opal_filter "language" do
|
|
325
323
|
fails "a method definition that sets more than one default parameter all to the same value treats the argument after the multi-parameter normally" # Expected ArgumentError (wrong number of arguments (given 3, expected 0..2)) but got: ArgumentError ([MSpecEnv#bar] wrong number of arguments (given 3, expected -1))
|
326
324
|
fails "kwarg with omitted value in a method call accepts short notation 'kwarg' in method call for definition 'def call(*args, **kwargs) = [args, kwargs]'" # NameError: uninitialized constant SpecEvaluate::a
|
327
325
|
fails "kwarg with omitted value in a method call with methods and local variables for definition \n def call(*args, **kwargs) = [args, kwargs]\n def bar\n \"baz\"\n end\n def foo(val)\n call bar:, val:\n end" # NameError: uninitialized constant SpecEvaluate::bar
|
328
|
-
fails "self in a metaclass body (class << obj) raises a TypeError for numbers" # Expected TypeError but got: Exception (Object.defineProperty called on non-object)
|
329
326
|
fails "self in a metaclass body (class << obj) raises a TypeError for symbols" # Expected TypeError but got: Exception (Cannot create property '$$meta' on string 'symbol')
|
330
327
|
fails "self.send(:block_given?) returns false when a method defined by define_method is called with a block" # NoMethodError: undefined method `block_given?' for KernelSpecs::SelfBlockGiven
|
331
328
|
fails "self.send(:block_given?) returns true if and only if a block is supplied" # NoMethodError: undefined method `block_given?' for KernelSpecs::SelfBlockGiven
|
data/spec/lib/cli_spec.rb
CHANGED
@@ -248,6 +248,16 @@ RSpec.describe Opal::CLI do
|
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
|
+
describe ':debug_source_map' do
|
252
|
+
let(:options) { { debug_source_map: true, evals: ['puts 123'] } }
|
253
|
+
|
254
|
+
it 'generates a link to https://sokra.github.io/source-map-visualization' do
|
255
|
+
expect_output_of { subject.run }.to start_with(
|
256
|
+
"https://sokra.github.io/source-map-visualization/#base64,"
|
257
|
+
)
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
251
261
|
context 'using pipes' do
|
252
262
|
it 'runs the provided source' do
|
253
263
|
# `echo` on windows will output double-quotes along with the contents, that's why we print with ruby
|
data/spec/lib/rake_dist_spec.rb
CHANGED
data/spec/lib/spec_helper.rb
CHANGED
data/tasks/releasing.rake
CHANGED
@@ -80,3 +80,49 @@ task :changelog do
|
|
80
80
|
|
81
81
|
File.write changelog_path, changelog_entries.join("\n\n\n\n\n")
|
82
82
|
end
|
83
|
+
|
84
|
+
namespace :release do
|
85
|
+
task :prepare do
|
86
|
+
version = ENV['VERSION'] or abort "please provide a version as the first argument, e.g.: #{$0} 1.2.3"
|
87
|
+
version = version[1..] if version.start_with? 'v'
|
88
|
+
gem_version = Gem::Version.new(version)
|
89
|
+
|
90
|
+
version_path = "#{__dir__}/../lib/opal/version.rb"
|
91
|
+
puts "== update #{version_path}"
|
92
|
+
require_relative version_path
|
93
|
+
File.write version_path, File.read(version_path).sub(Opal::VERSION, version)
|
94
|
+
|
95
|
+
constants_path = "#{__dir__}/../opal/corelib/constants.rb"
|
96
|
+
puts "== update #{constants_path}"
|
97
|
+
require_relative constants_path
|
98
|
+
File.write constants_path, File.read(constants_path).sub(Opal::VERSION, version).sub(
|
99
|
+
%r{(RUBY_RELEASE_DATE *= *')\d{4}-\d{2}-\d{2}(')},
|
100
|
+
'\1' + Time.now.strftime('%F') + '\2'
|
101
|
+
)
|
102
|
+
|
103
|
+
if gem_version.prerelease?
|
104
|
+
puts "== (skipping changlog update)"
|
105
|
+
else
|
106
|
+
puts "== update changelog"
|
107
|
+
|
108
|
+
system "bin/rake changelog VERSION=v#{version}" or abort('changelog update failed')
|
109
|
+
File.write "#{__dir__}/../UNRELEASED.md", <<~MARKDOWN
|
110
|
+
<!--
|
111
|
+
### Internal
|
112
|
+
### Changed
|
113
|
+
### Added
|
114
|
+
### Removed
|
115
|
+
### Deprecated
|
116
|
+
### Performance
|
117
|
+
### Fixed
|
118
|
+
-->
|
119
|
+
|
120
|
+
MARKDOWN
|
121
|
+
end
|
122
|
+
|
123
|
+
puts "== committing"
|
124
|
+
sh 'git add UNRELEASED.md CHANGELOG.md opal/corelib/constants.rb lib/opal/version.rb'
|
125
|
+
sh "git commit -m 'Release v#{version}'"
|
126
|
+
sh 'git show | cat'
|
127
|
+
end
|
128
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ast
|
@@ -1215,10 +1215,10 @@ licenses:
|
|
1215
1215
|
metadata:
|
1216
1216
|
homepage_uri: https://opalrb.com/
|
1217
1217
|
bug_tracker_uri: https://github.com/opal/opal/issues
|
1218
|
-
changelog_uri: https://github.com/opal/opal/blob/v1.7.
|
1219
|
-
readme_uri: https://github.com/opal/opal/blob/v1.7.
|
1220
|
-
api_documentation_uri: http://opalrb.com/docs/api/v1.7.
|
1221
|
-
guides_uri: http://opalrb.com/docs/guides/v1.7.
|
1218
|
+
changelog_uri: https://github.com/opal/opal/blob/v1.7.3/CHANGELOG.md
|
1219
|
+
readme_uri: https://github.com/opal/opal/blob/v1.7.3/README.md
|
1220
|
+
api_documentation_uri: http://opalrb.com/docs/api/v1.7.3/index.html
|
1221
|
+
guides_uri: http://opalrb.com/docs/guides/v1.7.3/index.html
|
1222
1222
|
chat_uri: https://gitter.im/opal/opal
|
1223
1223
|
source_code_uri: https://github.com/opal/opal
|
1224
1224
|
post_install_message:
|
@@ -1236,7 +1236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1236
1236
|
- !ruby/object:Gem::Version
|
1237
1237
|
version: '0'
|
1238
1238
|
requirements: []
|
1239
|
-
rubygems_version: 3.
|
1239
|
+
rubygems_version: 3.4.5
|
1240
1240
|
signing_key:
|
1241
1241
|
specification_version: 4
|
1242
1242
|
summary: Ruby runtime and core library for JavaScript
|