commit_ai 0.1.2 → 0.1.4

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: 66c07b08a2fc54c6d6bbc02b1b03b5f01e82916edb8a6378d38105f210ef0503
4
- data.tar.gz: 76cf220903f700836625dfe602a918a18ae12e54af8b49dc245f670b2a7371af
3
+ metadata.gz: 4c87ad68cc8d4e50fd42fe7103ccb29775b317ec8bcadd565ae0bfd782803047
4
+ data.tar.gz: 2aad903b0f30d5332854b909409b168f6c3b90223e9c51954e454f69864f9592
5
5
  SHA512:
6
- metadata.gz: 6098703d7a2d103557dc3672c5813b3669875a587cc01130c93f4253d8462d7020b8bcf82637a9c0dad50e7f2367f570b26d5c09b52936e433197c7bbffeb861
7
- data.tar.gz: 0d910361f0d9b204c5afdb7e348fa5fd73e30a50fa182b5cdb508bee6e194aa42b5428a1ebf2a5f7422226866c2582614123d9a9c7778556a42ab3953283fe63
6
+ metadata.gz: ae68dd9f2e8653787744212093d735099f8b02ed01850f15f76c01749d78bac7b9f9d662e011dd38ab1e732f4f335947edaa62c8f608cbbbbd8d23d5bdfdbf1b
7
+ data.tar.gz: e3ca4b11e589375783c2fc06d6b648d2db313dee57e08b525ca55ccb6e4efd44ca97e3fbbe8ee7ead8c6c526a8ff7f1597bea1233045444777f611a67b63bfa3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommitAi
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/commit_ai.rb CHANGED
@@ -48,7 +48,7 @@ class CommitAI
48
48
  parameters: {
49
49
  model: "gpt-3.5-turbo",
50
50
  messages: [
51
- { role: "system", content: "You are a helpful assistant." },
51
+ { role: "system", content: "You are a Git commit message generator." },
52
52
  { role: "user", content: prompt }
53
53
  ],
54
54
  max_tokens: 50,
@@ -63,6 +63,11 @@ class CommitAI
63
63
  system("git add --all")
64
64
  diff = `git diff --staged`
65
65
 
66
+ if diff.empty?
67
+ puts "No changes to commit."
68
+ return
69
+ end
70
+
66
71
  loop do
67
72
  commit_message = generate_commit_message(diff)
68
73
  puts "Generated Commit Message: #{commit_message}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commit_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Vitug