js-sourcemap 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/js-sourcemap/env.rb +5 -10
- data/lib/js-sourcemap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2440aaabb853b29921ff4ebb385033a8223ccf7b
|
4
|
+
data.tar.gz: 7ad65bbb21bd3696b34b2e29bb3a97bf681ea630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 068c844ef2f7774c3c49434e268d795588f2fa0eebbd36da24998c63d7dc4adf1d438f7fddbe812aa800d437dd3adf7cd8b826a839c18b1cf245b2b0583946b7
|
7
|
+
data.tar.gz: 46fad41135b91fca188d61eddd00aa07001cd7ab8e4114adcf66ac24a23ee7ad56efb7b7678238cd655874f3e53a49369501b527efe230acf0b053fc142a0117
|
data/lib/js-sourcemap/env.rb
CHANGED
@@ -8,11 +8,10 @@ module JsSourcemap
|
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
self.sources_dir = rails_path "public#{Rails.application.config.assets.prefix}"
|
11
|
-
self.mapping_dir = rails_path "private#{Rails.application.config.assets.prefix}"
|
12
|
-
self.original_dir = rails_path "private#{Rails.application.config.assets.prefix}"
|
13
|
-
# keep both dir mapping_dir and original_dir either public or private
|
14
|
-
self.is_build_dir_private = true # false when build_dir is public/assets or app/assets or vendor/assets or lib/assets
|
15
11
|
self.sourcemap_yml = rails_path "config/sourcemap.yml"
|
12
|
+
self.mapping_dir = rails_path "#{sourcemap_config.fetch "mapping_directory"}#{Rails.application.config.assets.prefix}"
|
13
|
+
self.original_dir = rails_path "#{sourcemap_config.fetch "original_directory"}#{Rails.application.config.assets.prefix}"
|
14
|
+
# keep both dir mapping_dir and original_dir either public or private
|
16
15
|
self.domain = sourcemap_config.fetch "domain"
|
17
16
|
self.manifest = get_manifest_file
|
18
17
|
end
|
@@ -58,13 +57,9 @@ module JsSourcemap
|
|
58
57
|
end
|
59
58
|
|
60
59
|
def build_absolute_path(path)
|
61
|
-
|
62
|
-
path =
|
60
|
+
path = path.gsub(/.*(#{self.sources_dir}\/|#{self.mapping_dir}\/|#{self.original_dir}\/)/,'')
|
61
|
+
path = "#{Rails.application.config.assets.prefix}/#{path}"
|
63
62
|
"#{self.domain}#{path}"
|
64
|
-
else
|
65
|
-
path = path.gsub(/.*(#{self.sources_dir}\/|#{Rails.root}\/|#{self.mapping_dir}\/|#{self.original_dir}\/)/,'')
|
66
|
-
"#{self.domain}assets/#{path}"
|
67
|
-
end
|
68
63
|
end
|
69
64
|
|
70
65
|
end
|
data/lib/js-sourcemap/version.rb
CHANGED