okuribito_rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/okuribito_rails/application_controller.rb +1 -8
  3. data/app/controllers/okuribito_rails/method_call_logs_controller.rb +1 -1
  4. data/app/controllers/okuribito_rails/method_call_situations_controller.rb +1 -1
  5. data/lib/generators/okuribito_rails/templates/initializer.erb +4 -0
  6. data/lib/okuribito_rails/config.rb +4 -0
  7. data/lib/okuribito_rails/engine.rb +9 -0
  8. data/lib/okuribito_rails/start_observer.rb +6 -0
  9. data/lib/okuribito_rails/version.rb +1 -1
  10. data/spec/dummy/db/test.sqlite3 +0 -0
  11. data/spec/dummy/log/test.log +10605 -0
  12. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-B/-BDwN_OWEjRIIH-hXrdKAsIEHMk8JIowWZjTiDmbEPc.cache +1 -0
  13. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-y/-y7CuypkYp7fBlDQBH42JOLSFFlmSat_r6LzhW0QhqE.cache +0 -0
  14. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0b/0bIBnFDpz8hfXFuzuQBL7quJGw_aSX7J_5o9Hr95DYM.cache +1 -0
  15. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/14/14AP1ZRMAYQQ4qFIZ1oeHM2XCfdGgbKnrjTFwWlaLZs.cache +0 -0
  16. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2X/2XitnhmoNerl6IExWiDm6fg41RKwG2JOXYJB_op2Ufg.cache +0 -0
  17. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2_/2_0fPm6UPqAcx4DnsHf6aQdixOhXw5H-5Y7sv68UiWQ.cache +1 -0
  18. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4F/4Fn-Vs3_ipcAuYOq-eozysX1gQbFs6GK0Oi3mly6vQg.cache +1 -0
  19. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4_/4_Uo_ZQWirPgPVik_NGC0q_smxSAtEnVbFTxbrF2zhk.cache +0 -0
  20. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7v/7vQM37x2uiIow-Nw2Yxw5OpAn-fvmfppT5PubB1ldDE.cache +1 -0
  21. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8q/8q3Eo21qKNCNbd1Ualp5KDnEDuZFHQcgtp36RSsLzcg.cache +2 -0
  22. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8t/8t6HYhVnh8OVg-ZnR2c36oXgYN-MArsi6LlNaYsFNFs.cache +0 -0
  23. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BZ/BZHSbvPpFE-Rl4PSNmh2QRMIiSinM6tga63qXnt1BSQ.cache +3 -0
  24. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/C_/C_VR9NrXARoZJsuMRKJw69IAUbv6m--HXIqLoD9fF4w.cache +0 -0
  25. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cr/Cry0qHdY4lMVOKzF5Zf6zN3ZCB7W0FjZZdxZTP6-yZU.cache +1 -0
  26. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DN/DNdppexD6HywJz_YgqmDgtrrrz39Ix_a3d9FoDSiMCc.cache +0 -0
  27. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F8/F87e7XMJaSt5zEett484f03I8u9Hdb4LA3MXL21IU5M.cache +0 -0
  28. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FM/FMS6vBlMwdD11bp0-VgOGjpNYRwMtVX4-MpmJAOZnX0.cache +0 -0
  29. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Hi/HiNrLOsYTRLZql_E6xBcPlbWMXCanjsb64ZvvNDqc20.cache +3 -0
  30. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Hl/HlgFFgZwgYYr_HKbn23eOtZeE7UBsi6RpVPDUhOKOvU.cache +1 -0
  31. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/I0/I0MWLTF-zC2N5NTOO5_J5v9YrK93p7i-bda_9VkKdlA.cache +1 -0
  32. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ii/IiVveumYzLJ19J3dswPG2OfhSRmg9NiBXeAWE56g3QY.cache +1 -0
  33. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Kx/Kx13hlwMWbemPHw6zGIZfcMIMXaDv9vS7lRzTA83G58.cache +0 -0
  34. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LO/LOMCiGM1vocSFFW4RFgyNFiX6WK3B8mvFGZuuisYoBY.cache +0 -0
  35. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lc/LcyNhnqqOtUuq06BUwiMQuTY-MNFJT0tSjXh-by5q80.cache +1 -0
  36. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OG/OGF7sb7C7lrUqW0pYMuUvBpYQDMNCtsV3Z6YwFPJFIQ.cache +2 -0
  37. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q4/Q4mw4AtNT7BwARDhfEgCOZMkbOAEo1_4O7ZgTDQoONY.cache +1 -0
  38. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T0/T0-eZ6AdCBuT680nfMWxHI2EiT1jRVQqBPjR6HxcNEA.cache +1 -0
  39. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T3/T3lXZuk6Zb4raubZuI30uxqVe-7iYoST1Y6OGS8bEOI.cache +0 -0
  40. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T3/t3-qDbPD0FEwc8Yc6npKzABtlX6JgEcc4rmQUoHAY7o.cache +2 -0
  41. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tu/Tu-IyoztbfwvaZFU1gMdSx2W-68q-Dx2EBIXnAiBa8w.cache +0 -0
  42. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VE/VEGFope5Nt5PaIsptr0zQjHnyoAhncJpVT4P4UTBvzU.cache +1 -0
  43. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vg/VgxK6l09m4bUK9r-BoZkYH0vd_6DpPharoyRDpFzND0.cache +4 -0
  44. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WL/WLnKRpxE8AnmFBN3B5cS-BX-hFCtWZZXR25DOYMkyK0.cache +1 -0
  45. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Yd/Ydp4b-OmTu39oBRL88G0Pj-q_Z9n8TEeJGu8jD8fKP4.cache +1 -0
  46. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_3/_37tcxgVFXGCtCy69boPkLe_g94Ja7CZXQpZtUMnubE.cache +1 -0
  47. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_h/_hXkdmRBJaGnn10JC8YgeNJ7riGxN8aIHX3-wNdzMwA.cache +3 -0
  48. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b-/b-CRB18zEJ0W8FwGiKXrS4-d652qKHYb-IWnFGfNwKE.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b_/b_Itlk9QZZd7Rvf8kcA4yLP1R5Acu7jB-m1xQiSU0qE.cache +2 -0
  50. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/br/brab5gafSQ9hLY7MFUiQo-7PgjQa61zLXKIAUD-46Vs.cache +0 -0
  51. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cY/cYDoBAQFTD5xOCTGdrBydEo2JqEawiwX6fWa3IrUm5Y.cache +0 -0
  52. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/d0/d0uefzjacFcMOQg9VX46kiwllKocVzsVozWt0hRkBrM.cache +0 -0
  53. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dk/Dk9SfX198poaZPH6xB5UDvL3BIurIHdhpEQIOA6_NrY.cache +1 -0
  54. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dk/dkriEZb9VWN_rkL7ghDD4IcDFYPOc099aP9d-TqjWgs.cache +1 -0
  55. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dq/dqRsht-pLWtsrvCJd6gAvYzMd_bwjGsvhzKFJ4lJKMQ.cache +2 -0
  56. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eQ/eQOTPX0H3QvbPJvwc7vXsTV4yp0tavCkkdx_ZMpV_xY.cache +2 -0
  57. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ej/ejie8YLhXJlxOQcsZwZqhSmZccYE-t2NW6rQ8-pUvX8.cache +1 -0
  58. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gh/gh0m9ohu3CIzUFUvKbWJQL38MsShVWywwcqtDypwpG4.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h0/h0A9M_KdAd8osQJeKHNFVXQPlvboa-3PVhGBNsTEaLo.cache +2 -0
  60. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h7/h7IpOHt4eNmpIWAmXJ_phaRYAT3TrFHChvlPe9eDRWg.cache +0 -0
  61. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iP/iPAgBmrq7WERmrolpV9HwXbBKZEt3J5xTsPgzEYlAo4.cache +2 -0
  62. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/js/jsi0BYCHcicTcCdhA7SibHQIgDHEDNgKQTZehDtwMVc.cache +1 -0
  63. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kO/kO0R8Wk-ok-Mk5RCPLgF3B69Tke-qajPdIcz1dctwzw.cache +1 -0
  64. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mX/mX1nlsL_SWOB4y22W5FheRX0YEONKyOY7xUeIvRiHco.cache +2 -0
  65. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +2 -0
  66. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +2 -0
  67. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ps/psdbPwxTr09SmYyT6Sg4t09okLmqsaXqZ8cDWB2_20w.cache +1 -0
  68. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/q0/q0qu7zCx6lgm2SwlK21QC3pXV1W_el5vZ6scY1dGUDU.cache +1 -0
  69. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sM/sMd9eUxa5puStD62GGA-ruYEThLZ4M9irw8n1sGyhjk.cache +1 -0
  70. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/un/unYhQ5ddiaSGsSPjeeeEttmaIEgnFSEIYwgoJJ0Koy8.cache +1 -0
  71. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/us/usXHehPLU8kxfXFGjkICXXm0yqVwEd_tWr3PDXhFJTo.cache +1 -0
  72. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uy/uy1EA1Oy79kH6kB58GTNUJRZi1BmmRzrPIJDi8gF9nE.cache +1 -0
  73. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v7/v7PGHFSI0GrVv7QZTEQMw9ogpizJTzbOzEs66Kq7BQs.cache +2 -0
  74. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/we/wesb6dLgRIOD8BYJoo_HmOFmXoMUSV6jVSza4SQPOt4.cache +3 -0
  75. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x7/x7PYh8DJvPykcEqpVab2vcY9-GFz-3cqtoMlRAu94Uc.cache +2 -0
  76. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zU/zUARB-S48gcDUi5p9yOdhew1I-uauMw41jcPawlWD4k.cache +1 -0
  77. data/spec/factories.rb +22 -0
  78. data/spec/features/method_call_logs_page_spec.rb +60 -0
  79. data/spec/features/method_call_situations_page_spec.rb +64 -0
  80. data/spec/lib/okuribito_rails/observe_method_spec.rb +0 -1
  81. data/spec/spec_helper.rb +5 -1
  82. metadata +150 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7825489f5e2366a0fdf1918b46770cb8a047c9a
