cookpad-performance 0.3.2 → 0.3.3

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
  SHA256:
3
- metadata.gz: 8b97d8b51a198e5add75ab5630f44ae7390f5d62c9755bb122c036cbf3b95038
4
- data.tar.gz: 42626001db703524d4b670de264f116c5074b6a30760714bf943775f95491574
3
+ metadata.gz: 2a404a545801a9cd8708cf2e6cea28697d886b4102fa99fbd59d6a3e0f3f0498
4
+ data.tar.gz: 5b67a526c158ec16eace9a14f646e78bc0155d6a016b7d86f7f0dce5f9b11f83
5
5
  SHA512:
6
- metadata.gz: 38f3c931186e7046ece11c6abe8d82cccaa9174b6623cffe60b4e0a47541c154b4f964ec6eb247928b4b52f1c7472cd963581eff3fbffabbf31e61b897e4e342
7
- data.tar.gz: 3ac2eac28f69e017e2907c709ad660cbd55889d2268432e11508edab76141ce6183af1105546aa9d3649758b378d82f15e76c2b392a365d74aed354f0abc74a8
6
+ metadata.gz: 5e638ac0ed6546d07b77c7655a6ce81756597cef53e93766f217893b847c918e8605b883cbb96b7bc24bf180584d058273ea5f1a57a59911fde6749f9e53e1dd
7
+ data.tar.gz: baef32dafa0628231d0842f6f8173db4b9808d16e5d6cc585efff3fc914f8335c5f76ef6f4b1f09e05a95fc647ac4829cab4e056b0e6dfcc4a329ea372ba8c90
@@ -1,5 +1,5 @@
1
1
  if (ENV["LOG_N_PLUS_ONE_QUERIES"] == "true" || ENV["RAISE_N_PLUS_ONE_QUERIES"] == "true") &&
2
- (Rails.env.development? || Rails.env.test?)
2
+ (Rails.env.development? || Rails.env.test?)
3
3
  require "prosopite"
4
4
  Prosopite.rails_logger = ENV["LOG_N_PLUS_ONE_QUERIES"] == "true"
5
5
  Prosopite.prosopite_logger = true
@@ -0,0 +1,16 @@
1
+ module Cookpad
2
+ module Performance
3
+ class Railtie < ::Rails::Railtie
4
+ DEFAULTS_IVAR_NAME = "@defaults".freeze
5
+ private_constant :DEFAULTS_IVAR_NAME
6
+
7
+ config.after_initialize do
8
+ if ENV["PROFILE"] && Rails.env.development? && defined?(Webpacker)
9
+ default_config = Webpacker.config.instance_variable_get(DEFAULTS_IVAR_NAME)
10
+ default_config["compile"] = false
11
+ Webpacker.config.instance_variable_set(DEFAULTS_IVAR_NAME, default_config)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module Cookpad
2
2
  module Performance
3
- VERSION = "0.3.2".freeze
3
+ VERSION = "0.3.3".freeze
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require "rails"
2
2
  require "cookpad/performance/version"
3
3
  require "cookpad/performance/engine"
4
+ require "cookpad/performance/railtie" if defined?(Rails::Railtie)
4
5
 
5
6
  module Cookpad
6
7
  module Performance
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookpad-performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cookpad Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-11 00:00:00.000000000 Z
11
+ date: 2022-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prosopite
@@ -226,6 +226,7 @@ files:
226
226
  - lib/cookpad/performance/disable_cached_query_logging.rb
227
227
  - lib/cookpad/performance/engine.rb
228
228
  - lib/cookpad/performance/n_plus_one_detection.rb
229
+ - lib/cookpad/performance/railtie.rb
229
230
  - lib/cookpad/performance/version.rb
230
231
  homepage: https://github.com/cookpad/cookpad-performance
231
232
  licenses:
@@ -235,7 +236,7 @@ metadata:
235
236
  source_code_uri: https://github.com/cookpad/cookpad-performance
236
237
  changelog_uri: https://github.com/cookpad/cookpad-performance/blob/main/CHANGELOG
237
238
  rubygems_mfa_required: 'true'
238
- post_install_message:
239
+ post_install_message:
239
240
  rdoc_options: []
240
241
  require_paths:
241
242
  - lib
@@ -250,8 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
251
  - !ruby/object:Gem::Version
251
252
  version: '0'
252
253
  requirements: []
253
- rubygems_version: 3.3.8
254
- signing_key:
254
+ rubygems_version: 3.3.7
255
+ signing_key:
255
256
  specification_version: 4
256
257
  summary: Rails app performance tools
257
258
  test_files: []