opal-rails 0.9.0 → 0.9.1

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: ed236f416a615a09d374712bcdc11ddc57c316ee
4
- data.tar.gz: b4912b61deeacf0f1ff22f12abb3082c4c9e9a8f
3
+ metadata.gz: 36eac0db3f7ca54d4e90348a784fc39719be3524
4
+ data.tar.gz: db4a917040f7c9869303fa76131dde1f297135d3
5
5
  SHA512:
6
- metadata.gz: e79a4ca05c7917dacdc1af9a37cfd23b5d394b7e3158b9bcd4bcbf181c63ca678ca39606c1c3cb8a72591d0343a8e50bd529f06f832ddf8420d0fe1511239aa1
7
- data.tar.gz: 42f971503e34be50854cfc28cbad4669a7b9e498c669797e677002216e9662f36a4a6932b52c01267915aa5e295291c6214b6895b9db96f14ab981068dc4a04c
6
+ metadata.gz: c79a5503e7c54e39c83f71349e053a5cb5c3eca1d6d1cc93847813b560f14fb05396fa885562ea088b36db64a573b6f788adf82096413a53926f5f4d6aa17722
7
+ data.tar.gz: 78332734b60237a4e77a6797d76c659bf6b9e5b3013098973c93c33d53bff27dd3a2127d87d37f3945887e2ff40ebe59ac577b865f0d229f4459fe83e35ff237
data/.travis.yml CHANGED
@@ -6,9 +6,9 @@ cache:
6
6
  bundler: true
7
7
 
8
8
  rvm:
9
- - 2.3.0
10
- - 2.2.3
11
- - 2.1.6
9
+ - 2.3.3
10
+ - 2.2.4
11
+ - 2.1.10
12
12
  - 2.0.0
13
13
 
14
14
  before_script:
data/Appraisals CHANGED
@@ -7,5 +7,5 @@ appraise "rails-4-2" do
7
7
  end
8
8
 
9
9
  appraise "rails-5" do
10
- gem "rails", "~> 5.0.0.beta1"
10
+ gem "rails", "~> 5.0.0"
11
11
  end if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.2')
data/CHANGELOG.md CHANGED
@@ -22,7 +22,22 @@ Whitespace conventions:
22
22
 
23
23
 
24
24
 
25
- ## [0.9.0] - Unreleased
25
+ ## [0.9.1] - 2016-11-30
26
+
27
+
28
+ ### Added
29
+
30
+ - Added ability to disable passing local and instance variables to the Opal template handler by setting `Rails.application.config.opal.assigns_in_templates = false` in `config/initializers/assets.rb` (thanks to @lorefnon)
31
+ - Added dependency to `opal-sprockets` in preparation for Opal 0.11
32
+
33
+
34
+ ### Changed
35
+
36
+ - Simplified the Opal file generated for a controller
37
+
38
+
39
+
40
+ ## [0.9.0] - 2016-06-16
26
41
 
27
42
 
28
43
  ### Added
@@ -136,7 +151,12 @@ Whitespace conventions:
136
151
  - Add `opal_ujs`, now it's possible to use Opal for new Rails apps: `rails new <app-name> -j opal`
137
152
  - Updated README examples
138
153
 
139
- [0.9.0]: https://github.com/opal/opal-rails/compare/v0.8.1...HEAD
154
+
155
+
156
+
157
+ [Unreleased]: https://github.com/opal/opal-rails/compare/v0.9.1...HEAD
158
+ [0.9.1]: https://github.com/opal/opal-rails/compare/v0.9.0...v0.9.1
159
+ [0.9.0]: https://github.com/opal/opal-rails/compare/v0.8.1...v0.9.0
140
160
  [0.8.1]: https://github.com/opal/opal-rails/compare/v0.8.0...v0.8.1
141
161
  [0.8.0]: https://github.com/opal/opal-rails/compare/v0.7.0...v0.8.0
142
162
  [0.7.0]: https://github.com/opal/opal-rails/compare/v0.6.3...v0.7.0
data/Gemfile CHANGED
@@ -1,2 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+
4
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
5
+ gem 'rails', '< 5'
6
+ end
data/README.md CHANGED
@@ -27,82 +27,78 @@ rails new <app-name> --javascript=opal
27
27
 
28
28
  ### Configuration
29
29
 
30
- Add your configuration in `config/application.rb` with the following contents:
30
+ Add your configuration in `config/initializers/assets.rb` with the following contents:
31
31
 