4
- data.tar.gz: d98f49a089c1e85232623935d6b1021b9cdbb228
3
+ metadata.gz: 968342a0bfd5e8d3cb43dfcfc4ff411b19030c53
4
+ data.tar.gz: 386b480e26de49caaa8559e573a2f6962082315a
5
5
  SHA512:
6
- metadata.gz: edc7b69416eba00eab1b4915f930e30ab379a3cad34a6eb61a73544537f20c564c5971847f6ecc59950cf48fc97e3651b89c4b7cbf559257d33c7979fee2211b
7
- data.tar.gz: 51905f4a0e7874af2c33a14c0abce51bfc1a3c8da6bdd32015a2fd04a54cf85aa87c86bd54d8448d60d0f606e168f23a210fca58fdd69d1d913ffa4c19253e77
6
+ metadata.gz: 6d8d4382cc781cddd0603df0a5228925ca91c35eb418d7ee2c41988d6d72681f05814792b0fc9bed066cf2955c8a05f90fceb4535199942767ffdc2711ea6678
7
+ data.tar.gz: 63e3e0236f549db1eb60299f9178ed632bf97c68294f417d2d6ffcac39cbcc645b7b9512d697b7b35589f15e2069ff515d0dd4d89c5b57071a898287386325ea
@@ -2,14 +2,7 @@ module OkuribitoRails
2
2
  class ApplicationController < ActionController::Base
