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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -13
- data/lib/pry-byetypo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7faf45157b7a6b110d22c13122b713a51f25b9e9c31d928f4d5511a2e9ffbcb3
|
4
|
+
data.tar.gz: 4f462974bcc85139f06652b8d7ca28374fea6fbff9096388054197917f4bb104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2156f5efe4854c4ac4298a314eb48006d629f289a59e6d58d4078c0373f8e4db776d93b3247fd61fba01536e9109b26ad3881ec46f1bca6f09c4c8c5194ea1c7
|
7
|
+
data.tar.gz: 44b4e2b0c73133bead16a8ed5f7660de909862fe3b2b7b156bcc0f4eb9ca4d7054e8eac6360766851dbe0cfa4ee74d25c5b065169509979ff36a3ebe14cefa21
|
data/Gemfile.lock
CHANGED
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]
|
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]
|
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]
|
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]
|
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
|
|
data/lib/pry-byetypo/version.rb
CHANGED