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.
- checksums.yaml +4 -4
- data/app/controllers/okuribito_rails/application_controller.rb +1 -8
- data/app/controllers/okuribito_rails/method_call_logs_controller.rb +1 -1
- data/app/controllers/okuribito_rails/method_call_situations_controller.rb +1 -1
- data/lib/generators/okuribito_rails/templates/initializer.erb +4 -0
- data/lib/okuribito_rails/config.rb +4 -0
- data/lib/okuribito_rails/engine.rb +9 -0
- data/lib/okuribito_rails/start_observer.rb +6 -0
- data/lib/okuribito_rails/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +10605 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-B/-BDwN_OWEjRIIH-hXrdKAsIEHMk8JIowWZjTiDmbEPc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-y/-y7CuypkYp7fBlDQBH42JOLSFFlmSat_r6LzhW0QhqE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0b/0bIBnFDpz8hfXFuzuQBL7quJGw_aSX7J_5o9Hr95DYM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/14/14AP1ZRMAYQQ4qFIZ1oeHM2XCfdGgbKnrjTFwWlaLZs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2X/2XitnhmoNerl6IExWiDm6fg41RKwG2JOXYJB_op2Ufg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2_/2_0fPm6UPqAcx4DnsHf6aQdixOhXw5H-5Y7sv68UiWQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4F/4Fn-Vs3_ipcAuYOq-eozysX1gQbFs6GK0Oi3mly6vQg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4_/4_Uo_ZQWirPgPVik_NGC0q_smxSAtEnVbFTxbrF2zhk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7v/7vQM37x2uiIow-Nw2Yxw5OpAn-fvmfppT5PubB1ldDE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8q/8q3Eo21qKNCNbd1Ualp5KDnEDuZFHQcgtp36RSsLzcg.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8t/8t6HYhVnh8OVg-ZnR2c36oXgYN-MArsi6LlNaYsFNFs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BZ/BZHSbvPpFE-Rl4PSNmh2QRMIiSinM6tga63qXnt1BSQ.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/C_/C_VR9NrXARoZJsuMRKJw69IAUbv6m--HXIqLoD9fF4w.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cr/Cry0qHdY4lMVOKzF5Zf6zN3ZCB7W0FjZZdxZTP6-yZU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DN/DNdppexD6HywJz_YgqmDgtrrrz39Ix_a3d9FoDSiMCc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F8/F87e7XMJaSt5zEett484f03I8u9Hdb4LA3MXL21IU5M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FM/FMS6vBlMwdD11bp0-VgOGjpNYRwMtVX4-MpmJAOZnX0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Hi/HiNrLOsYTRLZql_E6xBcPlbWMXCanjsb64ZvvNDqc20.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Hl/HlgFFgZwgYYr_HKbn23eOtZeE7UBsi6RpVPDUhOKOvU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/I0/I0MWLTF-zC2N5NTOO5_J5v9YrK93p7i-bda_9VkKdlA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ii/IiVveumYzLJ19J3dswPG2OfhSRmg9NiBXeAWE56g3QY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Kx/Kx13hlwMWbemPHw6zGIZfcMIMXaDv9vS7lRzTA83G58.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LO/LOMCiGM1vocSFFW4RFgyNFiX6WK3B8mvFGZuuisYoBY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lc/LcyNhnqqOtUuq06BUwiMQuTY-MNFJT0tSjXh-by5q80.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OG/OGF7sb7C7lrUqW0pYMuUvBpYQDMNCtsV3Z6YwFPJFIQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q4/Q4mw4AtNT7BwARDhfEgCOZMkbOAEo1_4O7ZgTDQoONY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T0/T0-eZ6AdCBuT680nfMWxHI2EiT1jRVQqBPjR6HxcNEA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T3/T3lXZuk6Zb4raubZuI30uxqVe-7iYoST1Y6OGS8bEOI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T3/t3-qDbPD0FEwc8Yc6npKzABtlX6JgEcc4rmQUoHAY7o.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tu/Tu-IyoztbfwvaZFU1gMdSx2W-68q-Dx2EBIXnAiBa8w.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VE/VEGFope5Nt5PaIsptr0zQjHnyoAhncJpVT4P4UTBvzU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vg/VgxK6l09m4bUK9r-BoZkYH0vd_6DpPharoyRDpFzND0.cache +4 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WL/WLnKRpxE8AnmFBN3B5cS-BX-hFCtWZZXR25DOYMkyK0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Yd/Ydp4b-OmTu39oBRL88G0Pj-q_Z9n8TEeJGu8jD8fKP4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_3/_37tcxgVFXGCtCy69boPkLe_g94Ja7CZXQpZtUMnubE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_h/_hXkdmRBJaGnn10JC8YgeNJ7riGxN8aIHX3-wNdzMwA.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b-/b-CRB18zEJ0W8FwGiKXrS4-d652qKHYb-IWnFGfNwKE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b_/b_Itlk9QZZd7Rvf8kcA4yLP1R5Acu7jB-m1xQiSU0qE.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/br/brab5gafSQ9hLY7MFUiQo-7PgjQa61zLXKIAUD-46Vs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cY/cYDoBAQFTD5xOCTGdrBydEo2JqEawiwX6fWa3IrUm5Y.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/d0/d0uefzjacFcMOQg9VX46kiwllKocVzsVozWt0hRkBrM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dk/Dk9SfX198poaZPH6xB5UDvL3BIurIHdhpEQIOA6_NrY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dk/dkriEZb9VWN_rkL7ghDD4IcDFYPOc099aP9d-TqjWgs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dq/dqRsht-pLWtsrvCJd6gAvYzMd_bwjGsvhzKFJ4lJKMQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eQ/eQOTPX0H3QvbPJvwc7vXsTV4yp0tavCkkdx_ZMpV_xY.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ej/ejie8YLhXJlxOQcsZwZqhSmZccYE-t2NW6rQ8-pUvX8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gh/gh0m9ohu3CIzUFUvKbWJQL38MsShVWywwcqtDypwpG4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h0/h0A9M_KdAd8osQJeKHNFVXQPlvboa-3PVhGBNsTEaLo.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h7/h7IpOHt4eNmpIWAmXJ_phaRYAT3TrFHChvlPe9eDRWg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iP/iPAgBmrq7WERmrolpV9HwXbBKZEt3J5xTsPgzEYlAo4.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/js/jsi0BYCHcicTcCdhA7SibHQIgDHEDNgKQTZehDtwMVc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kO/kO0R8Wk-ok-Mk5RCPLgF3B69Tke-qajPdIcz1dctwzw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mX/mX1nlsL_SWOB4y22W5FheRX0YEONKyOY7xUeIvRiHco.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ps/psdbPwxTr09SmYyT6Sg4t09okLmqsaXqZ8cDWB2_20w.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/q0/q0qu7zCx6lgm2SwlK21QC3pXV1W_el5vZ6scY1dGUDU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sM/sMd9eUxa5puStD62GGA-ruYEThLZ4M9irw8n1sGyhjk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/un/unYhQ5ddiaSGsSPjeeeEttmaIEgnFSEIYwgoJJ0Koy8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/us/usXHehPLU8kxfXFGjkICXXm0yqVwEd_tWr3PDXhFJTo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uy/uy1EA1Oy79kH6kB58GTNUJRZi1BmmRzrPIJDi8gF9nE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v7/v7PGHFSI0GrVv7QZTEQMw9ogpizJTzbOzEs66Kq7BQs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/we/wesb6dLgRIOD8BYJoo_HmOFmXoMUSV6jVSza4SQPOt4.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x7/x7PYh8DJvPykcEqpVab2vcY9-GFz-3cqtoMlRAu94Uc.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zU/zUARB-S48gcDUi5p9yOdhew1I-uauMw41jcPawlWD4k.cache +1 -0
- data/spec/factories.rb +22 -0
- data/spec/features/method_call_logs_page_spec.rb +60 -0
- data/spec/features/method_call_situations_page_spec.rb +64 -0
- data/spec/lib/okuribito_rails/observe_method_spec.rb +0 -1
- data/spec/spec_helper.rb +5 -1
- metadata +150 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 968342a0bfd5e8d3cb43dfcfc4ff411b19030c53
|
4
|
+
data.tar.gz: 386b480e26de49caaa8559e573a2f6962082315a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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 MethodCallSituationsController < ApplicationController
|
5
5
|
def index
|
6
6
|
@method_call_situations = MethodCallSituation
|
7
|
-
.search(
|
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
|
@@ -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
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|