deforest 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f124724d629f69ad95476356da5f41d1d7c6e15f273d93db8b383474875a51f8
|
4
|
+
data.tar.gz: 18fee8cb02cfe65e5b16e146f02a189dec55f454528786a932aef7e6d7a472e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b8ca750779df577eb512a8b928d60678a01597686a806df8b93b710cab2d696767d30b81dad810edc6c7cd9d339919d4b077933355122482ff16e6daf7d9916
|
7
|
+
data.tar.gz: fb94f2c1dc011e29b6b566da7c5265f0ea806b876806caebe1b6c616bed408ccbcdec81b73dfbed8b922fad8778f74432810b29d081a6a83e39673047e5acb18
|
data/lib/deforest/version.rb
CHANGED
@@ -11,27 +11,26 @@ class DeforestGenerator < Rails::Generators::Base
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def copy_initializer_file
|
14
|
-
if rails5_and_up? && Rails.autoloaders.zeitwerk_enabled?
|
14
|
+
if DeforestGenerator.rails5_and_up? && Rails.autoloaders.zeitwerk_enabled?
|
15
15
|
copy_file "zeitwerk_enabled_initializer.rb", "config/initializers/deforest.rb"
|
16
16
|
else
|
17
17
|
copy_file "classic_enabled_initializer.rb", "config/initializers/deforest.rb"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def rails5_and_up?
|
21
|
+
def self.rails5_and_up?
|
22
22
|
Rails::VERSION::MAJOR >= 5
|
23
23
|
end
|
24
24
|
|
25
25
|
def migration_version
|
26
|
-
if rails5_and_up?
|
26
|
+
if DeforestGenerator.rails5_and_up?
|
27
27
|
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.next_migration_number(dirname)
|
32
|
-
if ActiveRecord::Base.timestamped_migrations
|
33
|
-
|
34
|
-
current_time.strftime("%Y%m%d%H%M%S")
|
32
|
+
if (rails5_and_up? && ActiveRecord.timestamped_migrations) || ActiveRecord::Base.timestamped_migrations
|
33
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S")
|
35
34
|
else
|
36
35
|
"%.3d" % (current_numeric_version(dirname) + 1)
|
37
36
|
end
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -3560,3 +3560,105 @@ Deforest::LogTest: test_percentile
|
|
3560
3560
|
----------------------------------
|
3561
3561
|
[1m[36mDeforest::Log Load (0.1ms)[0m [1mSELECT file_name, line_no, method_name, SUM(count) AS count_sum FROM "deforest_logs" WHERE (file_name like '%/app/models/%') GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"[0m
|
3562
3562
|
[1m[35m (0.0ms)[0m rollback transaction
|
3563
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3564
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3565
|
+
[1m[36mFixture Delete (0.8ms)[0m [1mDELETE FROM "posts"[0m
|
3566
|
+
[1m[35mFixture Insert (0.4ms)[0m INSERT INTO "posts" ("title", "body", "author_id", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', 1, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 980190962)
|
3567
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "posts" ("title", "body", "author_id", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', 1, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 298486374)[0m
|
3568
|
+
[1m[35mFixture Delete (0.4ms)[0m DELETE FROM "deforest_logs"
|
3569
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "deforest_logs" ("file_name", "line_no", "method_name", "count", "created_at", "updated_at", "id") VALUES ('/Users/johndoe/workspace/app/models/setting.rb', 27, 'refresh_cache', 2, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 980190962)[0m
|
3570
|
+
[1m[35mFixture Insert (0.0ms)[0m INSERT INTO "deforest_logs" ("file_name", "line_no", "method_name", "count", "created_at", "updated_at", "id") VALUES ('/Users/johndoe/workspace/app/models/doctor.rb', 2144, 'lock_user', 10, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 298486374)
|
3571
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "deforest_logs" ("file_name", "line_no", "method_name", "count", "created_at", "updated_at", "id") VALUES ('/Users/johndoe/workspace/app/models/doctor.rb', 33, 'open', 35, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 113629430)[0m
|
3572
|
+
[1m[35mFixture Insert (0.0ms)[0m INSERT INTO "deforest_logs" ("file_name", "line_no", "method_name", "count", "created_at", "updated_at", "id") VALUES ('/Users/johndoe/workspace/app/models/user.rb', 100, 'get_user_name', 100, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 933434481)
|
3573
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "deforest_logs" ("file_name", "line_no", "method_name", "count", "created_at", "updated_at", "id") VALUES ('/Users/johndoe/workspace/app/models/user.rb', 200, 'get_email', 300, '2024-09-21 14:54:22', '2024-09-21 14:54:22', 303968118)[0m
|
3574
|
+
[1m[35m (1.1ms)[0m commit transaction
|
3575
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3576
|
+
--------------------------------------
|
3577
|
+
Deforest::LogTest: test_get_model_name
|
3578
|
+
--------------------------------------
|
3579
|
+
[1m[35mDeforest::Log Load (0.1ms)[0m SELECT "deforest_logs".* FROM "deforest_logs" WHERE "deforest_logs"."id" = ? LIMIT 1 [["id", 980190962]]
|
3580
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3581
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3582
|
+
-----------------------------------------------------
|
3583
|
+
Deforest::LogTest: test_get_highlight_colors_for_file
|
3584
|
+
-----------------------------------------------------
|
3585
|
+
[1m[36mDeforest::Log Load (0.1ms)[0m [1mSELECT file_name, line_no, method_name, SUM(count) AS count_sum FROM "deforest_logs" WHERE (file_name like '%/app/models/%') GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"[0m
|
3586
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3587
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3588
|
+
----------------------------------
|
3589
|
+
Deforest::LogTest: test_percentile
|
3590
|
+
----------------------------------
|
3591
|
+
[1m[35mDeforest::Log Load (0.2ms)[0m SELECT file_name, line_no, method_name, SUM(count) AS count_sum FROM "deforest_logs" WHERE (file_name like '%/app/models/%') GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"
|
3592
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3593
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3594
|
+
------------------------------------------------------------------------
|
3595
|
+
PostTest: test_calling_a_model_instance_method_should_create_a_log_entry
|
3596
|
+
------------------------------------------------------------------------
|
3597
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "deforest_logs"[0m
|
3598
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC LIMIT 1
|
3599
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO deforest_logs (file_name, line_no, method_name, count, created_at, updated_at) VALUES ('/Users/akshaytakkar/deforest/test/dummy/app/models/post.rb','8','get_title_with_italics', 1, '2024-09-21 14:54:22 UTC', '2024-09-21 14:54:22 UTC');[0m
|
3600
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "deforest_logs"
|
3601
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
3602
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3603
|
+
-------------------------------
|
3604
|
+
PostTest: test_most_used_method
|
3605
|
+
-------------------------------
|
3606
|
+
[1m[36m (0.2ms)[0m [1mSELECT file_name, line_no, method_name, SUM(count) FROM "deforest_logs" GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"[0m
|
3607
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3608
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3609
|
+
-----------------------------
|
3610
|
+
PostTest: test_get_app_models
|
3611
|
+
-----------------------------
|
3612
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3613
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3614
|
+
--------------------------------
|
3615
|
+
PostTest: test_least_used_method
|
3616
|
+
--------------------------------
|
3617
|
+
[1m[35m (0.3ms)[0m SELECT file_name, line_no, method_name, SUM(count) FROM "deforest_logs" GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"
|
3618
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3619
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3620
|
+
--------------------------------------
|
3621
|
+
PostTest: test_top_2_most_used_methods
|
3622
|
+
--------------------------------------
|
3623
|
+
[1m[36m (0.1ms)[0m [1mSELECT file_name, line_no, method_name, SUM(count) FROM "deforest_logs" GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"[0m
|
3624
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3625
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3626
|
+
---------------------------------------------------------------------
|
3627
|
+
PostTest: test_calling_a_model_class_method_should_create_a_log_entry
|
3628
|
+
---------------------------------------------------------------------
|
3629
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "deforest_logs"
|
3630
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO deforest_logs (file_name, line_no, method_name, count, created_at, updated_at) VALUES ('/Users/akshaytakkar/deforest/test/dummy/app/models/post.rb','4','get_titles', 1, '2024-09-21 14:54:22 UTC', '2024-09-21 14:54:22 UTC');[0m
|
3631
|
+
[1m[35mPost Load (0.0ms)[0m SELECT "posts".* FROM "posts"
|
3632
|
+
[1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "deforest_logs"[0m
|
3633
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
3634
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3635
|
+
---------------------------------------
|
3636
|
+
PostTest: test_top_2_least_used_methods
|
3637
|
+
---------------------------------------
|
3638
|
+
[1m[35m (0.1ms)[0m SELECT file_name, line_no, method_name, SUM(count) FROM "deforest_logs" GROUP BY "deforest_logs"."file_name", "deforest_logs"."line_no", "deforest_logs"."method_name"
|
3639
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3640
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3641
|
+
-----------------------------------------------------------------------
|
3642
|
+
DeforestTest: test_initialize_db_sync_file_when_db_sync_file_does_exist
|
3643
|
+
-----------------------------------------------------------------------
|
3644
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3645
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3646
|
+
---------------------------------------------------------------------------
|
3647
|
+
DeforestTest: test_initialize_db_sync_file_when_db_sync_file_does_not_exist
|
3648
|
+
---------------------------------------------------------------------------
|
3649
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3650
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3651
|
+
-----------------------------------
|
3652
|
+
DeforestTest: test_insert_into_logs
|
3653
|
+
-----------------------------------
|
3654
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3655
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3656
|
+
------------------------------------------
|
3657
|
+
DeforestTest: test_parse_and_save_log_file
|
3658
|
+
------------------------------------------
|
3659
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO deforest_logs (file_name, line_no, method_name, count, created_at, updated_at) VALUES ('/Users/johndoe/workspace/app/models/corporate.rb','2144','get_email', 1, '2024-09-21 14:54:22 UTC', '2024-09-21 14:54:22 UTC'),('/Users/johndoe/workspace/app/models/myuser.rb','120','get_name', 1, '2024-09-21 14:54:22 UTC', '2024-09-21 14:54:22 UTC'),('/Users/johndoe/workspace/app/models/post.rb','2211','get_title', 2, '2024-09-21 14:54:22 UTC', '2024-09-21 14:54:22 UTC'),('/Users/johndoe/workspace/app/models/comment.rb','879','get_body', 1, '2024-09-21 14:54:22 UTC', '2024-09-21 14:54:22 UTC');[0m
|
3660
|
+
[1m[35mDeforest::Log Load (0.1ms)[0m SELECT "deforest_logs".* FROM "deforest_logs" WHERE "deforest_logs"."file_name" = ? ORDER BY "deforest_logs"."id" DESC LIMIT 1 [["file_name", "/Users/johndoe/workspace/app/models/corporate.rb"]]
|
3661
|
+
[1m[36mDeforest::Log Load (0.0ms)[0m [1mSELECT "deforest_logs".* FROM "deforest_logs" WHERE "deforest_logs"."file_name" = ? ORDER BY "deforest_logs"."id" DESC LIMIT 1[0m [["file_name", "/Users/johndoe/workspace/app/models/post.rb"]]
|
3662
|
+
[1m[35mDeforest::Log Load (0.0ms)[0m SELECT "deforest_logs".* FROM "deforest_logs" WHERE "deforest_logs"."file_name" = ? ORDER BY "deforest_logs"."id" DESC LIMIT 1 [["file_name", "/Users/johndoe/workspace/app/models/myuser.rb"]]
|
3663
|
+
[1m[36mDeforest::Log Load (0.0ms)[0m [1mSELECT "deforest_logs".* FROM "deforest_logs" WHERE "deforest_logs"."file_name" = ? ORDER BY "deforest_logs"."id" DESC LIMIT 1[0m [["file_name", "/Users/johndoe/workspace/app/models/comment.rb"]]
|
3664
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deforest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akshay Takkar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|