n2b 0.2.2 → 0.2.3
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/README.md +31 -31
- data/lib/n2b/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: 4d669156f98a861c284f95d3f56f9fdad92b5820d288e8f3227e885ed5d13b2a
|
4
|
+
data.tar.gz: e20b7578ff3ca46d9062137a930656e7598c4b613329da1984df09b80adffceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee2d6aaceaea02c667e03f5ff30e6f08c88e27cd9fa3b3fba97f9cd90b1410684d253bf729993a769ef1b3151839cde6f08f7fa99636001027c8e2cfc1713b59
|
7
|
+
data.tar.gz: f10b4515f9191e9f8adb4cacbc6096384f9b6be1697b94f2304130ede32a4360d81f90b9808c4462b8024aeff1982cd54842be64d22085938dbe7cd0b81bd5ab
|
data/README.md
CHANGED
@@ -13,22 +13,45 @@ N2B (Natural Language to Bash & Ruby) is a Ruby gem that leverages AI to convert
|
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
16
|
-
|
16
|
+
```bash
|
17
|
+
gem install n2b
|
18
|
+
```
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
### In IRB/Rails Console
|
23
|
+
|
24
|
+
First, require and extend the N2B module:
|
17
25
|
|
18
26
|
```ruby
|
19
|
-
|
27
|
+
require 'n2b'
|
28
|
+
extend N2B::IRB
|
20
29
|
```
|
21
30
|
|
22
|
-
|
31
|
+
For automatic loading in every IRB session, add these lines to your `~/.irbrc`:
|
23
32
|
|
24
|
-
```
|
25
|
-
|
33
|
+
```ruby
|
34
|
+
require 'n2b'
|
35
|
+
extend N2B::IRB
|
26
36
|
```
|
27
37
|
|
28
|
-
|
38
|
+
After loading, you can use the following commands:
|
29
39
|
|
30
|
-
|
31
|
-
|
40
|
+
- `n2r` - For general Ruby assistance
|
41
|
+
- `n2rrbit` - For Errbit error analysis
|
42
|
+
- `n2rscrum` - For generating Scrum tickets
|
43
|
+
|
44
|
+
### Examples
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# Get help with a Ruby question
|
48
|
+
n2r "How do I parse JSON in Ruby?"
|
49
|
+
|
50
|
+
# Analyze an Errbit error
|
51
|
+
n2rrbit(url: "your_errbit_url", cookie: "your_cookie")
|
52
|
+
|
53
|
+
# Generate a Scrum ticket
|
54
|
+
n2rscrum "Create a user authentication system"
|
32
55
|
```
|
33
56
|
|
34
57
|
## Configuration
|
@@ -45,29 +68,6 @@ openai:
|
|
45
68
|
model: gpt-4 # or gpt-3.5-turbo
|
46
69
|
```
|
47
70
|
|
48
|
-
## Usage
|
49
|
-
|
50
|
-
### Convert Natural Language to Bash
|
51
|
-
|
52
|
-
```ruby
|
53
|
-
require 'n2b'
|
54
|
-
|
55
|
-
# Convert a natural language instruction to a bash command
|
56
|
-
N2B::Base.new.n2b("list all jpg files in the current directory")
|
57
|
-
# => find . -name "*.jpg"
|
58
|
-
```
|
59
|
-
|
60
|
-
### Generate Ruby Code
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
require 'n2b'
|
64
|
-
|
65
|
-
# In an IRB console
|
66
|
-
n2r("create a function that calculates fibonacci numbers")
|
67
|
-
```
|
68
|
-
|
69
|
-
This will output both the code and an explanation:
|
70
|
-
|
71
71
|
## Quick Example N2B
|
72
72
|
|
73
73
|
```
|
data/lib/n2b/version.rb
CHANGED