isomorfeus-asset-manager 0.15.6 → 0.15.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01b9c5c71265d26294e82c117e1b925629205df732b69bc9d71572c914ed9d22
4
- data.tar.gz: 5ffbe43b6bc53503dd4aeebbb9ddf8fcf6752a6c158bad63f1a6062ab71c53d0
3
+ metadata.gz: 5b31900dc226ef52bb361979681a40a62a79d7a382a0f131d8d901bd8a782964
4
+ data.tar.gz: ffa788333e44093f2460c9d6c17d17c9610a013e24c420580f5d215387e0f0cc
5
5
  SHA512:
6
- metadata.gz: 384ba3538963ac1784b8cca5ae4ce0c490e2ae5da20a280f8ed20847bbbd6268bd322c7468aa7ddc22879ef524630d388d5cd9d13262229454752028fd6106e6
7
- data.tar.gz: fbe2c4ed2a4ba5b76ca3b3c4eff0adc8e0e684d05635ccd6890f94f506245b95932378669356d8ae223b2c246cf82e2e27755dd60e76845ec56120adb9e8276f
6
+ metadata.gz: cb80bc0b2b39e93f84f341c412ddb17a2d783d861468e1c75f174679e1cc8cf06b2a5437cac28a7d95f594f2da4d557b1fa78823bb7546b1705c778057a62395
7
+ data.tar.gz: 938436ac1961a2c6e75472f4149e51caf5a3551b855f4b586b0c1d15d4d8a99b532bce3564bf9f8d938e3d8272257791b55e13de86f34fcf8ec314748ed4a58f
@@ -28,7 +28,7 @@ module Isomorfeus
28
28
  if Isomorfeus.production?
29
29
  FileUtils.mkdir_p(asset_dir) unless Dir.exist?(asset_dir)
30
30
  FileUtils.mkdir_p(File.join(*[asset_dir].concat(module_name.split('/')[0...-1]))) if module_name.include?('/')
31
- File.write(out_file, js)
31
+ File.binwrite(out_file, js)
32
32
  else
33
33
  js << "\n//# sourceMappingURL=#{Isomorfeus.assets_path}/#{asset_name}/#{module_name}.rb.js.map\n"
34
34
  @bundle_ruby_modules[module_name] = { js: { raw: js }, map: { raw: Oj.dump(result.source_map.as_json, mode: :strict) }}
@@ -38,29 +38,29 @@ module Isomorfeus
38
38
 
39
39
  def save_entry(asset_key, asset_name, imports_path)
40
40
  entry = File.join(imports_path, asset_key)
41
- File.write(entry, generate_entry(asset_name))
41
+ File.binwrite(entry, generate_entry(asset_name))
42
42
  entry
43
43
  end
44
44
 
45
45
  def bundle_css(asset_name, output_path)
46
46
  filename = File.join(output_path, asset_name + '.css')
47
- @hash[:css][:css] = { raw: File.read(filename) } if File.exist?(filename)
47
+ @hash[:css][:css] = { raw: File.binread(filename) } if File.exist?(filename)
48
48
  end
49
49
 
50
50
  def bundle_css_map(asset_name, output_path)
51
51
  filename = File.join(output_path, asset_name + '.css.map')
52
- @hash[:css][:map] = { raw: File.read(filename) } if File.exist?(filename)
52
+ @hash[:css][:map] = { raw: File.binread(filename) } if File.exist?(filename)
53
53
  end
54
54
 
55
55
  def bundle_js(asset_key, asset_name, imports_path, output_path)
56
- js = File.read(File.join(output_path, asset_key))
56
+ js = File.binread(File.join(output_path, asset_key))
57
57
  js << ruby_imports_to_s(asset_name, imports_path) unless Isomorfeus.production?
58
58
  @hash[:js][:js] = { raw: js }
59
59
  end
60
60
 
61
61
  def bundle_js_map(asset_key, output_path)
62
62
  filename = File.join(output_path, asset_key + '.map')
63
- @hash[:js][:map] = { raw: File.read(filename) } if File.exist?(filename)
63
+ @hash[:js][:map] = { raw: File.binread(filename) } if File.exist?(filename)
64
64
  end
65
65
 
66
66
  def ruby_imports_to_s(asset_name, out_dir)
@@ -30,19 +30,19 @@ module Isomorfeus
30
30
  result = Opal::Builder.build(ruby_import.resolved_path, { esm: true })
31
31
  FileUtils.mkdir_p(asset_dir) unless Dir.exist?(asset_dir)
32
32
  FileUtils.mkdir_p(File.join(*[asset_dir].concat(module_name.split('/')[0...-1]))) if module_name.include?('/')
33
- File.write(out_file, result.to_s)
33
+ File.binwrite(out_file, result.to_s)
34
34
  end
35
35
  nil
36
36
  end
37
37
 
38
38
  def save_entry(asset_key, asset_name, imports_path)
39
39
  entry = File.join(imports_path, asset_key)
40
- File.write(entry, generate_entry(asset_name))
40
+ File.binwrite(entry, generate_entry(asset_name))
41
41
  entry
42
42
  end
43
43
 
44
44
  def bundle_js(asset_key, asset_name, imports_path, output_path)
45
- js = File.read(File.join(output_path, asset_key))
45
+ js = File.binread(File.join(output_path, asset_key))
46
46
  @hash[:js][:js] = { raw: js }
47
47
  end
48
48
 
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.15.6'
3
+ VERSION = '0.15.7'
4
4
  end
5
5
  end
@@ -56,7 +56,7 @@ module Isomorfeus
56
56
  private
57
57
 
58
58
  def compile_ruby(file)
59
- source = File.read(file)
59
+ source = File.binread(file)
60
60
  module_file = file[(Isomorfeus.app_root.size + 1)..-1]
61
61
  compiler = Opal::Compiler.new(source, requirable: true, file: module_file)
62
62
  { javascript: compiler.compile }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.6
4
+ version: 0.15.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-28 00:00:00.000000000 Z
11
+ date: 2022-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli