sprockets-dotjs 3.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzdjYzJjMWNmNjFmNzNlMGIxMjQ5NDA0ZTlkZDgzNTFhMmViNzRkMw==
5
+ data.tar.gz: !binary |-
6
+ YWI2MjQ2MDZlODMzODUyMjA5ODQ5NzNmN2ZlN2MxMGJhMjFlZjNhNw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ODFiNzQ2YjBlNzEyNWU0MDU0OTNjYjc0N2ZmZGRlZmZmOTczMTk5NDI3MjRl
10
+ MTBmZTJhNzNiNTBiNmViOGM2NjEyYWVkMTQ0YWEyNGI0MDZkMjM5ZmJkN2Vm
11
+ ZDQxOTBhZmYwNTA4YmM1Yzc2NzdiZjAzODdlZTc1ZDBkZGExZmY=
12
+ data.tar.gz: !binary |-
13
+ Y2FmYTc0MDVmNGJmNTBkNjRjY2E1OTE2YTNkYTk2NTkzY2M0ZmU4Y2Y3NzIw
14
+ MjNiOThiMjJkYjFlODZlNGI3NDNhYmFmYzk5ZDZmODUxNGQzMGRhNDkzNDc1
15
+ ZjllZGVkMTZmM2I1OTBmZjNmY2FlMGM4ZDEzZWI1ZWYxMDdkMDk=
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Dotjs
3
- VERSION = "3.0.2"
3
+ VERSION = "3.1.0"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  require 'sprockets'
2
2
  require 'tilt/template'
3
- require 'v8'
4
3
  require 'digest/md5'
4
+ require 'execjs'
5
5
 
6
6
  module Sprockets
7
7
  module DotJS
@@ -16,8 +16,7 @@ module Sprockets
16
16
 
17
17
  def initialize_engine
18
18
  dotjs_lib = open(::File.join(::File.dirname(__FILE__), '..', '..', 'support', 'doT.js')).read
19
- @@context = ::V8::Context.new
20
- @@context.eval(dotjs_lib)
19
+ @@context = ExecJS.compile(dotjs_lib)
21
20
  end
22
21
 
23
22
  def build_dependencies(set = [],environment,path)
@@ -32,7 +31,7 @@ module Sprockets
32
31
  end
33
32
 
34
33
  def render(scope=Object.new, locals={}, &block)
35
- @@context['def'] = {}
34
+ @@context.exec("def = {}")
36
35
  dep = []
37
36
  scope._dependency_assets.each {|pathname|
38
37
  if scope.pathname.to_s != pathname
@@ -41,9 +40,9 @@ module Sprockets
41
40
  end
42
41
  }
43
42
  dep.reverse_each do |pathname|
44
- @@context['doT']['compile'].call(open(pathname).read,@@context['def'])
43
+ @@context.exec("doT.compile(#{MultiJson.encode(open(pathname).read)},def).toString()")
45
44
  end
46
- @@context['doT']['compile'].call(data,@@context['def']).to_s
45
+ @@context.exec("return doT.compile(#{MultiJson.encode(data)},def).toString()")
47
46
  end
48
47
  end
49
48
  end
@@ -18,9 +18,8 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency "sprockets"
21
- gem.add_dependency "libv8"
22
21
  gem.add_dependency "rake"
23
- gem.add_dependency "therubyracer"
22
+ gem.add_dependency "execjs"
24
23
  gem.add_dependency "railties"
25
24
 
26
25
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-dotjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
5
- prerelease:
4
+ version: 3.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Le Duc Duy
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
11
+ date: 2013-08-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sprockets
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,23 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: libv8
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
23
  requirements:
43
24
  - - ! '>='
44
25
  - !ruby/object:Gem::Version
@@ -46,7 +27,6 @@ dependencies:
46
27
  - !ruby/object:Gem::Dependency
47
28
  name: rake
48
29
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
30
  requirements:
51
31
  - - ! '>='
52
32
  - !ruby/object:Gem::Version
@@ -54,15 +34,13 @@ dependencies:
54
34
  type: :runtime
55
35
  prerelease: false
56
36
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
37
  requirements:
59
38
  - - ! '>='
60
39
  - !ruby/object:Gem::Version
61
40
  version: '0'
62
41
  - !ruby/object:Gem::Dependency
63
- name: therubyracer
42
+ name: execjs
64
43
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
44
  requirements:
67
45
  - - ! '>='
68
46
  - !ruby/object:Gem::Version
@@ -70,7 +48,6 @@ dependencies:
70
48
  type: :runtime
71
49
  prerelease: false
72
50
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
51
  requirements:
75
52
  - - ! '>='
76
53
  - !ruby/object:Gem::Version
@@ -78,7 +55,6 @@ dependencies:
78
55
  - !ruby/object:Gem::Dependency
79
56
  name: railties
80
57
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
58
  requirements:
83
59
  - - ! '>='
84
60
  - !ruby/object:Gem::Version
@@ -86,7 +62,6 @@ dependencies:
86
62
  type: :runtime
87
63
  prerelease: false
88
64
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
65
  requirements:
91
66
  - - ! '>='
92
67
  - !ruby/object:Gem::Version
@@ -148,27 +123,26 @@ files:
148
123
  - test/test_helper.rb
149
124
  homepage: https://github.com/duyleekun/sprockets-dotjs
150
125
  licenses: []
126
+ metadata: {}
151
127
  post_install_message:
152
128
  rdoc_options: []
153
129
  require_paths:
154
130
  - lib
155
131
  required_ruby_version: !ruby/object:Gem::Requirement
156
- none: false
157
132
  requirements:
158
133
  - - ! '>='
159
134
  - !ruby/object:Gem::Version
160
135
  version: '0'
161
136
  required_rubygems_version: !ruby/object:Gem::Requirement
162
- none: false
163
137
  requirements:
164
138
  - - ! '>='
165
139
  - !ruby/object:Gem::Version
166
140
  version: '0'
167
141
  requirements: []
168
142
  rubyforge_project:
169
- rubygems_version: 1.8.25
143
+ rubygems_version: 2.0.5
170
144
  signing_key:
171
- specification_version: 3
145
+ specification_version: 4
172
146
  summary: Compile dot.js template into javascript
173
147
  test_files:
174
148
  - test/dummy/README.rdoc