opal-rails 1.1.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/{main.yml → build.yml} +13 -6
- data/.gitignore +1 -0
- data/Appraisals +17 -16
- data/CHANGELOG.md +49 -0
- data/Gemfile +8 -3
- data/README.md +50 -16
- data/app/helpers/opal_helper.rb +6 -5
- data/bin/rackup +29 -0
- data/bin/rails +8 -0
- data/bin/rails-engine +13 -0
- data/bin/rails-sandbox +18 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/bin/sandbox +39 -0
- data/bin/sandbox-setup +14 -0
- data/bin/setup +8 -0
- data/config.ru +1 -2
- data/gemfiles/rails_6_0_opal_1_0.gemfile +1 -3
- data/gemfiles/rails_6_0_opal_1_1.gemfile +9 -0
- data/gemfiles/rails_6_0_opal_1_3.gemfile +10 -0
- data/gemfiles/rails_6_0_opal_1_4.gemfile +10 -0
- data/gemfiles/rails_6_1_opal_1_0.gemfile +10 -0
- data/gemfiles/rails_6_1_opal_1_1.gemfile +9 -0
- data/gemfiles/rails_6_1_opal_1_3.gemfile +10 -0
- data/gemfiles/rails_6_1_opal_1_4.gemfile +10 -0
- data/gemfiles/rails_7_0_opal_1_0.gemfile +10 -0
- data/gemfiles/rails_7_0_opal_1_3.gemfile +10 -0
- data/gemfiles/rails_7_0_opal_1_4.gemfile +10 -0
- data/lib/assets/javascripts/opal_ujs.js.rb +1 -4
- data/lib/generators/opal/assets/assets_generator.rb +7 -0
- data/lib/{rails/generators → generators}/opal/assets/templates/javascript.js.rb +0 -0
- data/lib/generators/opal/install/USAGE +8 -0
- data/lib/generators/opal/install/install_generator.rb +14 -0
- data/lib/generators/opal/install/templates/application.js.rb +12 -0
- data/lib/generators/opal/install/templates/initializer.rb +22 -0
- data/lib/opal/rails/engine.rb +1 -0
- data/lib/opal/rails/template_handler.rb +4 -2
- data/lib/opal/rails/version.rb +1 -1
- data/lib/opal/rails.rb +0 -4
- data/opal-rails.gemspec +45 -40
- data/spec/helpers/opal_helper_spec.rb +23 -9
- data/spec/integration/source_map_spec.rb +9 -5
- data/spec/support/test_app.rb +1 -2
- data/test_apps/{application_controller.rb → app/application_controller.rb} +1 -1
- data/test_apps/app/assets/config/manifest.js +1 -0
- data/test_apps/{assets → app/assets}/javascripts/application.js.rb +1 -0
- data/test_apps/{assets → app/assets}/javascripts/bar.rb +0 -0
- data/test_apps/{assets → app/assets}/javascripts/foo.js.rb +0 -0
- data/test_apps/{assets → app/assets}/javascripts/source_map_example.js.rb +0 -0
- data/test_apps/{assets → app/assets}/javascripts/with_assignments.js.rb +0 -0
- data/test_apps/{rails6.rb → rails.rb} +1 -3
- metadata +56 -83
- data/gemfiles/rails_5_1_opal_1_0.gemfile +0 -12
- data/gemfiles/rails_5_1_opal_master.gemfile +0 -11
- data/gemfiles/rails_5_2_opal_1_0.gemfile +0 -12
- data/gemfiles/rails_5_2_opal_master.gemfile +0 -11
- data/gemfiles/rails_6_0_opal_master.gemfile +0 -11
- data/lib/rails/generators/opal/assets/assets_generator.rb +0 -12
- data/test_apps/rails5.rb +0 -50
@@ -1,11 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "c_lexer"
|
6
|
-
gem "rails", "~> 5.1.0"
|
7
|
-
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
8
|
-
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
9
|
-
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
10
|
-
|
11
|
-
gemspec path: "../"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "c_lexer"
|
6
|
-
gem "rails", "~> 5.2.0"
|
7
|
-
gem "opal", "~> 1.0.0"
|
8
|
-
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
9
|
-
gem "opal-jquery", git: "https://github.com/opal/opal-jquery.git", branch: :master
|
10
|
-
gem "opal-sprockets"
|
11
|
-
|
12
|
-
gemspec path: "../"
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "c_lexer"
|
6
|
-
gem "rails", "~> 5.2.0"
|
7
|
-
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
8
|
-
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
9
|
-
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
10
|
-
|
11
|
-
gemspec path: "../"
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "c_lexer"
|
6
|
-
gem "rails", "~> 6.0.0"
|
7
|
-
gem "opal", git: "https://github.com/opal/opal.git", branch: :master
|
8
|
-
gem "opal-rspec", git: "https://github.com/opal/opal-rspec.git", branch: :master
|
9
|
-
gem "opal-sprockets", git: "https://github.com/opal/opal-sprockets.git", branch: :master
|
10
|
-
|
11
|
-
gemspec path: "../"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'rails/generators/named_base'
|
2
|
-
|
3
|
-
module Opal
|
4
|
-
module Generators
|
5
|
-
class AssetsGenerator < ::Rails::Generators::NamedBase
|
6
|
-
source_root __dir__+'/templates'
|
7
|
-
def copy_opal
|
8
|
-
template 'javascript.js.rb', File.join('app/assets/javascripts', class_path, "#{file_name}.js.rb")
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/test_apps/rails5.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
# FROM: http://www.rubytutorial.io/how-to-test-your-gem-against-multiple-rails/
|
2
|
-
|
3
|
-
# test/apps/rails5.rb
|
4
|
-
require 'rails'
|
5
|
-
require 'rails/all'
|
6
|
-
require 'action_view/testing/resolvers'
|
7
|
-
|
8
|
-
require 'opal-rails' # our gem
|
9
|
-
|
10
|
-
module RailsApp
|
11
|
-
class Application < Rails::Application
|
12
|
-
config.root = __dir__
|
13
|
-
config.cache_classes = true
|
14
|
-
config.eager_load = false
|
15
|
-
config.public_file_server.enabled = true
|
16
|
-
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
17
|
-
config.consider_all_requests_local = true
|
18
|
-
config.action_controller.perform_caching = false
|
19
|
-
config.action_dispatch.show_exceptions = false
|
20
|
-
config.action_controller.allow_forgery_protection = false
|
21
|
-
config.active_support.deprecation = :stderr
|
22
|
-
config.secret_key_base = '49837489qkuweoiuoqwe'
|
23
|
-
|
24
|
-
if config.active_record.sqlite3
|
25
|
-
config.active_record.sqlite3.represent_boolean_as_integer = true
|
26
|
-
end
|
27
|
-
|
28
|
-
config.middleware.delete Rack::Lock
|
29
|
-
config.middleware.delete ActionDispatch::Flash
|
30
|
-
|
31
|
-
routes.append do
|
32
|
-
get '/' => 'application#index'
|
33
|
-
get '/application/with_assignments' => 'application#with_assignments'
|
34
|
-
|
35
|
-
# just to reduce noise
|
36
|
-
get '/apple-touch-icon-precomposed.png' => -> { [404,{},[]] }
|
37
|
-
get '/favicon.ico' => -> { [404,{},[]] }
|
38
|
-
end
|
39
|
-
|
40
|
-
config.assets.paths << File.join(__dir__, 'assets/javascripts')
|
41
|
-
config.assets.debug = true
|
42
|
-
config.assets.digest = true
|
43
|
-
|
44
|
-
# Opal specific:
|
45
|
-
config.opal.source_map_enabled = true
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
require_relative './application_controller'
|
50
|
-
RailsApp::Application.initialize!
|