ai_rspec_writer 1.0.1 → 1.0.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/bin/ai_rspec_writer +20 -3
- data/lib/ai_rspec_writer/version.rb +1 -1
- data/lib/ai_rspec_writer.rb +0 -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: 8cab7d33dc90e1d76f58ff76e9e50f3ac0072da39682d0a228bcd67f857cbd8f
|
4
|
+
data.tar.gz: 97ddd1ed5c8b9d08a623e998de46878465140c3207716e3a8706372bfa96a137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a52c415aa176cb5e1a4b051c5d43909fedfc4f13ca2a49543569c6d7356fb9280290075d8ad6d60454e2432f8d85b2ed075f4b9d6639f4d01de627e4a7842995
|
7
|
+
data.tar.gz: 2c9bafd8a862022494ee494c7cf5d7f379fd95a5ca49dedf4851ba205b76e97adb50d1f57002244fd7d1b0747ce579137da9bf25351ad2a02d5c0929f12adbb6
|
data/bin/ai_rspec_writer
CHANGED
@@ -8,14 +8,14 @@ require_relative "../lib/ai_rspec_writer/schema_extractor"
|
|
8
8
|
|
9
9
|
if AiRspecWriter.configuration.chatgpt_api_key.nil? || AiRspecWriter.configuration.gemini_api_key.nil?
|
10
10
|
puts "❌ ChatGPT API key is missing.".red
|
11
|
-
puts "ℹ️ Set it in `.env`, or use `export CHATGPT_API_KEY=your-key`.".yellow
|
11
|
+
puts "ℹ️ Set it in `.env`, or use `export CHATGPT_API_KEY=your-key` `export GEMINI_API_KEY=your-key`.".yellow
|
12
12
|
exit 1
|
13
13
|
end
|
14
14
|
|
15
15
|
|
16
16
|
options = {}
|
17
17
|
|
18
|
-
OptionParser.new do |opts|
|
18
|
+
parser = OptionParser.new do |opts|
|
19
19
|
opts.banner = "Usage: ai_rspec_writer [options]"
|
20
20
|
|
21
21
|
opts.on("-f FILES", "--files=FILES", "Specify the files to generate tests for (comma-separated)(eg main_file,secondary_file,....)") do |files|
|
@@ -33,7 +33,24 @@ OptionParser.new do |opts|
|
|
33
33
|
opts.on("-e COMMENT", "--ec=COMMENT", "Add Extra Comment at the time of generating test") do |comment|
|
34
34
|
options[:extra_comment] = comment
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
37
|
+
|
38
|
+
begin
|
39
|
+
parser.parse!
|
40
|
+
if options[:files].nil?
|
41
|
+
puts "❌ Error: '-f' (files) option is required. Use -f <file1,file2> to specify files.".red
|
42
|
+
exit 1
|
43
|
+
end
|
44
|
+
rescue OptionParser::MissingArgument => e
|
45
|
+
puts "❌ Error: #{e.message}".red
|
46
|
+
puts parser
|
47
|
+
exit 1
|
48
|
+
rescue OptionParser::InvalidOption => e
|
49
|
+
puts "❌ Error: Invalid option #{e.message}".red
|
50
|
+
puts parser
|
51
|
+
exit 1
|
52
|
+
end
|
53
|
+
|
37
54
|
|
38
55
|
if options[:files]
|
39
56
|
|
data/lib/ai_rspec_writer.rb
CHANGED
@@ -2,7 +2,6 @@ require_relative "ai_rspec_writer/configuration"
|
|
2
2
|
require_relative "ai_rspec_writer/version"
|
3
3
|
require_relative "ai_rspec_writer/generator"
|
4
4
|
require_relative "ai_rspec_writer/spec_file_handler"
|
5
|
-
require_relative "ai_rspec_writer/constants"
|
6
5
|
require "colorize"
|
7
6
|
|
8
7
|
module AiRspecWriter
|