react-rails-img 0.1.3 → 0.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cfc9daa9043e48469e66584196e68b449682312
|
4
|
+
data.tar.gz: 64e10726d8f57f259b8962385500a36aa32347b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b40a7c70a2dea25fad4101f6b48ed570e7ae558f045dcc300988d4bbad17b76dade84abb8ab31f6aa16c53f99cd36dfe51a79fd3bf719a4db1afcce0f8d7dadd
|
7
|
+
data.tar.gz: a958089363ffe2400a9f8ae2f45199fdbbacc2eb8fa1e2085edb446059b4f33f093f402ee3254a80dc19a819f67e07c3b3d5f350f476f566bbd9ee0a00e437f2
|
@@ -3,13 +3,14 @@ images = {}
|
|
3
3
|
prefix = Rails.application.config.assets.prefix
|
4
4
|
should_compute_assets_path = Rails.env.production? || Rails.env.staging? # for performance
|
5
5
|
if should_compute_assets_path
|
6
|
-
|
6
|
+
images_path = Rails.root.join('app/assets/images/')
|
7
|
+
images_dir = images_path.to_s
|
7
8
|
images_enumerator = defined?(assets) ? assets.each_file : Dir["#{images_dir}**/*.*"]
|
8
9
|
images_enumerator.each do |file_path|
|
9
10
|
if file_path.to_s.starts_with?(images_dir)
|
10
|
-
|
11
|
-
file_path = asset_path(
|
12
|
-
images[
|
11
|
+
relative_path = file_path.relative_path_from(images_path)
|
12
|
+
file_path = asset_path(relative_path)
|
13
|
+
images[relative_path] = file_path
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|