opal-rails 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/opal-rails.rb CHANGED
@@ -3,3 +3,4 @@ require 'opal/rails/engine'
3
3
  require 'opal/rails/template_handler'
4
4
  require 'opal/rails/processor'
5
5
  require 'opal/rails/version'
6
+ require 'opal/rails/haml_filter' if defined?(Haml)
@@ -0,0 +1,24 @@
1
+ module Haml::Filters::Opal
2
+ include Haml::Filters::Base
3
+
4
+ def render_with_options ruby, options
5
+ text = ::Opal.parse(ruby)
6
+
7
+ if options[:format] == :html5
8
+ type = ''
9
+ else
10
+ type = " type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}"
11
+ end
12
+
13
+ text.rstrip!
14
+ text.gsub!("\n", "\n ")
15
+
16
+ <<HTML
17
+ <script#{type}>
18
+ //<![CDATA[
19
+ #{text}
20
+ //]]>
21
+ </script>
22
+ HTML
23
+ end
24
+ end
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Rails
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-29 00:00:00.000000000 Z
12
+ date: 2012-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: opal
16
- requirement: &70300436008300 !ruby/object:Gem::Requirement
16
+ requirement: &70237919656720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.3.18
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70300436008300
24
+ version_requirements: *70237919656720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: railties
27
- requirement: &70300436022500 !ruby/object:Gem::Requirement
27
+ requirement: &70237919655500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.2.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70300436022500
35
+ version_requirements: *70237919655500
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sprockets
38
- requirement: &70300436021280 !ruby/object:Gem::Requirement
38
+ requirement: &70237919654160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.1'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70300436021280
46
+ version_requirements: *70237919654160
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &70300436019840 !ruby/object:Gem::Requirement
49
+ requirement: &70237919652580 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '2.4'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70300436019840
57
+ version_requirements: *70237919652580
58
58
  description: Rails bindings for opal JS engine
59
59
  email:
60
60
  - elia@schito.me
@@ -68,8 +68,13 @@ files:
68
68
  - README.md
69
69
  - Rakefile
70
70
  - lib/assets/javascripts/opal.js
71
+ - lib/assets/javascripts/rquery.js
72
+ - lib/assets/javascripts/rquery/document.js.opal
73
+ - lib/assets/javascripts/rquery/element.js.opal
74
+ - lib/assets/javascripts/rquery/sizzle.js
71
75
  - lib/opal-rails.rb
72
76
  - lib/opal/rails/engine.rb
77
+ - lib/opal/rails/haml_filter.rb
73
78
  - lib/opal/rails/processor.rb
74
79
  - lib/opal/rails/template_handler.rb
75
80
  - lib/opal/rails/version.rb