3
3
  protect_from_forgery
4
4
 
5
- before_action :available_action!
6
-
7
- def available_action!
8
- if prohibited_env?
9
- render nothing: true, status: 403
10
- return
11
- end
12
- end
5
+ before_action -> { head :forbidden }, if: -> { prohibited_env? }
13
6
 
14
7
  private
15
8
 
@@ -4,7 +4,7 @@ module OkuribitoRails
4
4
  class MethodCallLogsController < ApplicationController
5
5
  def index
6
6
  @method_call_logs = MethodCallLog
7
- .search(params.presence || {})
7
+ .search(method_call_log_params.presence || {})
8
8
  .page(params[Kaminari.config.param_name])
9
9
  end
10
10
 
@@ -4,7 +4,7 @@ module OkuribitoRails
4
4
  class MethodCallSituationsController < ApplicationController
5
5
  def index
6
6
  @method_call_situations = MethodCallSituation
7
- .search(params.presence || {})
7
+ .search(method_call_situation_params.presence || {})
8
8
  .page(params[Kaminari.config.param_name])
9
9
  .order(class_name: :asc, method_symbol: :asc, method_name: :asc)
10
10
  end
@@ -10,4 +10,8 @@ OkuribitoRails.configure do |config|
10
10
 
11
11
  # It will not monitor method calls in the specified environment.
12
12
  config.prohibit_observe = ["test"]
13
+
14
+ # OkuribitoRails run `Rails.application.eager_load!` in the specified environment.
15
+ config.force_eager_load = ["test"]
16
+
13
17
  end
@@ -17,5 +17,9 @@ module OkuribitoRails
17
17
  config_accessor :prohibit_observe do
18
18
  ["test"]
19
19
  end
20
+
21
+ config_accessor :force_eager_load do
22
+ ["test"]
23
+ end
20
24
  end
21
25
  end
@@ -1,6 +1,15 @@
1
1
  module OkuribitoRails
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace OkuribitoRails
4
+
5
+ initializer "okuribito_rails.assets.precompile", group: :all do |app|
6
+ app.config.assets.precompile += %w(
7
+ okuribito_rails/logo.png
8
+ okuribito_rails/application.css
9
+ okuribito_rails/header.css
10
+ okuribito_rails/method_call_info.css
11
+ )
12
+ end
4
13
  end
5
14
 
6
15
  class << self
@@ -7,6 +7,8 @@ module OkuribitoRails
7
7
  return if prohibit_env? || before_migrate?
8
8
  return unless File.exist?(yaml_path = setting_path)
9
9
 
10
+ Rails.application.eager_load! if force_eager_load?
11
+
10
12
  regist_method(yaml_path)
11
13
  start_observer(yaml_path)
12
14
  end
@@ -17,6 +19,10 @@ module OkuribitoRails
17
19
  OkuribitoRails.config.prohibit_observe.include?(ENV["RAILS_ENV"])
18
20
  end
19
21
 
22
+ def force_eager_load?
23
+ OkuribitoRails.config.force_eager_load.include?(ENV["RAILS_ENV"])
24
+ end
25
+
20
26
  def before_migrate?
21
27
  !ActiveRecord::Base.connection.table_exists? "okuribito_rails_method_call_situations"
22
28
  end
@@ -1,3 +1,3 @@
1
1
  module OkuribitoRails
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
Binary file