pry-byetypo 1.0.0 → 1.0.2

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: d29897c99a83e87e7e440a1c4d70152362c59b56909271441ad8ee64cdfc0dda
4
- data.tar.gz: e56b51093055e7374b10b83c4ab5694f51a46e6fa7d7bc49db4f883ee1e5238a
3
+ metadata.gz: 7faf45157b7a6b110d22c13122b713a51f25b9e9c31d928f4d5511a2e9ffbcb3
4
+ data.tar.gz: 4f462974bcc85139f06652b8d7ca28374fea6fbff9096388054197917f4bb104
5
5
  SHA512:
6
- metadata.gz: e0196f077acc833eb924f2d112bb88e052a2b8386ac1166d3f155b40db286a2afd99edfd2d81c5dce720d0dbb494902fb7ab0da185463b7926cd3aba0e446a0d
7
- data.tar.gz: e3c93cf18c7e5af20557d60d4760d2c7305b3b986c073ec1fc643c5be991e7d54ec8cc36ee9ee9f3a393865f15207bce3292e726a4496f1972cfe71357efe077
6
+ metadata.gz: 2156f5efe4854c4ac4298a314eb48006d629f289a59e6d58d4078c0373f8e4db776d93b3247fd61fba01536e9109b26ad3881ec46f1bca6f09c4c8c5194ea1c7
7
+ data.tar.gz: 44b4e2b0c73133bead16a8ed5f7660de909862fe3b2b7b156bcc0f4eb9ca4d7054e8eac6360766851dbe0cfa4ee74d25c5b065169509979ff36a3ebe14cefa21
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-byetypo (1.0.0)
4
+ pry-byetypo (1.0.2)
5
5
  colorize (~> 1.1.0)
6
6
  pry (>= 0.13, < 0.15)
7
7
  rails (~> 7.0)
data/README.md CHANGED
@@ -4,10 +4,6 @@ Autocorrects typos in your Pry console.
4
4
 
5
5
  This small Pry plugin captures exceptions that could be due to typos and deduces the correct command based on your database information.
6
6
 
7
- > [!NOTE]
8
- > So far, this plugin is not framework agnostic, and it requires Rails 7 or later.
9
-
10
-
11
7
  #### Before
12
8
 
13
9
  ```ruby
@@ -20,12 +16,15 @@ from (pry):3:in `__pry__'
20
16
 
21
17
  ```ruby
22
18
  [1] pry(main)> Usert.last
23
- I, [2024-01-13T20:00:16.280710 #694] INFO -- : `Usert` not working, running:
24
- I, [2024-01-13T20:00:16.281237 #694] INFO -- : User.last
19
+ I, [2024-01-13T20:00:16.280710 #694] ERROR -- : NameError: uninitialized constant Usert
20
+ I, [2024-01-13T20:00:16.281237 #694] INFO -- : Running: User.last
25
21
  2024-01-13 20:00:16.345175 D [694:9200 log_subscriber.rb:130] ActiveRecord::Base -- User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."deleted_at" IS NULL ORDER BY "users"."id" DESC LIMIT $1 [["LIMIT", 1]]
26
22
  => #<User id: 1, email: "yo@email.com">
27
23
  ```
28
24
 
25
+ > [!NOTE]
26
+ > So far, this plugin is not framework agnostic, and it requires Rails 7 or later.
27
+
29
28
  ## Installation
30
29
 
31
30
 
@@ -67,9 +66,8 @@ This error occurs when you mispelled a model in your REPL. The gem will catch th
67
66
 
68
67
  ```ruby
69
68
  [1] pry(main)> Usert.last
70
- I, [2024-01-13T20:00:16.280710 #694] INFO -- : `Usert` not working, running:
71
- I, [2024-01-13T20:00:16.281237 #694] INFO -- : User.last
72
- 2024-01-13 20:00:16.345175 D [694:9200 log_subscriber.rb:130] ActiveRecord::Base -- User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."deleted_at" IS NULL ORDER BY "users"."id" DESC LIMIT $1 [["LIMIT", 1]]
69
+ I, [2024-01-13T20:00:16.280710 #694] ERROR -- : uninitialized constant Usert
70
+ I, [2024-01-13T20:00:16.281237 #694] INFO -- : Running: User.last
73
71
  => #<User id: 1, email: "yo@email.com">
74
72
  ```
75
73
 
@@ -89,8 +87,8 @@ This plugin will look into the `byetypo_dictionary` file to find the closest mat
89
87
 
90
88
  ```ruby
91
89
  [1] pry(main)> User.joins(:group).where(groups: { name: "Landlord" })
92
- I, [2024-01-13T22:45:16.297811 #1079] INFO -- : `group` not working, running.
93
- I, [2024-01-13T22:45:16.297972 #1079] INFO -- : User.joins(:groups).where(groups: { name: "Landlord" })
90
+ I, [2024-01-13T22:45:16.297811 #1079] ERROR -- : ActiveRecord::ConfigurationError: Can't join 'User' to association named 'group'; perhaps you misspelled it?
91
+ I, [2024-01-13T22:45:16.297972 #1079] INFO -- : Running: User.joins(:groups).where(groups: { name: "Landlord" })
94
92
  2024-01-13 22:45:16.319544 D [1079:9200 log_subscriber.rb:130] ActiveRecord::Base -- User Load (1.6ms) SELECT "users".* FROM "users" INNER JOIN "user_groups" ON "user_groups"."user_id" = "users"."id" INNER JOIN "groups" ON "groups"."id" = "user_groups"."group_id" WHERE "users"."deleted_at" IS NULL AND "groups"."name" = $1 [["name", "Landlord"]]
95
93
  => []
96
94
  ```
@@ -109,8 +107,8 @@ This plugin will look into the `byetypo_dictionary` file to find the closest mat
109
107
 
110
108
  ```ruby
111
109
  1] pry(main)> User.joins(:groups).where(grous: { name: "Landlord" }).last
112
- I, [2024-01-14T23:50:49.273043 #1248] INFO -- : `grous` not working, running:
113
- I, [2024-01-14T23:50:49.273177 #1248] INFO -- : User.joins(:groups).where(groups: { name: "Landlord" }).last
110
+ I, [2024-01-14T23:50:49.273043 #1248] ERROR -- : ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: missing FROM-clause entry for table "grous"
111
+ I, [2024-01-14T23:50:49.273177 #1248] INFO -- : Running: User.joins(:groups).where(groups: { name: "Landlord" }).last
114
112
  2024-01-14 23:50:49.281956 D [1248:9200 log_subscriber.rb:130] ActiveRecord::Base -- User Load (2.1ms) SELECT "users".* FROM "users" INNER JOIN "user_groups" ON "user_groups"."user_id" = "users"."id" INNER JOIN "groups" ON "groups"."id" = "user_groups"."group_id" WHERE "users"."deleted_at" IS NULL AND "groups"."name" = $1 ORDER BY "users"."id" DESC LIMIT $2 [["name", "Landlord"], ["LIMIT", 1]]
115
113
  ```
116
114
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Pry
4
4
  module Byetypo
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-byetypo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - morissetcl