32
32
  ```ruby
33
- module MyApp
34
- class Application < Rails::Application
35
- # These are the available options with their default values
36
-
37
- # Compiler options
38
- config.opal.method_missing = true
39
- config.opal.optimized_operators = true
40
- config.opal.arity_check = false
41
- config.opal.const_missing = true
42
- config.opal.dynamic_require_severity = :ignore
43
-
44
- # Enable/disable /opal_specs route
45
- config.opal.enable_specs = true
46
-
47
- # The path to opal specs from Rails.root
48
- config.opal.spec_location = 'spec-opal'
49
- end
50
- end
33
+ # Compiler options
34
+ Rails.application.config.opal.method_missing = true
35
+ Rails.application.config.opal.optimized_operators = true
36
+ Rails.application.config.opal.arity_check = !Rails.env.production?
37
+ Rails.application.config.opal.const_missing = true
38
+ Rails.application.config.opal.dynamic_require_severity = :ignore
51
39
  ```
52
40
 
53
-
54
- ## Usage
41
+ For a full list of the available configuration options please refer to: [lib/opal/config.rb](https://github.com/opal/opal/blob/master/lib/opal/config.rb).
55
42
 
56
43
 
57
- ### Asset Pipeline
58
44
 
59
- You can rename `app/assets/javascripts/application.js` to `application.js.rb`. Even if not necessary, it is recommended to change Sprockets' `//= require` statements to Ruby' `require` methods.
60
- Sprockets' `//= require` statements won't be known by the opal builder and therefore you can end up adding something twice.
45
+ ## Usage
61
46
 
62
- For Opal 0.8 and above, you have to use `application.js.rb` with the following syntax:
47
+ Rename `app/assets/javascripts/application.js` to `app/assets/javascripts/application.js.rb` and
48
+ replace the Sprockets directives with plain requires as follows:
63
49
 
64
50
  ```ruby
65
- # app/assets/javascripts/application.js.rb
66
-
67
51
  require 'opal'
68
52
  require 'opal_ujs'
69
53
  require 'turbolinks'
70
- require_tree '.'
71
- ```
54
+ require_tree '.' # a Ruby equivalent of the require_tree Sprockets directive is available
72
55
 
73
- If you want to use `application.js`, you need to `load` the Opal modules(files) manually, e.g.:
56
+ # ---- YOUR FANCY RUBY CODE HERE ----
57
+ #
58
+ # Examples:
74
59
 
75
- ```
76
- // application.js
77
- //= require opal
78
- //= require greeter
79
- //= require_self
80
- Opal.load('greeter');
81
- ```
60
+ # == Print something in the browser's console
61
+ puts "Hello world!"
62
+ pp hello: :world
63
+ require 'console'
64
+ $console.log %w[Hello world!]
82
65
 
83
- As you see in the example above, Opal also gives you a Ruby equivalent of `//= require_tree`.
66
+ # == Use Native to wrap native JS objects, $$ is preconfigured to wrap `window`
67
+ require 'native'
68
+ $$.alert "Hello world!"
84
69
 
85
- Opal requires are forwarded to the Asset Pipeline at compile time (similarly to what happens for RubyMotion). You can use either the `.rb` or `.opal` extension:
86
-
87
- ```ruby
88
- # app/assets/javascripts/greeter.js.rb
89
-
90
- puts "G'day world!" # check the console!
91
-
92
- # Dom manipulation
70
+ # == Do some DOM manipulation with jQuery
93
71
  require 'opal-jquery'
94
-
95
72
  Document.ready? do
96
- Element.find('body > header').html = '<h1>Hi there!</h1>'
73
+ Element.find('body').html = '<h1>Hello world!</h1>'
97
74
  end
75
+
76
+ # == Or access the DOM api directly
77
+ $$[:document].addEventListener(:DOMContentLoaded, -> {
78
+ $$[:document].querySelector('body')[:innerHTML] = '<h1>Hello world!</h1>'
79
+ })
80
+
98
81
  ```
99
82
 
100
83
 
84
+ ### Using Sprockets directives
85
+
86
+ If you want to use `application.js` (instead of `application.js.rb`) and keep Sprockets directives, you'll need to load the Opal files you require via Sprockets manually, e.g.:
87
+
88
+ ```js
89
+ //= require opal
90
+ //= require opal_ujs
91
+ //= require turbolinks
92
+ //= require_tree .
93
+ //= require foobar
94
+
95
+ Opal.load('foobar');
96
+ ```
101
97
 
102
98
 
103
99
  ### As a template
104
100
 
105
- You can use it for your views too, it even inherits instance and local variables from actions:
101
+ You can use it for your views too:
106
102
 
107
103
  ```ruby
108
104
  # app/controllers/posts_controller.rb
@@ -113,7 +109,7 @@ def create
113
109
  end
114
110
  ```
115
111
 
116
- Each assign is filtered through JSON so it's reduced to basic types:
112
+ Assigned instance that would normally be available in your views are converted to JSON objects first.
117
113
 
118
114
  ```ruby
119
115
  # app/views/posts/create.js.opal
@@ -124,6 +120,17 @@ post.find('.body').html = @post[:body]
124
120
  post.find('.comments').html = comments_html
125
121
  ```
126
122
 
123
+ #### Instance and local variables in templates
124
+
125
+ By default `opal-rails` will forward any instance and local variable you'll pass to the template.
126
+
127
+ This behavior can be disabled by setting `Rails.application.config.opal.assigns_in_templates` to `false` in `config/initializers/assets.rb`:
128
+
129
+ ```ruby
130
+ Rails.application.config.opal.assigns_in_templates = false
131
+ ```
132
+
133
+
127
134
 
128
135
  ### As a Haml filter (optional)
129
136
 
@@ -156,14 +163,15 @@ Of course you need to require `haml-rails` separately since its presence is not
156
163
 
157
164
  ### RSpec support
158
165
 
159
- _Extracted to [`opal-rspec-rails`](https://github.com/opal/opal-rspec-rails)_
166
+ _Extracted to (unreleased) [`opal-rspec-rails`](https://github.com/opal/opal-rspec-rails)_
160
167
 
161
- Add this line to your `Gemfile`
168
+ Add this line to your `Gemfile`:
162
169
 
163
170
  ```ruby
164
171
  gem 'opal-rspec-rails', github: 'opal/opal-rspec-rails'
165
172
  ```
166
173
 
174
+
167
175
  ### Minitest support
168
176
 
169
177
  _Upcoming as `opal-minitest-rails`_
@@ -171,7 +179,7 @@ _Upcoming as `opal-minitest-rails`_
171
179
 
172
180
  ### Shared templates
173
181
 
174
- As long as the templates are inside the sprockets/opal load path, then you should be able to just require them.
182
+ As long as the templates are inside the Sprockets/Opal load path, then you should be able to just require them.
175
183
 
176
184
  Let's say we have this template `app/views/shared/test.haml`:
177
185
 
@@ -206,7 +214,7 @@ template.render(self)
206
214
 
207
215
  ### Using Ruby gems from Opal
208
216
 
209
- Just use `Opal.use_gem` in your asset initializer (in `config/initializers`).
217
+ Just use `Opal.use_gem` in your asset initializer (`config/initializers/assets.rb`).
210
218
 
211
219
  Example:
212
220
 
@@ -218,7 +226,7 @@ Opal.use_gem 'cannonbol'
218
226
 
219
227
  ## License
220
228
 
221
- © 2012-2015 Elia Schito
229
+ © 2012-2016 Elia Schito
222
230
 
223
231
  Permission is hereby granted, free of charge, to any person obtaining a copy
224
232
  of this software and associated documentation files (the "Software"), to deal
@@ -10,6 +10,7 @@ module Opal
10
10
  config.opal = ActiveSupport::OrderedOptions.new
11
11
 
12
12
  config.opal.dynamic_require_severity = :ignore
13
+ config.opal.assigns_in_templates = true
13
14
 
14
15
  # Cache eager_load_paths now, otherwise the assets dir is added
15
16
  # and its .rb files are eagerly loaded.
@@ -6,24 +6,20 @@ module Opal
6
6
  new.call(template)
7
7
  end
8
8
 
9
-
10
9
  def call(template)
11
10
  escaped = template.source.gsub(':', '\:')
12
11
  string = '%q:' + escaped + ':'
13
- "Opal.compile('Object.new.instance_eval {' << #{assigns} << #{local_assigns} << #{string} << '}')"
14
- end
15
-
16
- private
17
-
18
- def local_assigns
19
- <<-'RUBY'.strip
20
- JSON.parse(local_assigns.to_json).map { |key, val| "#{key} = #{val.inspect};" }.join
21
- RUBY
22
- end
23
12
 
24
- def assigns
25
- <<-'RUBY'.strip
26
- JSON.parse(@_assigns.to_json).map { |key, val| "@#{key} = #{val.inspect};" }.join
13
+ <<-RUBY
14
+ code = []
15
+ code << 'Object.new.instance_eval {'
16
+ if ::Rails.application.config.opal.assigns_in_templates
17
+ code << JSON.parse(local_assigns.to_json).map { |key, val| "\#{key} = \#{val.inspect};" }.join
18
+ code << JSON.parse(@_assigns.to_json).map { |key, val| "@\#{key} = \#{val.inspect};" }.join
19
+ end
20
+ code << #{string}
21
+ code << '}'
22
+ Opal.compile(code.join("\n"))
27
23
  RUBY
28
24
  end
29
25
  end
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Rails
3
- VERSION = '0.9.0'
3
+ VERSION = '0.9.1'
4
4
  end
5
5
  end
@@ -1,21 +1,11 @@
1
1
  require 'rails/generators/named_base'
2
- require 'rails/generators/resource_helpers'
3
2
 
4
3
  module Opal
5
4
  module Generators
6
5
  class AssetsGenerator < ::Rails::Generators::NamedBase
7
- include ::Rails::Generators::ResourceHelpers
8
6
  source_root __dir__+'/templates'
9
-
10
- def initialize(*args)
11
-
12
- module_name = ::Rails::Generators.const_defined?('ModelHelpers') ? 'ModelHelpers' : 'ResourceHelpers'
13
- ::Rails::Generators.const_get(module_name).skip_warn = true
14
- super
15
- end
16
-
17
7
  def copy_opal
18
- template 'javascript.js.rb', File.join('app/assets/javascripts', "#{controller_name.underscore}_view.js.rb")
8
+ template 'javascript.js.rb', File.join('app/assets/javascripts', class_path, "#{file_name}.js.rb")
19
9
  end
20
10
  end
21
11
  end
@@ -6,37 +6,40 @@
6
6
  # Here's an example view class for your controller:
7
7
  #
8
8
  <% if namespaced? -%>
9
- #= require opal
10
- #= require <%= namespaced_file_path %>
9
+ require <%= namespaced_file_path.to_s.inspect %>
11
10
 
12
11
  <% end -%>
13
12
  <% module_namespacing do -%>
14
- class <%= controller_class_name %>View
15
- def initialize(selector = 'body.controller-<%= controller_class_name.underscore %>', parent = Element)
16
- @element = parent.find(selector)
17
- setup
13
+ class <%= class_name %>View
14
+ # We should have <body class="controller-<%%= controller_name %>"> in layouts
15
+ def initialize(selector = 'body.controller-<%= class_name.underscore %>')
16
+ @selector = selector
18
17
  end
19
- attr_reader :element
20
18
 
21
19
  def setup
22
- # Put here the setup for the view behavior
23
- say_hello_when_a_link_is_clicked
20
+ on(:click, 'a', &method(:link_clicked))
24
21
  end
25
22
 
26
- def say_hello_when_a_link_is_clicked
27
- all_links.on :click do |event|
28
- # Use prevent_default to stop default behavior (as you would do in jQuery)
29
- # event.prevent_default
30
-
31
- puts "Hello! (You just clicked on a link: #{event.current_target.text})"
32
- end
23
+ def link_clicked(event)
24
+ event.prevent
25
+ puts "Hello! (You just clicked on a link: #{event.current_target.text})"
33
26
  end
34
27
 
35
28
 
36
29
  private
37
30
 
38
- def all_links
39
- @all_links ||= element.find('a')
31
+ attr_reader :selector, :element
32
+
33
+ # Look for elements in the scope of the base selector
34
+ def find(selector)
35
+ Element.find("#{@selector} #{selector}")
36
+ end
37
+
38
+ # Register events on document to save memory and be friends to Turbolinks
39
+ def on(event, selector = nil, &block)
40
+ Element[`document`].on(event, selector, &block)
40
41
  end
41
42
  end
43
+
44
+ <%= class_name %>View.new.setup
42
45
  <% end -%>
data/opal-rails.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Opal::Rails::VERSION
8
8
  s.authors = ['Elia Schito']
9
9
  s.email = ['elia@schito.me']
10
- s.homepage = 'http://elia.github.com/opal-rails'
10
+ s.homepage = 'https://github.com/opal/opal-rails#readme'
11
11
  s.summary = %q{Rails bindings for opal JS engine}
12
12
  s.description = %q{Rails bindings for opal JS engine}
13
13
  s.license = 'MIT-LICENSE'
@@ -27,9 +27,11 @@ Gem::Specification.new do |s|
27
27
 
28
28
  s.add_dependency 'rails', '>= 4.0', '< 6.0'
29
29
  s.add_dependency 'sprockets-rails', '< 3.0'
30
+ s.add_dependency 'jquery-rails'
31
+
30
32
  s.add_dependency 'opal', '>= 0.8.0', '< 0.11'
31
33
  s.add_dependency 'opal-jquery', '~> 0.4.0'
32
- s.add_dependency 'jquery-rails'
34
+ s.add_dependency 'opal-sprockets', '~> 0.4.0'
33
35
  s.add_dependency 'opal-activesupport', '>= 0.0.5'
34
36
 
35
37
  s.add_development_dependency 'execjs'
@@ -2,20 +2,46 @@ require 'spec_helper'
2
2
  require 'execjs'
3
3
 
4
4
  describe 'controller assignments' do
5
- it 'are in the template' do
6
- source = get_source_of '/application/with_assignments.js'
7
- source.gsub!(/;\s*\Z/,'') # execjs eval doesn't like the trailing semicolon
8
- assignments = opal_eval(source)
9
-
10
- {
11
- :number_var => 1234,
12
- :string_var => 'hello',
13
- :array_var => [1,'a'],
14
- :hash_var => {:a => 1, :b => 2}.stringify_keys,
15
- :object_var => {:contents => 'json representation'}.stringify_keys,
16
- :local_var => 'i am local',
17
- }.each_pair do |ivar, assignment|
18
- assignments[ivar.to_s].should eq(assignment)
5
+ context 'when enabled' do
6
+ before do
7
+ Rails.application.config.opal.assigns_in_templates = true
8
+ end
9
+
10
+ it 'are in the template' do
11
+ source = get_source_of '/application/with_assignments.js'
12
+ assignments = opal_eval(source)
13
+
14
+ {
15
+ :number_var => 1234,
16
+ :string_var => 'hello',
17
+ :array_var => [1,'a'],
18
+ :hash_var => {:a => 1, :b => 2},
19
+ :object_var => {:contents => 'json representation'},
20
+ :local_var => 'i am local',
21
+ }.each_pair do |ivar, assignment|
22
+ expect(assignments[ivar]).to eq(assignment)
23
+ end
24
+ end
25
+ end
26
+
27
+ context 'when disabled' do
28
+ before do
29
+ Rails.application.config.opal.assigns_in_templates = false
30
+ end
31
+
32
+ it 'are not in the template' do
33
+ source = get_source_of '/application/with_assignments.js'
34
+ assignments = opal_eval(source)
35
+ {
36
+ :number_var => 1234,
37
+ :string_var => 'hello',
38
+ :array_var => [1,'a'],
39
+ :hash_var => {:a => 1, :b => 2},
40
+ :object_var => {:contents => 'json representation'},
41
+ :local_var => 'i am local',
42
+ }.each_pair do |ivar, assignment|
43
+ expect(assignments[ivar]).not_to eq(assignment)
44
+ end
19
45
  end
20
46
  end
21
47
 
@@ -26,15 +52,16 @@ describe 'controller assignments' do
26
52
  end
27
53
 
28
54
  def opal_eval source
55
+ source = source.gsub(/;\s*\Z/,'') # execjs eval doesn't like the trailing semicolon
29
56
  builder = Opal::Builder.new
30
57
  builder.build 'opal'
31
58
 
32
59
  # Any lib should be already required in the page,
33
60
  # require won't work in this kind of templates.
34
- builder.build 'native'
61
+ builder.build 'json'
35
62
 
36
63
  context = ExecJS.compile builder.to_s
37
- context.eval source
64
+ JSON.parse context.eval(source), symbolize_names: true
38
65
  rescue
39
66
  $!.message << "\n\n#{source}"
40
67
  raise
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'template handler' do
4
+ it 'has the correct content type' do
5
+ get '/application/with_assignments.js'
6
+ expect(response).to be_success
7
+ expect(response.headers['Content-Type']).to eq('text/javascript; charset=utf-8')
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ config.before(:each) {
3
+ Rails.application.config.opal.assigns_in_templates = true
4
+ }
5
+ end
@@ -12,16 +12,7 @@ raise 'pippo'
12
12
  </script>
13
13
  HTML
14
14
 
15
- WITH_ASSIGNMENTS = <<-RUBY
16
- return {
17
- number_var: @number_var,
18
- string_var: @string_var,
19
- array_var: @array_var,
20
- hash_var: @hash_var,
21
- object_var: @object_var,
22
- local_var: local_var
23
- }.to_n
24
- RUBY
15
+ WITH_ASSIGNMENTS = File.read "#{__dir__}/assets/javascripts/with_assignments.js.rb"
25
16
 
26
17
  class ApplicationController < ActionController::Base
27
18
  include Rails.application.routes.url_helpers
@@ -0,0 +1,9 @@
1
+ require 'json'
2
+ return {
3
+ number_var: @number_var,
4
+ string_var: @string_var,
5
+ array_var: @array_var,
6
+ hash_var: @hash_var,
7
+ object_var: @object_var,
8
+ local_var: defined?(local_var) ? local_var : nil
9
+ }.to_json
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.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elia Schito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-16 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '3.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: jquery-rails
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: opal
49
63
  requirement: !ruby/object:Gem::Requirement
@@ -79,19 +93,19 @@ dependencies:
79
93
  - !ruby/object:Gem::Version
80
94
  version: 0.4.0
81
95
  - !ruby/object:Gem::Dependency
82
- name: jquery-rails
96
+ name: opal-sprockets
83
97
  requirement: !ruby/object:Gem::Requirement
84
98
  requirements:
85
- - - ">="
99
+ - - "~>"
86
100
  - !ruby/object:Gem::Version
87
- version: '0'
101
+ version: 0.4.0
88
102
  type: :runtime
89
103
  prerelease: false
90
104
  version_requirements: !ruby/object:Gem::Requirement
91
105
  requirements:
92
- - - ">="
106
+ - - "~>"
93
107
  - !ruby/object:Gem::Version
94
- version: '0'
108
+ version: 0.4.0
95
109
  - !ruby/object:Gem::Dependency
96
110
  name: opal-activesupport
97
111
  requirement: !ruby/object:Gem::Requirement
@@ -214,7 +228,6 @@ files:
214
228
  - ".gitignore"
215
229
  - ".powder"
216
230
  - ".rspec"
217
- - ".spectator.rb"
218
231
  - ".travis.yml"
219
232
  - Appraisals
220
233
  - CHANGELOG.md
@@ -238,18 +251,21 @@ files:
238
251
  - spec/helpers/opal_helper_spec.rb
239
252
  - spec/integration/assigns_spec.rb
240
253
  - spec/integration/source_map_spec.rb
254
+ - spec/integration/template_spec.rb
241
255
  - spec/spec_helper.rb
242
256
  - spec/support/capybara.rb
243
257
  - spec/support/reset_assets_cache.rb
258
+ - spec/support/reset_config.rb
244
259
  - spec/support/test_app.rb
245
260
  - test_apps/application_controller.rb
246
261
  - test_apps/assets/javascripts/application.js.rb
247
262
  - test_apps/assets/javascripts/bar.rb
248
263
  - test_apps/assets/javascripts/foo.js.rb
249
264
  - test_apps/assets/javascripts/source_map_example.js.rb
265
+ - test_apps/assets/javascripts/with_assignments.js.rb
250
266
  - test_apps/rails4.rb
251
267
  - test_apps/rails5.rb
252
- homepage: http://elia.github.com/opal-rails
268
+ homepage: https://github.com/opal/opal-rails#readme
253
269
  licenses:
254
270
  - MIT-LICENSE
255
271
  metadata: {}
@@ -271,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
287
  version: '0'
272
288
  requirements: []
273
289
  rubyforge_project: opal-rails
274
- rubygems_version: 2.6.4
290
+ rubygems_version: 2.5.1
275
291
  signing_key:
276
292
  specification_version: 4
277
293
  summary: Rails bindings for opal JS engine
@@ -279,7 +295,9 @@ test_files:
279
295
  - spec/helpers/opal_helper_spec.rb
280
296
  - spec/integration/assigns_spec.rb
281
297
  - spec/integration/source_map_spec.rb
298
+ - spec/integration/template_spec.rb
282
299
  - spec/spec_helper.rb
283
300
  - spec/support/capybara.rb
284
301
  - spec/support/reset_assets_cache.rb
302
+ - spec/support/reset_config.rb
285
303
  - spec/support/test_app.rb
data/.spectator.rb DELETED
@@ -1 +0,0 @@
1
- ENV['RSPEC_COMMAND'] = 'rspec'