autogitc 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/autogitc +6 -3
  3. data/lib/autogitc.rb +4 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee56f929703e3e7435708b3395a7a101f4917fda39ce54c6ae02cfe38be52c69
4
- data.tar.gz: bd3bb1332a6bc38406286c16e09a868e0dd8dea7dd41c186e1e172136213f217
3
+ metadata.gz: 99784fe2ee80335aad903a67b88543706b6c3674de445406a69f268fca38a543
4
+ data.tar.gz: 8c107ed10ed3c4d0f6776a0ae09d2c76c1d3b2e77dee7b144704a037e8413b3b
5
5
  SHA512:
6
- metadata.gz: d898b8672d412be18df0ec92ae7621c73662b62fabab19c27fc57eb2551f5cda2775c92ae4e3b74d59db6f9ac0fa7b38638842490fd2ed3c29e53892833d6a02
7
- data.tar.gz: 0e5012313cddfaa5bade79d059f05858e22ee3146032a67f0934db3dda634af04b9db36edf143a77e415cb5defb79be3ca64c5bf7cde6c4ef0b83c4fbe05d3d0
6
+ metadata.gz: 3bd91f4c26f17dd0bf5414f47eba23f85f89d948b52843e4aad2daaf4fb0f527a39cc2504f66582760d3b3b70413db48b20f89a18dd13c4afb91e07c0f197e1c
7
+ data.tar.gz: 71abbc7d1dd108dfe140c183a828a1683e850488012fbda1f7ac408110c6e55683d7d5c54df30096ce3015e7baf70743cf1fbbf942417497128ac2cb6c314a7e
data/bin/autogitc CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rake'
3
- load 'Rakefile'
2
+ require 'bundler/setup'
3
+ require_relative '../lib/autogitc'
4
4
 
5
- Rake::Task['autogitc:run'].invoke
5
+ no_commit = ARGV.include?('--nocommit') || ARGV.include?('--nc')
6
+
7
+ puts 'Running autogitc...'
8
+ Autogitc.main(no_commit: no_commit)
data/lib/autogitc.rb CHANGED
@@ -49,7 +49,7 @@ module Autogitc
49
49
  JSON.parse(output_text)['commit_message']
50
50
  end
51
51
 
52
- def self.main
52
+ def self.main(no_commit: false)
53
53
  if openai_api_key.nil?
54
54
  puts 'No AUTOGITC_KEY key found in environment variables.'
55
55
  return
@@ -68,8 +68,9 @@ module Autogitc
68
68
  end.join("\n")
69
69
 
70
70
  commit_message = generate_commit_message(changes_summary)
71
- puts "Generated commit message:\n#{commit_message}"
71
+ puts 'Generated commit message:'
72
+ puts commit_message
72
73
 
73
- `git commit -m "#{commit_message}"`
74
+ `git commit -m "#{commit_message}"` unless no_commit
74
75
  end
75
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autogitc
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
  - Adrian Goh