okuribito_rails 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/app/assets/images/okuribito_rails/logo.png +0 -0
- data/app/assets/stylesheets/okuribito_rails/application.css +11 -0
- data/app/assets/stylesheets/okuribito_rails/header.css +39 -0
- data/app/assets/stylesheets/okuribito_rails/method_call_info.css +0 -1
- data/app/controllers/okuribito_rails/application_controller.rb +19 -0
- data/app/models/okuribito_rails/method_call_log.rb +1 -1
- data/app/views/layouts/okuribito_rails/_header.html.erb +9 -0
- data/app/views/layouts/okuribito_rails/application.html.erb +4 -1
- data/app/views/okuribito_rails/method_call_situations/index.html.erb +2 -6
- data/lib/generators/okuribito_rails/templates/initializer.erb +6 -0
- data/lib/okuribito_rails/config.rb +15 -2
- data/lib/okuribito_rails/observe_method.rb +18 -11
- data/lib/okuribito_rails/railtie.rb +2 -14
- data/lib/okuribito_rails/regist_method.rb +15 -13
- data/lib/okuribito_rails/start_observer.rb +39 -0
- data/lib/okuribito_rails/version.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +131 -0
- data/spec/dummy/log/test.log +26561 -0
- data/spec/factories.rb +6 -6
- data/spec/lib/okuribito_rails/observe_method_spec.rb +33 -0
- data/spec/lib/okuribito_rails/regist_method_spec.rb +40 -0
- data/spec/lib/okuribito_rails/start_observer_spec.rb +36 -0
- data/spec/models/method_call_log_spec.rb +5 -5
- data/spec/models/method_call_situation_spec.rb +5 -5
- data/spec/spec_helper.rb +16 -0
- data/spec/support/test_config.yml +3 -0
- data/spec/support/test_target.rb +5 -0
- metadata +33 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd4b90597549d8c3caf329d3c4364cea6f38ec76
|
4
|
+
data.tar.gz: 437ae8940f476287492a92fe941336d0c8851c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2331e21330de88c70939e5fa017e729ce068dab6f6824f77c8bb3a5b2078430b3faa56b0956e9b296a353088885254d290fce6675902449373abea1257c0e2ea
|
7
|
+
data.tar.gz: ab868ae7c137dbed5aa741a2872ee9b2c1575b28214211e6f7475115d2ea5b60c39aef9fc009b2cc0644f8133fe71b69b811f19748b3fd46f960caf409393edd
|
data/README.md
CHANGED
@@ -4,15 +4,13 @@
|
|
4
4
|
|
5
5
|
# OkuribitoRails
|
6
6
|
|
7
|
-
OkuribitoRails is an engine for Rails that aims to
|
7
|
+
OkuribitoRails is an engine for Rails that aims to manage method call status.
|
8
8
|
|
9
|
-
|
9
|
+
OkuribitoRails monitors method calls with YAML.
|
10
10
|
|
11
|
-
|
11
|
+
You can identify methods that have not been called from anywhere!
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
![OkuribitoRails](https://raw.githubusercontent.com/muramurasan/okuribito_rails/master/doc/sample.png)
|
13
|
+
![Sample](https://raw.githubusercontent.com/muramurasan/okuribito_rails/master/doc/sample.png)
|
16
14
|
|
17
15
|
# Features
|
18
16
|
|
Binary file
|
@@ -0,0 +1,39 @@
|
|
1
|
+
.header {
|
2
|
+
width: 100%;
|
3
|
+
background-color: #000;
|
4
|
+
height: 60px;
|
5
|
+
padding: 5px;
|
6
|
+
margin-bottom: 20px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.global-nav {
|
10
|
+
text-align: right;
|
11
|
+
}
|
12
|
+
.global-nav .nav-logo {
|
13
|
+
float: left;
|
14
|
+
display: inline-block;
|
15
|
+
margin-top: -18px;
|
16
|
+
}
|
17
|
+
.global-nav .nav-item {
|
18
|
+
float: right;
|
19
|
+
display: inline-block;
|
20
|
+
margin: 0 10px;
|
21
|
+
}
|
22
|
+
.global-nav .nav-item a {
|
23
|
+
display: inline-block;
|
24
|
+
width: 160px;
|
25
|
+
height: 30px;
|
26
|
+
line-height: 30px;
|
27
|
+
text-align: center;
|
28
|
+
border-radius: 8px;
|
29
|
+
color: #fff;
|
30
|
+
font-size: 1.3rem;
|
31
|
+
letter-spacing: 1px;
|
32
|
+
transition: 0.15s;
|
33
|
+
text-decoration: none;
|
34
|
+
}
|
35
|
+
.global-nav .nav-item.active a,
|
36
|
+
.global-nav .nav-item a:hover {
|
37
|
+
background-color: #d03c56;
|
38
|
+
color: #fff;
|
39
|
+
}
|
@@ -1,5 +1,24 @@
|
|
1
1
|
module OkuribitoRails
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
protect_from_forgery
|
4
|
+
|
5
|
+
if Gem::Version.new(Rails.version) < Gem::Version.new(4)
|
6
|
+
before_filter :available_action!
|
7
|
+
else
|
8
|
+
before_action :available_action!
|
9
|
+
end
|
10
|
+
|
11
|
+
def available_action!
|
12
|
+
if prohibited_env?
|
13
|
+
render nothing: true, status: 403
|
14
|
+
return
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def prohibited_env?
|
21
|
+
OkuribitoRails.config.prohibit_webui.include?(ENV["RAILS_ENV"])
|
22
|
+
end
|
4
23
|
end
|
5
24
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module OkuribitoRails
|
2
2
|
class MethodCallLog < ActiveRecord::Base
|
3
|
-
belongs_to :method_call_situation
|
3
|
+
belongs_to :method_call_situation, counter_cache: :called_num
|
4
4
|
|
5
5
|
validates :class_name, presence: true, length: { minimum: 1, maximum: 255 }
|
6
6
|
validates :method_symbol, presence: true, inclusion: { in: %w(. #) }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<header class="header">
|
2
|
+
<nav class="global-nav">
|
3
|
+
<%= image_tag "okuribito_rails/logo.png", class: "nav-logo" %>
|
4
|
+
<ul>
|
5
|
+
<li class="nav-item"><%= link_to "Monitoring", method_call_situations_path %></li>
|
6
|
+
<li class="nav-item"><%= link_to "Logs", method_call_logs_path %></li>
|
7
|
+
</ul>
|
8
|
+
</nav>
|
9
|
+
</header>
|
@@ -2,9 +2,8 @@
|
|
2
2
|
<tbody>
|
3
3
|
<tr>
|
4
4
|
<th>Method name</th>
|
5
|
-
<th>Number of
|
6
|
-
<th>
|
7
|
-
<th>Last call date</th>
|
5
|
+
<th>Number of times called</th>
|
6
|
+
<th>Observation start date</th>
|
8
7
|
</tr>
|
9
8
|
<% @method_call_situations.each do |method_call_situation| %>
|
10
9
|
<tr>
|
@@ -17,9 +16,6 @@
|
|
17
16
|
<td>
|
18
17
|
<%= method_call_situation.created_at %>
|
19
18
|
</td>
|
20
|
-
<td>
|
21
|
-
<%= method_call_situation.called_num > 0 ? method_call_situation.updated_at : "Not called" %>
|
22
|
-
</td>
|
23
19
|
</tr>
|
24
20
|
<% end %>
|
25
21
|
</tbody>
|
@@ -4,4 +4,10 @@ OkuribitoRails.configure do |config|
|
|
4
4
|
|
5
5
|
# Detecting method calls only once during application running.
|
6
6
|
config.once_detect = true
|
7
|
+
|
8
|
+
# You will not be able to access the Web UI in the specified environment.
|
9
|
+
config.prohibit_webui = ["test"]
|
10
|
+
|
11
|
+
# It will not monitor method calls in the specified environment.
|
12
|
+
config.prohibit_observe = ["test"]
|
7
13
|
end
|
@@ -2,7 +2,20 @@ module OkuribitoRails
|
|
2
2
|
class Config
|
3
3
|
include ActiveSupport::Configurable
|
4
4
|
|
5
|
-
config_accessor :once_detect
|
6
|
-
|
5
|
+
config_accessor :once_detect do
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
config_accessor :setting_path do
|
10
|
+
"config/okuribito.yml"
|
11
|
+
end
|
12
|
+
|
13
|
+
config_accessor :prohibit_webui do
|
14
|
+
["test"]
|
15
|
+
end
|
16
|
+
|
17
|
+
config_accessor :prohibit_observe do
|
18
|
+
["test"]
|
19
|
+
end
|
7
20
|
end
|
8
21
|
end
|
@@ -4,20 +4,27 @@ module OkuribitoRails
|
|
4
4
|
class ObserveMethod
|
5
5
|
def patch_okuribito
|
6
6
|
Okuribito::OkuribitoPatch.new(
|
7
|
-
once_detect:
|
7
|
+
once_detect: config_once_detect
|
8
8
|
) do |method_name, _obj_name, caller_info, class_name, method_symbol|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
situation.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
ActiveRecord::Base.transaction do
|
10
|
+
situation = MethodCallSituation.find_by(class_name: class_name,
|
11
|
+
method_symbol: method_symbol,
|
12
|
+
method_name: method_name)
|
13
|
+
if situation.present?
|
14
|
+
MethodCallLog.create(method_call_situation: situation,
|
15
|
+
class_name: class_name,
|
16
|
+
method_symbol: method_symbol,
|
17
|
+
method_name: method_name,
|
18
|
+
back_trace: caller_info[0])
|
19
|
+
end
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def config_once_detect
|
27
|
+
OkuribitoRails.config.once_detect
|
28
|
+
end
|
22
29
|
end
|
23
30
|
end
|
@@ -1,21 +1,9 @@
|
|
1
|
-
require "okuribito_rails/
|
2
|
-
require "okuribito_rails/observe_method"
|
1
|
+
require "okuribito_rails/start_observer"
|
3
2
|
|
4
3
|
module OkuribitoRails
|
5
4
|
class Railtie < ::Rails::Railtie
|
6
5
|
config.after_initialize do
|
7
|
-
|
8
|
-
yaml_path = OkuribitoRails.config.setting_path
|
9
|
-
|
10
|
-
unless yaml_path.nil?
|
11
|
-
# Update database by observed methods.
|
12
|
-
RegistMethod.new.update_observe_methods(yaml_path)
|
13
|
-
|
14
|
-
# Define behavior that when method called.
|
15
|
-
okuribito = ObserveMethod.new.patch_okuribito
|
16
|
-
okuribito.apply(yaml_path) if File.exist?(yaml_path)
|
17
|
-
end
|
18
|
-
end
|
6
|
+
StartObserver.new.start
|
19
7
|
end
|
20
8
|
end
|
21
9
|
end
|
@@ -6,21 +6,13 @@ module OkuribitoRails
|
|
6
6
|
input = yaml_to_array(path)
|
7
7
|
base = db_to_array
|
8
8
|
new_methods = input - base
|
9
|
-
new_methods.each
|
10
|
-
|
11
|
-
|
12
|
-
method_symbol: array[1],
|
13
|
-
method_name: array[2])
|
14
|
-
end
|
15
|
-
delete_methods = base - input
|
16
|
-
delete_methods.each do |delete_method|
|
17
|
-
array = delete_method.split(/\s*(#|\.)\s*/)
|
18
|
-
MethodCallSituation.find_by(class_name: array[0],
|
19
|
-
method_symbol: array[1],
|
20
|
-
method_name: array[2]).destroy
|
21
|
-
end
|
9
|
+
new_methods.each { |new_method| regist_method(new_method) }
|
10
|
+
old_methods = base - input
|
11
|
+
old_methods.each { |old_method| destroy_method(old_method) }
|
22
12
|
end
|
23
13
|
|
14
|
+
private
|
15
|
+
|
24
16
|
def yaml_to_array(path)
|
25
17
|
yaml = YAML.load_file(path)
|
26
18
|
methods_array = []
|
@@ -40,5 +32,15 @@ module OkuribitoRails
|
|
40
32
|
end
|
41
33
|
methods_array
|
42
34
|
end
|
35
|
+
|
36
|
+
def regist_method(method)
|
37
|
+
a = method.split(/\s*(#|\.)\s*/)
|
38
|
+
MethodCallSituation.create(class_name: a[0], method_symbol: a[1], method_name: a[2])
|
39
|
+
end
|
40
|
+
|
41
|
+
def destroy_method(method)
|
42
|
+
a = method.split(/\s*(#|\.)\s*/)
|
43
|
+
MethodCallSituation.find_by(class_name: a[0], method_symbol: a[1], method_name: a[2]).destroy
|
44
|
+
end
|
43
45
|
end
|
44
46
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "okuribito_rails/regist_method"
|
2
|
+
require "okuribito_rails/observe_method"
|
3
|
+
|
4
|
+
module OkuribitoRails
|
5
|
+
class StartObserver
|
6
|
+
def start
|
7
|
+
return if prohibit_env? || before_migrate?
|
8
|
+
return unless File.exist?(yaml_path = setting_path)
|
9
|
+
|
10
|
+
regist_method(yaml_path)
|
11
|
+
start_observer(yaml_path)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def prohibit_env?
|
17
|
+
OkuribitoRails.config.prohibit_observe.include?(ENV["RAILS_ENV"])
|
18
|
+
end
|
19
|
+
|
20
|
+
def before_migrate?
|
21
|
+
!ActiveRecord::Base.connection.table_exists? "okuribito_rails_method_call_situations"
|
22
|
+
end
|
23
|
+
|
24
|
+
def setting_path
|
25
|
+
OkuribitoRails.config.setting_path
|
26
|
+
end
|
27
|
+
|
28
|
+
def regist_method(yaml_path)
|
29
|
+
# Update database by observed methods.
|
30
|
+
RegistMethod.new.update_observe_methods(yaml_path)
|
31
|
+
end
|
32
|
+
|
33
|
+
def start_observer(yaml_path)
|
34
|
+
# Define behavior that when method called.
|
35
|
+
okuribito = ObserveMethod.new.patch_okuribito
|
36
|
+
okuribito.apply(yaml_path)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
Binary file
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -3,3 +3,134 @@ DEPRECATION WARNING: #table_exists? currently checks both tables and views. This
|
|
3
3
|
[1m[35m (1.0ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
4
4
|
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5
5
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6
|
+
DEPRECATION WARNING: #table_exists? currently checks both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only check tables. Use #data_source_exists? instead. (called from block in <class:Railtie> at /Users/ym/works/okuribito_rails_dev/lib/okuribito_rails/railtie.rb:7)
|
7
|
+
DEPRECATION WARNING: #table_exists? currently checks both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only check tables. Use #data_source_exists? instead. (called from before_migrate? at /Users/ym/works/okuribito_rails_dev/lib/okuribito_rails/start_observer.rb:21)
|
8
|
+
[1m[36mActiveRecord::SchemaMigration Load (2.7ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
9
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
10
|
+
[1m[35m (4.5ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
11
|
+
[1m[35m (1.1ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
12
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
13
|
+
Migrating to CreateOkuribitoRailsMethodCallSituations (20161027145839)
|
14
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
15
|
+
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for:
|
16
|
+
|
17
|
+
class CreateOkuribitoRailsMethodCallSituations < ActiveRecord::Migration[4.2] (called from load at /Users/ym/.rbenv/versions/2.3.1/bin/rake:23)
|
18
|
+
[1m[35m (0.5ms)[0m [1m[35mCREATE TABLE "okuribito_rails_method_call_situations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "class_name" varchar NOT NULL, "method_symbol" varchar NOT NULL, "method_name" varchar NOT NULL, "created_at" datetime, "updated_at" datetime)[0m
|
19
|
+
[1m[35m (0.1ms)[0m [1m[34mselect sqlite_version(*)[0m
|
20
|
+
[1m[35m (0.1ms)[0m [1m[35mCREATE INDEX "index_okuribito_rails_method_call_situations_on_class_name" ON "okuribito_rails_method_call_situations" ("class_name")[0m
|
21
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161027145839"]]
|
22
|
+
[1m[35m (0.9ms)[0m [1m[36mcommit transaction[0m
|
23
|
+
Migrating to CreateOkuribitoRailsMethodCallLogs (20161027150000)
|
24
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
25
|
+
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for:
|
26
|
+
|
27
|
+
class CreateOkuribitoRailsMethodCallLogs < ActiveRecord::Migration[4.2] (called from load at /Users/ym/.rbenv/versions/2.3.1/bin/rake:23)
|
28
|
+
[1m[35m (0.4ms)[0m [1m[35mCREATE TABLE "okuribito_rails_method_call_logs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "class_name" varchar NOT NULL, "method_symbol" varchar NOT NULL, "method_name" varchar NOT NULL, "back_trace" text, "created_at" datetime, "updated_at" datetime)[0m
|
29
|
+
[1m[35m (0.1ms)[0m [1m[35mCREATE INDEX "index_okuribito_rails_method_call_logs_on_class_name" ON "okuribito_rails_method_call_logs" ("class_name")[0m
|
30
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161027150000"]]
|
31
|
+
[1m[35m (2.4ms)[0m [1m[36mcommit transaction[0m
|
32
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", :environment], ["LIMIT", 1]]
|
33
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
34
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", 2016-12-18 15:34:06 UTC], ["updated_at", 2016-12-18 15:34:06 UTC]]
|
35
|
+
[1m[35m (1.0ms)[0m [1m[36mcommit transaction[0m
|
36
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
37
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
38
|
+
FROM sqlite_master
|
39
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_class_name' AND type='index'
|
40
|
+
UNION ALL
|
41
|
+
SELECT sql
|
42
|
+
FROM sqlite_temp_master
|
43
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_class_name' AND type='index'
|
44
|
+
[0m
|
45
|
+
[1m[35m (0.5ms)[0m [1m[34m SELECT sql
|
46
|
+
FROM sqlite_master
|
47
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_class_name' AND type='index'
|
48
|
+
UNION ALL
|
49
|
+
SELECT sql
|
50
|
+
FROM sqlite_temp_master
|
51
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_class_name' AND type='index'
|
52
|
+
[0m
|
53
|
+
DEPRECATION WARNING: #table_exists? currently checks both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only check tables. Use #data_source_exists? instead. (called from before_migrate? at /Users/ym/works/okuribito_rails_dev/lib/okuribito_rails/start_observer.rb:21)
|
54
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
55
|
+
[1m[35m (1.0ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", :environment]]
|
56
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
57
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", :environment]]
|
58
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
59
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", :environment]]
|
60
|
+
[1m[35m (1.2ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
61
|
+
[1m[35m (1.0ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
62
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
63
|
+
Migrating to CreateOkuribitoRailsMethodCallSituations (20161027145839)
|
64
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
65
|
+
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for:
|
66
|
+
|
67
|
+
class CreateOkuribitoRailsMethodCallSituations < ActiveRecord::Migration[4.2] (called from load at /Users/ym/.rbenv/versions/2.3.1/bin/rake:23)
|
68
|
+
[1m[35m (0.5ms)[0m [1m[35mCREATE TABLE "okuribito_rails_method_call_situations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "class_name" varchar NOT NULL, "method_symbol" varchar NOT NULL, "method_name" varchar NOT NULL, "called_num" integer DEFAULT 0 NOT NULL, "created_at" datetime, "updated_at" datetime)[0m
|
69
|
+
[1m[35m (0.1ms)[0m [1m[34mselect sqlite_version(*)[0m
|
70
|
+
[1m[35m (0.1ms)[0m [1m[35mCREATE INDEX "index_okuribito_rails_method_call_situations_on_class_name" ON "okuribito_rails_method_call_situations" ("class_name")[0m
|
71
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
72
|
+
FROM sqlite_master
|
73
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_class_name' AND type='index'
|
74
|
+
UNION ALL
|
75
|
+
SELECT sql
|
76
|
+
FROM sqlite_temp_master
|
77
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_class_name' AND type='index'
|
78
|
+
[0m
|
79
|
+
[1m[35m (0.2ms)[0m [1m[35mCREATE INDEX "index_okuribito_rails_method_call_situations_on_method_name" ON "okuribito_rails_method_call_situations" ("method_name")[0m
|
80
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161027145839"]]
|
81
|
+
[1m[35m (0.9ms)[0m [1m[36mcommit transaction[0m
|
82
|
+
Migrating to CreateOkuribitoRailsMethodCallLogs (20161027150000)
|
83
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
84
|
+
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for:
|
85
|
+
|
86
|
+
class CreateOkuribitoRailsMethodCallLogs < ActiveRecord::Migration[4.2] (called from load at /Users/ym/.rbenv/versions/2.3.1/bin/rake:23)
|
87
|
+
[1m[35m (0.3ms)[0m [1m[35mCREATE TABLE "okuribito_rails_method_call_logs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "method_call_situation_id" integer NOT NULL, "class_name" varchar NOT NULL, "method_symbol" varchar NOT NULL, "method_name" varchar NOT NULL, "back_trace" text, "created_at" datetime, "updated_at" datetime)[0m
|
88
|
+
[1m[35m (0.1ms)[0m [1m[35mCREATE INDEX "index_okuribito_rails_method_call_logs_on_class_name" ON "okuribito_rails_method_call_logs" ("class_name")[0m
|
89
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
90
|
+
FROM sqlite_master
|
91
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_class_name' AND type='index'
|
92
|
+
UNION ALL
|
93
|
+
SELECT sql
|
94
|
+
FROM sqlite_temp_master
|
95
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_class_name' AND type='index'
|
96
|
+
[0m
|
97
|
+
[1m[35m (0.1ms)[0m [1m[35mCREATE INDEX "index_okuribito_rails_method_call_logs_on_method_name" ON "okuribito_rails_method_call_logs" ("method_name")[0m
|
98
|
+
[1m[35mSQL (0.1ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20161027150000"]]
|
99
|
+
[1m[35m (0.8ms)[0m [1m[36mcommit transaction[0m
|
100
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", :environment], ["LIMIT", 1]]
|
101
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
102
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", 2016-12-18 15:58:24 UTC], ["updated_at", 2016-12-18 15:58:24 UTC]]
|
103
|
+
[1m[35m (0.8ms)[0m [1m[36mcommit transaction[0m
|
104
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
105
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
106
|
+
FROM sqlite_master
|
107
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_method_name' AND type='index'
|
108
|
+
UNION ALL
|
109
|
+
SELECT sql
|
110
|
+
FROM sqlite_temp_master
|
111
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_method_name' AND type='index'
|
112
|
+
[0m
|
113
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
114
|
+
FROM sqlite_master
|
115
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_class_name' AND type='index'
|
116
|
+
UNION ALL
|
117
|
+
SELECT sql
|
118
|
+
FROM sqlite_temp_master
|
119
|
+
WHERE name='index_okuribito_rails_method_call_logs_on_class_name' AND type='index'
|
120
|
+
[0m
|
121
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
122
|
+
FROM sqlite_master
|
123
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_method_name' AND type='index'
|
124
|
+
UNION ALL
|
125
|
+
SELECT sql
|
126
|
+
FROM sqlite_temp_master
|
127
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_method_name' AND type='index'
|
128
|
+
[0m
|
129
|
+
[1m[35m (0.1ms)[0m [1m[34m SELECT sql
|
130
|
+
FROM sqlite_master
|
131
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_class_name' AND type='index'
|
132
|
+
UNION ALL
|
133
|
+
SELECT sql
|
134
|
+
FROM sqlite_temp_master
|
135
|
+
WHERE name='index_okuribito_rails_method_call_situations_on_class_name' AND type='index'
|
136
|
+
[0m
|