opal 0.10.0.rc2 → 0.10.0

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
  SHA1:
3
- metadata.gz: efe75eb88b3f7d58767522527d4af500973e1f14
4
- data.tar.gz: a78f99088a2b56b305e27f97b415405b5e4bf3cb
3
+ metadata.gz: 992ac16e12c48dbaef85eb0de3bd6077fa0859cf
4
+ data.tar.gz: 8245d6ef34cc2555d0d23a505f35c5a6215162ae
5
5
  SHA512:
6
- metadata.gz: 9cdf2ece6b3eaf88bb4704cc49db8c8cf3d2cc06f4e609365bf316becde8769eb52dfe4e06d68ecb08faabc5db51c2f93f06adfec209cee901581e9ed2b24303
7
- data.tar.gz: c72519167eeca7eda52d339d3df9b8092ea885304f93d20a4a921f8c0b53cc774d0900e943b8deab4c14d571dac15eae25db5bb066d31f619296d97042aaddf3
6
+ metadata.gz: a2e595513e93d7a7ddec468dcb3ae4ebadee844d042419f80403669b0e2047f8a54a00b736e9fa3408fac685df0f3aaf6894a4f816d814c914708fda00f546e8
7
+ data.tar.gz: 168be2c9aa3823a6ad810892e3408314bfe538bc776004bc33c8239f6dcfce25ef72e63563fa869347c56ff70809c924e151aca3102a58e9ea3e4bc08aaa1213
data/.travis.yml CHANGED
@@ -11,26 +11,26 @@ matrix:
11
11
  fast_finish: true
12
12
 
13
13
  include:
14
- - rvm: 2.3.0
14
+ - rvm: 2.3.1
15
15
  env: RUN=jshint SUITE=core
16
16
 
17
- - rvm: 2.3.0
17
+ - rvm: 2.3.1
18
18
  env: RUN=jshint SUITE=stdlib
19
19
 
20
- - rvm: 2.3.0
20
+ - rvm: 2.3.1
21
21
  env: RUN=mspec_opal_nodejs
22
22
 
23
- - rvm: 2.3.0
23
+ - rvm: 2.3.1
24
24
  env: RUN=mspec_ruby_nodejs TZ="/usr/share/zoneinfo/Pacific/Fiji"
25
25
 
26
- - rvm: 2.3.0
26
+ - rvm: 2.3.1
27
27
  env: RUN=mspec_ruby_sprockets_phantomjs
28
28
 
29
- - rvm: 2.3.0
29
+ - rvm: 2.3.1
30
30
  env: RUN=minitest
31
31
 
32
- - rvm: 2.3.0
33
- env: RUN=rspec RACK_VERSION='2.0.0.alpha' CHECK_COVERAGE=true
32
+ - rvm: 2.3.1
33
+ env: RUN=rspec RACK_VERSION='~> 2.0.0' CHECK_COVERAGE=true
34
34
 
35
35
  - rvm: ruby-head
36
36
  env: RUN=rspec
@@ -38,11 +38,11 @@ matrix:
38
38
  - rvm: 2.2.4
39
39
  env: RUN=rspec TILT_VERSION=2.0.1
40
40
 
41
- - rvm: 2.1.8
42
- env: RUN=rspec
41
+ - rvm: 2.1.10
42
+ env: RUN=rspec RACK_VERSION='< 2.0'
43
43
 
44
44
  - rvm: 2.0.0
45
- env: RUN="rspec mspec_opal_nodejs"
45
+ env: RUN="rspec mspec_opal_nodejs" RACK_VERSION='< 2.0'
46
46
 
47
47
  - rvm: rbx
48
48
  env: RUN=rspec
data/CHANGELOG.md CHANGED
@@ -21,7 +21,7 @@ Whitespace conventions:
21
21
 
22
22
 
23
23
 
24
- ## [0.10.0] - Unreleased
24
+ ## [0.10.0] - 2016-07-04
25
25
 
26
26
 
27
27
  ### Added
@@ -123,6 +123,7 @@ Whitespace conventions:
123
123
  - Fixed method definition in method body.
