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: ed01112df40fa5c73529ac94966a8f57d0919d65b7ec7a305bad95bfdfdc986a
4
- data.tar.gz: a681a8fe638de9ca95961e30823662378ba201dd22be0256d63eb77455e4ca97
3
+ metadata.gz: f124724d629f69ad95476356da5f41d1d7c6e15f273d93db8b383474875a51f8
4
+ data.tar.gz: 18fee8cb02cfe65e5b16e146f02a189dec55f454528786a932aef7e6d7a472e2
5
5
  SHA512:
6
- metadata.gz: 11fcaab0c3099e3b2b54340c929bc6b40477554b7a962d6260184a4a129b6f7591a99b670bf9e7673fd4c62c46ffc4bdffef3182f984ed5a6949ed52bcb28db2
7
- data.tar.gz: 8d69fe415faa00cdecf94fc23e07cf22ef447900107c612633a5a4edd0996d23350a991dee467888a439034b729891c5c36de8bb332bd123a1bd916b94594196
6
+ metadata.gz: 1b8ca750779df577eb512a8b928d60678a01597686a806df8b93b710cab2d696767d30b81dad810edc6c7cd9d339919d4b077933355122482ff16e6daf7d9916
7
+ data.tar.gz: fb94f2c1dc011e29b6b566da7c5265f0ea806b876806caebe1b6c616bed408ccbcdec81b73dfbed8b922fad8778f74432810b29d081a6a83e39673047e5acb18
@@ -2,8 +2,6 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Deforest</title>
5
- <%= stylesheet_link_tag "deforest/application", media: "all" %>
6
- <%= javascript_include_tag "deforest/application" %>
7
5
  <%= csrf_meta_tags %>
8
6
  </head>
9
7
  <body>
@@ -1,3 +1,3 @@
1
1
  module Deforest
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -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
- current_time = Time.now.utc
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
Binary file
@@ -3560,3 +3560,105 @@ Deforest::LogTest: test_percentile
3560
3560
  ----------------------------------
3561
3561
  Deforest::Log Load (0.1ms) 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"
3562
3562
   (0.0ms) rollback transaction
3563
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3564
+  (0.1ms) begin transaction
3565
+ Fixture Delete (0.8ms) DELETE FROM "posts"
3566
+ Fixture Insert (0.4ms) 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
+ Fixture Insert (0.0ms) 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', 298486374)
3568
+ Fixture Delete (0.4ms) DELETE FROM "deforest_logs"
3569
+ Fixture Insert (0.0ms) INSERT 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)
3570
+ Fixture Insert (0.0ms) 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
+ Fixture Insert (0.0ms) INSERT 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)
3572
+ Fixture Insert (0.0ms) 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
+ Fixture Insert (0.0ms) INSERT 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)
3574
+  (1.1ms) commit transaction
3575
+  (0.0ms) begin transaction
3576
+ --------------------------------------
3577
+ Deforest::LogTest: test_get_model_name
3578
+ --------------------------------------
3579
+ Deforest::Log Load (0.1ms) SELECT "deforest_logs".* FROM "deforest_logs" WHERE "deforest_logs"."id" = ? LIMIT 1 [["id", 980190962]]
3580
+  (0.0ms) rollback transaction
3581
+  (0.0ms) begin transaction
3582
+ -----------------------------------------------------
3583
+ Deforest::LogTest: test_get_highlight_colors_for_file
3584
+ -----------------------------------------------------
3585
+ Deforest::Log Load (0.1ms) 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"
3586
+  (0.0ms) rollback transaction
3587
+  (0.0ms) begin transaction
3588
+ ----------------------------------
3589
+ Deforest::LogTest: test_percentile
3590
+ ----------------------------------
3591
+ Deforest::Log Load (0.2ms) 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
+  (0.1ms) rollback transaction
3593
+  (0.1ms) begin transaction
3594
+ ------------------------------------------------------------------------
3595
+ PostTest: test_calling_a_model_instance_method_should_create_a_log_entry
3596
+ ------------------------------------------------------------------------
3597
+  (0.1ms) SELECT COUNT(*) FROM "deforest_logs"
3598
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC LIMIT 1
3599
+  (0.3ms) INSERT 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');
3600
+  (0.1ms) SELECT COUNT(*) FROM "deforest_logs"
3601
+  (0.3ms) rollback transaction
3602
+  (0.0ms) begin transaction
3603
+ -------------------------------
3604
+ PostTest: test_most_used_method
3605
+ -------------------------------
3606
+  (0.2ms) 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"
3607
+  (0.0ms) rollback transaction
3608
+  (0.0ms) begin transaction
3609
+ -----------------------------
3610
+ PostTest: test_get_app_models
3611
+ -----------------------------
3612
+  (0.0ms) rollback transaction
3613
+  (0.0ms) begin transaction
3614
+ --------------------------------
3615
+ PostTest: test_least_used_method
3616
+ --------------------------------
3617
+  (0.3ms) 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
+  (0.1ms) rollback transaction
3619
+  (0.0ms) begin transaction
3620
+ --------------------------------------
3621
+ PostTest: test_top_2_most_used_methods
3622
+ --------------------------------------
3623
+  (0.1ms) 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"
3624
+  (0.0ms) rollback transaction
3625
+  (0.0ms) begin transaction
3626
+ ---------------------------------------------------------------------
3627
+ PostTest: test_calling_a_model_class_method_should_create_a_log_entry
3628
+ ---------------------------------------------------------------------
3629
+  (0.1ms) SELECT COUNT(*) FROM "deforest_logs"
3630
+  (0.2ms) INSERT 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');
3631
+ Post Load (0.0ms) SELECT "posts".* FROM "posts"
3632
+  (0.0ms) SELECT COUNT(*) FROM "deforest_logs"
3633
+  (0.3ms) rollback transaction
3634
+  (0.0ms) begin transaction
3635
+ ---------------------------------------
3636
+ PostTest: test_top_2_least_used_methods
3637
+ ---------------------------------------
3638
+  (0.1ms) 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
+  (0.0ms) rollback transaction
3640
+  (0.0ms) begin transaction
3641
+ -----------------------------------------------------------------------
3642
+ DeforestTest: test_initialize_db_sync_file_when_db_sync_file_does_exist
3643
+ -----------------------------------------------------------------------
3644
+  (0.0ms) rollback transaction
3645
+  (0.0ms) begin transaction
3646
+ ---------------------------------------------------------------------------
3647
+ DeforestTest: test_initialize_db_sync_file_when_db_sync_file_does_not_exist
3648
+ ---------------------------------------------------------------------------
3649
+  (0.1ms) rollback transaction
3650
+  (0.0ms) begin transaction
3651
+ -----------------------------------
3652
+ DeforestTest: test_insert_into_logs
3653
+ -----------------------------------
3654
+  (0.0ms) rollback transaction
3655
+  (0.0ms) begin transaction
3656
+ ------------------------------------------
3657
+ DeforestTest: test_parse_and_save_log_file
3658
+ ------------------------------------------
3659
+  (0.3ms) INSERT 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');
3660
+ Deforest::Log Load (0.1ms) 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
+ Deforest::Log Load (0.0ms) 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/post.rb"]]
3662
+ Deforest::Log Load (0.0ms) 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
+ Deforest::Log Load (0.0ms) 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/comment.rb"]]
3664
+  (0.4ms) 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.0
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-20 00:00:00.000000000 Z
11
+ date: 2024-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord