execjs-rails 0.2.2.4 → 0.2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/execjs/rails/engine.rb +12 -1
- data/lib/execjs/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 120bd14e5651e22fc932ad2b1f8398786076e5dc
|
4
|
+
data.tar.gz: ca746742249bb33eb3aa69a824bb3ac46bfb99e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec0fc17857912a94ac386c2618d838f8b05231f892ac8ce4dad07eda872c56d3d001281c73a0eb78130c0ca9a6088c7c2b729786de5e41cbb21c10eb7a5fc5e
|
7
|
+
data.tar.gz: b496dd3abc8a788bd4196959bd15c75ff5e7a342076ec5d0fe1f65271b1d224947321d6ad93c3c3e1adbcda5d7ad6c967e654c98883c6ba975d53e868dc4f191
|
data/lib/execjs/rails/engine.rb
CHANGED
@@ -62,7 +62,18 @@ module ExecJS
|
|
62
62
|
config.after_initialize do |app|
|
63
63
|
app.config.execjs_rails.build_source ||= lambda do
|
64
64
|
app.config.execjs_rails.server_javascripts.map do |filename|
|
65
|
-
|
65
|
+
# TODO: I hope there is a way to write this that depends much less on knowledge of Rails internals.
|
66
|
+
# Surely there is a terser way to tell Rails to us know that there's a precompiled asset or not?
|
67
|
+
precompiled_assets_path = "#{app.root}/public/#{app.config.assets.prefix}"
|
68
|
+
# If there is a precompile manifest, directly read the precompiled asset file.
|
69
|
+
if manifest = Dir["#{precompiled_assets_path}/.sprockets-manifest-*.json"].first
|
70
|
+
filename = ActiveSupport::JSON.decode(File.read(manifest))["assets"][filename]
|
71
|
+
File.read("#{precompiled_assets_path}/#{filename}")
|
72
|
+
# Otherwise let Sprockets build it.
|
73
|
+
else
|
74
|
+
puts "[execjs_rails] Requesting `#{filename}` from the asset cache."
|
75
|
+
app.assets[filename].to_s
|
76
|
+
end
|
66
77
|
end.join(";")
|
67
78
|
end
|
68
79
|
Renderer.setup!(app.config.execjs_rails)
|
data/lib/execjs/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: execjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.2.
|
4
|
+
version: 0.2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Revelry Labs, LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|