hyperloop-config 0.9.8 → 0.9.9

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: 2872a3f9d6a90ec66a9369ce75e5360b96395caf
4
- data.tar.gz: 1b383039726c4f07ffcad90fcb5675af5b4cfa34
3
+ metadata.gz: b0014a648828a48895c2eae79a18e2c36b133f95
4
+ data.tar.gz: 6b4757bee0bc86d28304a15c57c2e38d89822ba1
5
5
  SHA512:
6
- metadata.gz: 769dc1d55d1713c217d7b23d52bcfe195914594af58364fdf4bded13ff8a6fc1883c6e0f864266cd799c6a11335a126afd045e663c84279bbeae0a2e65bce2dd
7
- data.tar.gz: 905757403f027995677d6d42f3deb1f741fd672ca4ef61d3037999974ab2ffa6dd19e44dd1178af1add9dd64164e220ed835b43bf2831cd0e3d791b4e571b725
6
+ metadata.gz: c99297495934095a0ab5c57fa71dc8e35da8a1815a5f0689d243257a6c975f1d5239d9e9088b3434517ed279e22818973c494fa04c0e1148767d6f6f48dd2244
7
+ data.tar.gz: 07c593d231ef22cce66c61b510cb730dd48347fa7df6a01d21f88683ff9e852792692b48ad8f19b8e3b6b00b15f9f73654bbf591e342000e9be84892f9122b2a
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "hyperloop-config"
7
- spec.version = "0.9.8"
7
+ spec.version = "0.9.9"
8
8
  spec.authors = ["catmando"]
9
9
  spec.email = ["mitch@catprint.com"]
10
10
 
@@ -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
- Rails.logger.info "Compiling the system assets for #{name}"
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
- Rails.logger.info " compiled - length: #{compiled_code_length}"
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
- Rails.logger.info " minimized - length: #{compiled_code.length}"
113
- Rails.logger.info " minification ratio #{(compiled_code.length*100.0/compiled_code_length).round}%"
112
+ puts " minimized - length: #{compiled_code.length}"
113
+ puts " minification ratio #{(compiled_code.length*100.0/compiled_code_length).round}%"
114
114
  end
115
- Rails.logger.info " total time: #{(Time.now-start_time).to_f.round(2)} seconds"
115
+ puts " total time: #{(Time.now-start_time).to_f.round(2)} seconds"
116
116
  compiled_code
117
117
  end
118
118
 
@@ -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
- next unless 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
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.8
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-04-16 00:00:00.000000000 Z
11
+ date: 2017-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal