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: 48b1873a1443e2881d51eb6544a5b68c7c080e50
4
- data.tar.gz: ef8eeccd70627f054bd740d6f07637e217548f86
3
+ metadata.gz: 3cfc9daa9043e48469e66584196e68b449682312
4
+ data.tar.gz: 64e10726d8f57f259b8962385500a36aa32347b1
5
5
  SHA512:
6
- metadata.gz: 87b089e894a40c8fc3811c12c938f6ffe292c6086cf393056eeba18b6e8408bccf0c6da308b93876cb5e59b8b0c815d1e7f70919e1bc6b1fda152204a5141bb3
7
- data.tar.gz: d03cba85bf622ded2177dc3a5fc84624f89487672d8e73f9fd42dd9876ad1d7a6e84d9aaf5a591546ca3a0d4434c3571ad58da09c88b5fc61c4e54fcb7c93eb7
6
+ metadata.gz: b40a7c70a2dea25fad4101f6b48ed570e7ae558f045dcc300988d4bbad17b76dade84abb8ab31f6aa16c53f99cd36dfe51a79fd3bf719a4db1afcce0f8d7dadd
7
+ data.tar.gz: a958089363ffe2400a9f8ae2f45199fdbbacc2eb8fa1e2085edb446059b4f33f093f402ee3254a80dc19a819f67e07c3b3d5f350f476f566bbd9ee0a00e437f2
@@ -1,7 +1,7 @@
1
1
  module React
2
2
  module Rails
3
3
  module Img
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
@@ -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
- images_dir = Rails.root.join('app/assets/images/').to_s
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
- file_name = File.basename file_path
11
- file_path = asset_path(file_name)
12
- images[file_name] = file_path
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-rails-img
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - RainChen