124
124
  - Partially implemented `Marshal.load`/`Marshal.dump`. In order to use it require `opal/full`.
125
125
  - Fixed docs for Compiled Ruby - Native section. Rename opal variable to win since window was causing error
126
+ - Fixed the `--map` option, now correclty outputs the sourcemap as json
126
127
 
127
128
 
128
129
  ### Removed
data/lib/opal/cli.rb CHANGED
@@ -36,6 +36,7 @@ module Opal
36
36
  @compile = !!options.delete(:compile)
37
37
  @sexp = options.delete(:sexp)
38
38
  @file = options.delete(:file)
39
+ @map = options.delete(:map)
39
40
  @no_exit = options.delete(:no_exit)
40
41
  @lib_only = options.delete(:lib_only)
41
42
  @argv = options.delete(:argv) || []
@@ -66,6 +67,7 @@ module Opal
66
67
 
67
68
  def run
68
69
  case
70
+ when @map; show_source_map
69
71
  when sexp?; show_sexp
70
72
  when compile?; show_compiled_source
71
73
  else run_code
@@ -132,10 +134,12 @@ module Opal
132
134
  end
133
135
  end
134
136
 
135
- def map
136
- compiler = Opal::Compiler.compile(file.read, options.merge(:file => file.path))
137
- compiler.compile
138
- compiler.source_map
137
+ def show_source_map
138
+ evals_or_file do |contents, filename|
139
+ compiler = Opal::Compiler.new(contents, options.merge(file: filename))
140
+ compiler.compile
141
+ puts compiler.source_map.to_json
142
+ end
139
143
  end
140
144
 
141
145
  def compiler_option_names
@@ -60,6 +60,10 @@ module Opal
60
60
  map.as_json
61
61
  end
62
62
 
63
+ def to_json
64
+ map.as_json
65
+ end
66
+
63
67
  def to_s
64
68
  map.to_s
65
69
  end
data/lib/opal/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  # WHEN RELEASING:
3
3
  # Remember to update RUBY_ENGINE_VERSION in opal/corelib/constants.rb too!
4
- VERSION = '0.10.0.rc2'
4
+ VERSION = '0.10.0'
5
5
  end
@@ -1,8 +1,8 @@
1
1
  RUBY_PLATFORM = 'opal'
2
2
  RUBY_ENGINE = 'opal'
3
3
  RUBY_VERSION = '2.2.3'
4
- RUBY_ENGINE_VERSION = '0.10.0.rc2'
5
- RUBY_RELEASE_DATE = '2016-06-21'
4
+ RUBY_ENGINE_VERSION = '0.10.0'
5
+ RUBY_RELEASE_DATE = '2016-07-04'
6
6
  RUBY_PATCHLEVEL = 0
7
7
  RUBY_REVISION = 0
8
8
  RUBY_COPYRIGHT = 'opal - Copyright (C) 2013-2015 Adam Beynon'
data/spec/lib/cli_spec.rb CHANGED
@@ -180,6 +180,16 @@ describe Opal::CLI do
180
180
  end
181
181
  end
182
182
 
183
+ describe ':map option' do
184
+ let(:options) { {:map => true, :evals => ['foo']} }
185
+
186
+ it 'sets the verbose flag (currently unused)' do
187
+ expect_output_of{ subject.run }.to include(%{"version"=>3})
188
+ end
189
+ end
190
+
191
+
192
+
183
193
 
184
194
 
185
195
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0.rc2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Beynon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-21 00:00:00.000000000 Z
11
+ date: 2016-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sourcemap
@@ -1151,9 +1151,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1151
1151
  version: 1.9.3
1152
1152
  required_rubygems_version: !ruby/object:Gem::Requirement
1153
1153
  requirements:
1154
- - - ">"
1154
+ - - ">="
1155
1155
  - !ruby/object:Gem::Version
1156
- version: 1.3.1
1156
+ version: '0'
1157
1157
  requirements: []
1158
1158
  rubyforge_project:
1159
1159
  rubygems_version: 2.6.4