opal-rails 0.7.0.beta1 → 0.7.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -0
- data/lib/assets/javascripts/opal-rspec-runner.js.rb +1 -3
- data/lib/assets/javascripts/opal_ujs.js +4 -0
- data/lib/opal/rails/version.rb +1 -1
- data/opal-rails.gemspec +1 -1
- metadata +6 -6
- data/lib/assets/javascripts/opal_ujs.js.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ffa8df8c8e6279e1c8ab38f42b909d83d3084b
|
4
|
+
data.tar.gz: 32b329e8f1760c637d630aa3b3d3ebcc180ac053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93b7a25216be977798ecbf2876c3f90ba7bd77dcba872a67dee41f3371b55925149150b3cc8b77aa19995e223a74e58a443e79b5dc6d31c7b40e4592c5f2c3f2
|
7
|
+
data.tar.gz: 510e1be6bef5a70a0f7b9ab4b96a906d8a1740111b31eb90a44e735b1d01f4bb64f511aba388dca84abc3364e757f286ec66fbbe7ed5249ba229cbf0bd7c554d
|
data/README.md
CHANGED
@@ -132,6 +132,7 @@ Of course you need to require `haml-rails` separately since its presence is not
|
|
132
132
|
Element.find('.comments').effect(:fade_in)
|
133
133
|
end
|
134
134
|
end
|
135
|
+
|
135
136
|
```
|
136
137
|
|
137
138
|
|
@@ -156,6 +157,42 @@ Then visit `/opal_spec` from your app and **reload at will** or use the command
|
|
156
157
|
![1 examples, 0 failures](http://f.cl.ly/items/001n0V0g0u0v14160W2G/Schermata%2007-2456110%20alle%201.06.29%20am.png)
|
157
158
|
|
158
159
|
|
160
|
+
### Shared templates
|
161
|
+
|
162
|
+
As long as the templates are inside the sprockets/opal load path, then you should be able to just require them.
|
163
|
+
|
164
|
+
Let's say we have this template `app/views/shared/test.haml`:
|
165
|
+
|
166
|
+
```haml
|
167
|
+
.row
|
168
|
+
.col-sm-12
|
169
|
+
= @bar
|
170
|
+
```
|
171
|
+
|
172
|
+
We need to make sure Opal can see and compile that template. So we need to add the path to sprockets:
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
# config/initializers/opal.rb
|
176
|
+
Rails.application.config.assets.paths << Rails.root.join('app', 'views', 'shared').to_s
|
177
|
+
```
|
178
|
+
|
179
|
+
Now, somewhere in `application.rb` you need to require that template, and you can just run it through `Template`:
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
# app/assets/javascripts/application.rb
|
183
|
+
require 'opal'
|
184
|
+
require 'opal-haml'
|
185
|
+
require 'test'
|
186
|
+
|
187
|
+
@bar = "hello world"
|
188
|
+
|
189
|
+
template = Template['test']
|
190
|
+
template.render(self)
|
191
|
+
# => '<div class="row"><div class="col-sm-12">hello world</div></div>'
|
192
|
+
```
|
193
|
+
|
194
|
+
|
195
|
+
|
159
196
|
## License
|
160
197
|
|
161
198
|
© 2012-2014 Elia Schito
|
data/lib/opal/rails/version.rb
CHANGED
data/opal-rails.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency 'rails', '>= 3.2', '< 5.0'
|
25
25
|
s.add_dependency 'opal', '~> 0.7.0.beta1'
|
26
26
|
s.add_dependency 'opal-jquery', '~> 0.3.0.beta1'
|
27
|
-
s.add_dependency 'opal-rspec', '~> 0.4.0.
|
27
|
+
s.add_dependency 'opal-rspec', '~> 0.4.0.beta4'
|
28
28
|
s.add_dependency 'jquery-rails'
|
29
29
|
s.add_dependency 'opal-activesupport', '>= 0.0.5'
|
30
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.7.0.
|
4
|
+
version: 0.7.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.4.0.
|
67
|
+
version: 0.4.0.beta4
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.4.0.
|
74
|
+
version: 0.4.0.beta4
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: jquery-rails
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,7 +175,7 @@ files:
|
|
175
175
|
- app/views/layouts/opal_spec.html.erb
|
176
176
|
- app/views/opal_spec/run.html.erb
|
177
177
|
- lib/assets/javascripts/opal-rspec-runner.js.rb
|
178
|
-
- lib/assets/javascripts/opal_ujs.js
|
178
|
+
- lib/assets/javascripts/opal_ujs.js
|
179
179
|
- lib/opal-rails.rb
|
180
180
|
- lib/opal/rails.rb
|
181
181
|
- lib/opal/rails/engine.rb
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
252
|
version: 1.3.1
|
253
253
|
requirements: []
|
254
254
|
rubyforge_project: opal-rails
|
255
|
-
rubygems_version: 2.
|
255
|
+
rubygems_version: 2.4.3
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
258
|
summary: Rails bindings for opal JS engine
|