opal-rails 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +31 -14
- data/Appraisals +14 -5
- data/CHANGELOG.md +17 -1
- data/Gemfile +1 -1
- data/gemfiles/rails_4_2_opal_0_11.gemfile +10 -0
- data/gemfiles/rails_4_2_opal_master.gemfile +10 -0
- data/gemfiles/rails_5_0_opal_0_11.gemfile +10 -0
- data/gemfiles/rails_5_0_opal_master.gemfile +10 -0
- data/gemfiles/rails_5_1_opal_0_11.gemfile +10 -0
- data/gemfiles/rails_5_1_opal_master.gemfile +10 -0
- data/gemfiles/rails_5_2_opal_0_11.gemfile +10 -0
- data/gemfiles/rails_5_2_opal_master.gemfile +10 -0
- data/lib/opal/rails/engine.rb +8 -6
- data/lib/opal/rails/version.rb +1 -1
- data/opal-rails.gemspec +2 -3
- data/spec/integration/assigns_spec.rb +1 -1
- data/spec/integration/source_map_spec.rb +19 -20
- data/spec/integration/template_spec.rb +1 -1
- data/test_apps/application_controller.rb +6 -0
- data/test_apps/rails5.rb +4 -0
- metadata +15 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e7eccec608dbb61b5b803b1c7800a9040d457e2fecf7f3846a19a36078d5ac4
|
4
|
+
data.tar.gz: 2fbc3fe3a0801c672264989a726aa5fd619183fc0faf9db50d1e2b2894638d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e95a46eabeb4904fce2a865711114dd9f3790963c3514473e6849e5af63da5dd18d85f23d3c3ae04e449e5cda9b4f6e1d035e0a76c4113672d666ad851c4c9ab
|
7
|
+
data.tar.gz: 7bfe7674b4608851ebd69f2256a9089ca99654805ba04168f5df8fdb55bff1fa1b887948067a48e95a14dbb21b8552d47ecbd047570a0755d806f68358cb66a1
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -5,20 +5,37 @@ sudo: false
|
|
5
5
|
cache:
|
6
6
|
bundler: true
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
8
|
+
matrix:
|
9
|
+
fast_finish: true
|
10
|
+
|
11
|
+
include:
|
12
|
+
- gemfile: gemfiles/rails_4_2_opal_master.gemfile
|
13
|
+
rvm: 2.3.7
|
14
|
+
- gemfile: gemfiles/rails_5_0_opal_master.gemfile
|
15
|
+
rvm: 2.4.4
|
16
|
+
- gemfile: gemfiles/rails_5_1_opal_master.gemfile
|
17
|
+
rvm: 2.5.1
|
18
|
+
- gemfile: gemfiles/rails_5_2_opal_master.gemfile
|
19
|
+
rvm: 2.5.1
|
20
|
+
|
21
|
+
- gemfile: gemfiles/rails_4_2_opal_0_11.gemfile
|
22
|
+
rvm: 2.3.7
|
23
|
+
- gemfile: gemfiles/rails_5_0_opal_0_11.gemfile
|
24
|
+
rvm: 2.4.4
|
25
|
+
- gemfile: gemfiles/rails_5_1_opal_0_11.gemfile
|
26
|
+
rvm: 2.5.1
|
27
|
+
- gemfile: gemfiles/rails_5_2_opal_0_11.gemfile
|
28
|
+
rvm: 2.5.1
|
29
|
+
|
30
|
+
allow_failures:
|
31
|
+
- gemfile: gemfiles/rails_4_2_opal_master.gemfile
|
32
|
+
rvm: 2.3.7
|
33
|
+
- gemfile: gemfiles/rails_5_0_opal_master.gemfile
|
34
|
+
rvm: 2.4.4
|
35
|
+
- gemfile: gemfiles/rails_5_1_opal_master.gemfile
|
36
|
+
rvm: 2.5.1
|
37
|
+
- gemfile: gemfiles/rails_5_2_opal_master.gemfile
|
38
|
+
rvm: 2.5.1
|
22
39
|
|
23
40
|
before_script: bundle install
|
24
41
|
script: "bundle exec rake"
|
data/Appraisals
CHANGED
@@ -4,14 +4,18 @@ ruby_2_4_0 = Gem::Version.new('2.4.0')
|
|
4
4
|
|
5
5
|
ENV['OPAL_VERSION'] = nil # ensure the env is clean
|
6
6
|
|
7
|
+
github = -> repo_name { "https://github.com/#{repo_name}.git" }
|
8
|
+
|
7
9
|
{
|
8
10
|
opal_master: -> gemfile do
|
9
|
-
gemfile.gem 'opal',
|
10
|
-
gemfile.gem 'opal-rspec',
|
11
|
-
gemfile.gem 'opal-sprockets',
|
11
|
+
gemfile.gem 'opal', git: github['opal/opal'], branch: :master
|
12
|
+
gemfile.gem 'opal-rspec', git: github['opal/opal-rspec'], branch: :master
|
13
|
+
gemfile.gem 'opal-sprockets', git: github['opal/opal-sprockets'], branch: :master
|
12
14
|
end,
|
13
|
-
|
14
|
-
gemfile.gem 'opal', '~> 0.
|
15
|
+
opal_0_11: -> gemfile do
|
16
|
+
gemfile.gem 'opal', '~> 0.11.0'
|
17
|
+
gemfile.gem 'opal-rspec', git: github['opal/opal-rspec'], branch: :master
|
18
|
+
gemfile.gem 'opal-sprockets'
|
15
19
|
end,
|
16
20
|
}.each do |opal_version, gem_opal|
|
17
21
|
appraise "rails-4-1-#{opal_version}" do
|
@@ -34,4 +38,9 @@ ENV['OPAL_VERSION'] = nil # ensure the env is clean
|
|
34
38
|
gem "rails", "~> 5.1.0"
|
35
39
|
gem_opal[self]
|
36
40
|
end if current_ruby >= ruby_2_2_2
|
41
|
+
|
42
|
+
appraise "rails-5-2-#{opal_version}" do
|
43
|
+
gem "rails", "~> 5.2.0"
|
44
|
+
gem_opal[self]
|
45
|
+
end if current_ruby >= ruby_2_2_2
|
37
46
|
end
|
data/CHANGELOG.md
CHANGED
@@ -21,7 +21,23 @@ Whitespace conventions:
|
|
21
21
|
|
22
22
|
|
23
23
|
|
24
|
-
## [0.9.
|
24
|
+
## [0.9.5](https://github.com/opal/opal-rails/compare/v0.9.4...v0.9.5) - 2018-09-07
|
25
|
+
|
26
|
+
|
27
|
+
### Added
|
28
|
+
|
29
|
+
- Added support for inline source-maps provided by opal-sprockets 0.4.2+
|
30
|
+
- Added Rails 5.2 to the test matrix
|
31
|
+
|
32
|
+
|
33
|
+
### Removed
|
34
|
+
|
35
|
+
- Removed support for Opal v0.10
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
## [0.9.4](https://github.com/opal/opal-rails/compare/v0.9.3...v0.9.4) - 2018-02-13
|
25
41
|
|
26
42
|
|
27
43
|
### Changed
|
data/Gemfile
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
|
8
8
|
if ENV['OPAL_VERSION'] == 'master'
|
9
9
|
gem 'opal', github: 'opal', branch: :master
|
10
|
-
gem 'opal-rspec', github: 'opal/opal-rspec', branch:
|
10
|
+
gem 'opal-rspec', github: 'opal/opal-rspec', branch: :master
|
11
11
|
gem 'opal-sprockets', github: 'opal/opal-sprockets', branch: :master
|
12
12
|
end
|
13
13
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 4.2.7"
|
6
|
+
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
7
|
+
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
8
|
+
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
9
|
+
|
10
|
+
gemspec path: "../"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 5.0.0"
|
6
|
+
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
7
|
+
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
8
|
+
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
9
|
+
|
10
|
+
gemspec path: "../"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 5.1.0"
|
6
|
+
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
7
|
+
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
8
|
+
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
9
|
+
|
10
|
+
gemspec path: "../"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 5.2.0"
|
6
|
+
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
7
|
+
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
8
|
+
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
9
|
+
|
10
|
+
gemspec path: "../"
|
data/lib/opal/rails/engine.rb
CHANGED
@@ -34,14 +34,16 @@ module Opal
|
|
34
34
|
Opal::Config.send(key, value) if Opal::Config.respond_to? key
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
if defined?(Opa::SourceMapServer)
|
38
|
+
app.routes.prepend do
|
39
|
+
if Opal::Config.source_map_enabled && config.assets.compile && config.assets.debug
|
40
|
+
maps_prefix = '/__OPAL_SOURCE_MAPS__'
|
41
|
+
maps_app = Opal::SourceMapServer.new(app.assets, maps_prefix)
|
41
42
|
|
42
|
-
|
43
|
+
::Opal::Sprockets::SourceMapHeaderPatch.inject!(maps_prefix)
|
43
44
|
|
44
|
-
|
45
|
+
mount maps_app => maps_prefix
|
46
|
+
end
|
45
47
|
end
|
46
48
|
end
|
47
49
|
end
|
data/lib/opal/rails/version.rb
CHANGED
data/opal-rails.gemspec
CHANGED
@@ -29,9 +29,9 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_dependency 'sprockets-rails', '>= 2.3.3', '< 4.0'
|
30
30
|
s.add_dependency 'jquery-rails'
|
31
31
|
|
32
|
-
s.add_dependency 'opal', '>= 0.
|
32
|
+
s.add_dependency 'opal', '>= 0.11.0', '< 0.12'
|
33
33
|
s.add_dependency 'opal-jquery', '~> 0.4.0'
|
34
|
-
s.add_dependency 'opal-sprockets', '~> 0.4.
|
34
|
+
s.add_dependency 'opal-sprockets', '~> 0.4.2'
|
35
35
|
s.add_dependency 'opal-activesupport', '>= 0.0.5'
|
36
36
|
|
37
37
|
s.add_development_dependency 'execjs'
|
@@ -41,6 +41,5 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.add_development_dependency 'rspec-rails'
|
42
42
|
s.add_development_dependency 'appraisal', '~> 2.1'
|
43
43
|
s.add_development_dependency 'sqlite3'
|
44
|
-
s.add_development_dependency 'capybara-webkit'
|
45
44
|
s.add_development_dependency 'puma'
|
46
45
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'base64'
|
1
2
|
require 'spec_helper'
|
2
3
|
require 'opal/source_map'
|
3
4
|
|
@@ -9,35 +10,33 @@ describe Opal::SourceMap do
|
|
9
10
|
expect(Rails.application.config.assets.compile).to be_truthy
|
10
11
|
expect(Rails.application.assets).to be_present
|
11
12
|
expect(Rails.application.config.assets.debug).to be_truthy
|
12
|
-
get js_asset_path
|
13
13
|
end
|
14
14
|
|
15
|
-
let(:map_path) { extract_map_path(response) }
|
16
|
-
|
17
15
|
let(:map_body) do
|
18
|
-
get
|
19
|
-
expect(response).to be_success, "url: #{map_path}\nstatus: #{response.status}"
|
20
|
-
response.body
|
21
|
-
end
|
16
|
+
get js_asset_path
|
22
17
|
|
23
|
-
|
18
|
+
inline_map_prefix = '//# sourceMappingURL=data:application/json;base64,'
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
if response.body.lines.last.start_with? inline_map_prefix
|
21
|
+
Base64.decode64(response.body.lines.last.split(inline_map_prefix, 2)[1])
|
22
|
+
else
|
23
|
+
source_map_regexp = %r{^//[@#] sourceMappingURL=([^\n]+)}
|
24
|
+
header_map_path = response.headers['X-SourceMap'].presence
|
25
|
+
comment_map_path = response.body.scan(source_map_regexp).flatten.first.to_s.strip.presence
|
26
|
+
|
27
|
+
map_path = header_map_path || comment_map_path
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
expect(map_body[key]).to be_present
|
29
|
+
get map_path
|
30
|
+
expect(response).to be_successful, "url: #{map_path}\nstatus: #{response.status}"
|
31
|
+
response.body
|
33
32
|
end
|
34
33
|
end
|
35
34
|
|
36
|
-
|
37
|
-
source_map_regexp = %r{^//[@#] sourceMappingURL=([^\n]+)}
|
38
|
-
header_map_path = response.headers['X-SourceMap'].presence
|
39
|
-
comment_map_path = response.body.scan(source_map_regexp).flatten.first.to_s.strip.presence
|
35
|
+
let(:map) { JSON.parse(map_body, symbolize_names: true) }
|
40
36
|
|
41
|
-
|
37
|
+
it 'has the source map be there' do
|
38
|
+
expect(map).to be_present
|
39
|
+
expect(map[:sources]).to be_present
|
40
|
+
expect(map[:mappings]).to be_present
|
42
41
|
end
|
43
42
|
end
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe 'template handler' do
|
4
4
|
it 'has the correct content type' do
|
5
5
|
get '/application/with_assignments.js'
|
6
|
-
expect(response).to
|
6
|
+
expect(response).to be_successful
|
7
7
|
expect(response.headers['Content-Type']).to eq('text/javascript; charset=utf-8')
|
8
8
|
end
|
9
9
|
end
|
@@ -44,3 +44,9 @@ class ApplicationController < ActionController::Base
|
|
44
44
|
render type: :js, locals: { local_var: 'i am local' }
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
Rails.logger = Logger.new(STDOUT) if $DEBUG
|
49
|
+
|
50
|
+
require 'opal/sprockets/version'
|
51
|
+
p rails: Rails.version, opal: Opal::VERSION, ruby: RUBY_VERSION, opal_sprockets: Opal::Sprockets::VERSION
|
52
|
+
|
data/test_apps/rails5.rb
CHANGED
@@ -21,6 +21,10 @@ module RailsApp
|
|
21
21
|
config.active_support.deprecation = :stderr
|
22
22
|
config.secret_key_base = '49837489qkuweoiuoqwe'
|
23
23
|
|
24
|
+
if config.active_record.sqlite3
|
25
|
+
config.active_record.sqlite3.represent_boolean_as_integer = true
|
26
|
+
end
|
27
|
+
|
24
28
|
config.middleware.delete Rack::Lock
|
25
29
|
config.middleware.delete ActionDispatch::Flash
|
26
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -70,7 +70,7 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: 0.
|
73
|
+
version: 0.11.0
|
74
74
|
- - "<"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0.12'
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.
|
83
|
+
version: 0.11.0
|
84
84
|
- - "<"
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0.12'
|
@@ -104,14 +104,14 @@ dependencies:
|
|
104
104
|
requirements:
|
105
105
|
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version: 0.4.
|
107
|
+
version: 0.4.2
|
108
108
|
type: :runtime
|
109
109
|
prerelease: false
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
112
|
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: 0.4.
|
114
|
+
version: 0.4.2
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: opal-activesupport
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,20 +224,6 @@ dependencies:
|
|
224
224
|
- - ">="
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
|
-
- !ruby/object:Gem::Dependency
|
228
|
-
name: capybara-webkit
|
229
|
-
requirement: !ruby/object:Gem::Requirement
|
230
|
-
requirements:
|
231
|
-
- - ">="
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
version: '0'
|
234
|
-
type: :development
|
235
|
-
prerelease: false
|
236
|
-
version_requirements: !ruby/object:Gem::Requirement
|
237
|
-
requirements:
|
238
|
-
- - ">="
|
239
|
-
- !ruby/object:Gem::Version
|
240
|
-
version: '0'
|
241
227
|
- !ruby/object:Gem::Dependency
|
242
228
|
name: puma
|
243
229
|
requirement: !ruby/object:Gem::Requirement
|
@@ -270,6 +256,14 @@ files:
|
|
270
256
|
- Rakefile
|
271
257
|
- app/helpers/opal_helper.rb
|
272
258
|
- config.ru
|
259
|
+
- gemfiles/rails_4_2_opal_0_11.gemfile
|
260
|
+
- gemfiles/rails_4_2_opal_master.gemfile
|
261
|
+
- gemfiles/rails_5_0_opal_0_11.gemfile
|
262
|
+
- gemfiles/rails_5_0_opal_master.gemfile
|
263
|
+
- gemfiles/rails_5_1_opal_0_11.gemfile
|
264
|
+
- gemfiles/rails_5_1_opal_master.gemfile
|
265
|
+
- gemfiles/rails_5_2_opal_0_11.gemfile
|
266
|
+
- gemfiles/rails_5_2_opal_master.gemfile
|
273
267
|
- lib/assets/javascripts/opal_ujs.js.rb
|
274
268
|
- lib/opal-rails.rb
|
275
269
|
- lib/opal/rails.rb
|
@@ -319,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
313
|
version: '0'
|
320
314
|
requirements: []
|
321
315
|
rubyforge_project: opal-rails
|
322
|
-
rubygems_version: 2.7.
|
316
|
+
rubygems_version: 2.7.7
|
323
317
|
signing_key:
|
324
318
|
specification_version: 4
|
325
319
|
summary: Rails bindings for opal JS engine
|