hyperloop-config 0.9.8 → 0.9.9
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/hyperloop-config.gemspec +1 -1
- data/lib/hyperloop/imports.rb +12 -12
- data/lib/hyperloop/rail_tie.rb +11 -5
- 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: b0014a648828a48895c2eae79a18e2c36b133f95
|
4
|
+
data.tar.gz: 6b4757bee0bc86d28304a15c57c2e38d89822ba1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c99297495934095a0ab5c57fa71dc8e35da8a1815a5f0689d243257a6c975f1d5239d9e9088b3434517ed279e22818973c494fa04c0e1148767d6f6f48dd2244
|
7
|
+
data.tar.gz: 07c593d231ef22cce66c61b510cb730dd48347fa7df6a01d21f88683ff9e852792692b48ad8f19b8e3b6b00b15f9f73654bbf591e342000e9be84892f9122b2a
|
data/hyperloop-config.gemspec
CHANGED
data/lib/hyperloop/imports.rb
CHANGED
@@ -94,25 +94,25 @@ module Hyperloop
|
|
94
94
|
|
95
95
|
def compile_and_compress(name, never_compress: false)
|
96
96
|
start_time = Time.now
|
97
|
-
|
98
|
-
Rails.logger.info "\n\n##########################################################################\n"
|
99
|
-
Rails.logger.info " HYPERLOOP LIBRARIES PRECOMPILING AND MINIFYING\n"
|
100
|
-
Rails.logger.info " FIRST TIME BOOTING YOUR APP IT CAN TAKE 1 OR 2 MINUTES\n"
|
101
|
-
Rails.logger.info " NB: You can force precompiling again by cleaning cache: rm -rf tmp/cache \n"
|
102
|
-
Rails.logger.info "##########################################################################\n\n"
|
103
97
|
|
104
|
-
|
105
|
-
|
98
|
+
puts "\n\n##########################################################################\n"
|
99
|
+
puts " HYPERLOOP LIBRARIES PRECOMPILING AND MINIFYING\n"
|
100
|
+
puts " FIRST TIME BOOTING YOUR APP IT CAN TAKE 1 OR 2 MINUTES\n"
|
101
|
+
puts " NB: You can force precompiling again by cleaning cache: rm -rf tmp/cache \n"
|
102
|
+
puts "##########################################################################\n\n"
|
103
|
+
|
104
|
+
puts "Compiling the system assets for #{name}"
|
105
|
+
|
106
106
|
compiled_code = Rails.application.assets[name].to_s
|
107
107
|
compilation_time = Time.now
|
108
108
|
compiled_code_length = compiled_code.length
|
109
|
-
|
109
|
+
puts " compiled - length: #{compiled_code_length}"
|
110
110
|
if Hyperloop.compress_system_assets && !never_compress
|
111
111
|
compiled_code = Uglifier.new.compile(compiled_code)
|
112
|
-
|
113
|
-
|
112
|
+
puts " minimized - length: #{compiled_code.length}"
|
113
|
+
puts " minification ratio #{(compiled_code.length*100.0/compiled_code_length).round}%"
|
114
114
|
end
|
115
|
-
|
115
|
+
puts " total time: #{(Time.now-start_time).to_f.round(2)} seconds"
|
116
116
|
compiled_code
|
117
117
|
end
|
118
118
|
|
data/lib/hyperloop/rail_tie.rb
CHANGED
@@ -46,12 +46,18 @@ module Hyperloop
|
|
46
46
|
config.after_initialize do |app|
|
47
47
|
next unless config.hyperloop.auto_config
|
48
48
|
Hyperloop.import_tree('hyperloop')
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
if config.respond_to?(:react)
|
50
|
+
if (opts = config.react.server_renderer_options)
|
51
|
+
opts.merge! FILES
|
52
|
+
else
|
53
|
+
config.react.server_renderer_options = FILES
|
54
|
+
end
|
54
55
|
end
|
56
|
+
dest = "#{Rails.root}/vendor/assets/javascripts/compiled/"
|
57
|
+
js_asset = 'hyperloop-prerender-loader-system'
|
58
|
+
File.write(dest + js_asset + '.js', app.assets.find_asset(js_asset).to_s)
|
59
|
+
js_asset = 'hyperloop-loader-system'
|
60
|
+
File.write(dest + js_asset + '.js', app.assets.find_asset(js_asset).to_s)
|
55
61
|
end
|
56
62
|
end
|
57
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperloop-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- catmando
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|