commit_ai 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddf3fb295ff77ec358d0e1ecc827c0d4f4b5ff1794d8f9dfd506f2f9935d3fba
4
- data.tar.gz: 46b05940dedf439c6dd42565da3532b6cdb440de9df2328246587cebcf871b49
3
+ metadata.gz: b2cbf31db80a94d89561081d2e035165821e0bfd7851f318c132900e9fcaad09
4
+ data.tar.gz: 571299591221bbf68455e1d5be5985797d6550d0aebfb0bdfc99427ebbeda914
5
5
  SHA512:
6
- metadata.gz: 0ce55a243201339017d080042090d43d42871a56d68cec162213c2bc3095123624760ac4c9842434e5145c1e843a73fb1b6a141fb247bb0285e54c2b17aa7789
7
- data.tar.gz: 5f34f7b5abdba14fc58af9e7040a8382136ae31a2078b142ecd03c063b3293459f4cc49ad1b02eeb48898ecaa77912480287564e00b31cc3717b4f90c97a3f23
6
+ metadata.gz: 0d56d24e2629d896a83fc637128c04dca3fd0044e1b84ac34a4edc28a1b230c90280530324f0c980cfbc54b8c080c2e980cb933eaa2dab32e4bc0cf10bb7f1e0
7
+ data.tar.gz: 5d778db83320f38a912a984325777e27bab837a94deb0595dfe2cf3ebd57a38342501002deef4743a9452fc05252947f2269692394bea211201d8748de85415d
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommitAi
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end
data/lib/commit_ai.rb CHANGED
@@ -18,7 +18,7 @@ class CommitAI
18
18
  parameters: {
19
19
  model: "gpt-3.5-turbo",
20
20
  messages: [
21
- { role: "system", content: "You are a Git commit message generator." },
21
+ { role: "system", content: "You are a git commit message generator for ruby on rails projects." },
22
22
  { role: "user", content: prompt }
23
23
  ],
24
24
  max_tokens: 50,
@@ -41,7 +41,7 @@ class CommitAI
41
41
  loop do
42
42
  commit_message = generate_commit_message(diff)
43
43
  puts "Generated Commit Message: #{commit_message}"
44
- print "Do you want to proceed with the commit? (y/n) or regenerate (r): "
44
+ print "Do you want to proceed with the commit? (y/n), regenerate (r), or edit (e): "
45
45
  response = STDIN.gets.chomp
46
46
  case response.downcase
47
47
  when 'y'
@@ -49,6 +49,9 @@ class CommitAI
49
49
  break
50
50
  when 'r'
51
51
  next
52
+ when 'e'
53
+ system("git commit -m '#{commit_message}' -e")
54
+ break
52
55
  else
53
56
  puts "Commit aborted."
54
57
  break
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commit_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Vitug
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-02 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-openai