Skip to content

Commit 8b809cb

Browse files
authored
Merge pull request #423 from ignacio-chiazzo/rakefile-setup
Add rake tests and linter tasks
2 parents 866c72e + 8b0af27 commit 8b809cb

File tree

2 files changed

+61
-44
lines changed

2 files changed

+61
-44
lines changed

README.md

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,47 +12,50 @@ Stream text with GPT-4, transcribe and translate audio with Whisper, or create i
1212

1313
# Table of Contents
1414

15-
- [Installation](#installation)
16-
- [Bundler](#bundler)
17-
- [Gem Install](#gem-install)
18-
- [Usage](#usage)
19-
- [Quickstart](#quickstart)
20-
- [With Config](#with-config)
21-
- [Custom timeout or base URI](#custom-timeout-or-base-uri)
22-
- [Extra Headers per Client](#extra-headers-per-client)
23-
- [Verbose Logging](#verbose-logging)
24-
- [Azure](#azure)
25-
- [Counting Tokens](#counting-tokens)
26-
- [Models](#models)
27-
- [Chat](#chat)
28-
- [Streaming Chat](#streaming-chat)
29-
- [Vision](#vision)
30-
- [JSON Mode](#json-mode)
31-
- [Functions](#functions)
32-
- [Edits](#edits)
33-
- [Embeddings](#embeddings)
34-
- [Files](#files)
35-
- [Finetunes](#finetunes)
36-
- [Assistants](#assistants)
37-
- [Threads and Messages](#threads-and-messages)
38-
- [Runs](#runs)
39-
- [Runs involving function tools](#runs-involving-function-tools)
40-
- [Image Generation](#image-generation)
41-
- [DALL·E 2](#dalle-2)
42-
- [DALL·E 3](#dalle-3)
43-
- [Image Edit](#image-edit)
44-
- [Image Variations](#image-variations)
45-
- [Moderations](#moderations)
46-
- [Whisper](#whisper)
47-
- [Translate](#translate)
48-
- [Transcribe](#transcribe)
49-
- [Speech](#speech)
50-
- [Errors](#errors)
51-
- [Development](#development)
52-
- [Release](#release)
53-
- [Contributing](#contributing)
54-
- [License](#license)
55-
- [Code of Conduct](#code-of-conduct)
15+
- [Ruby OpenAI](#ruby-openai)
16+
- [Table of Contents](#table-of-contents)
17+
- [Installation](#installation)
18+
- [Bundler](#bundler)
19+
- [Gem install](#gem-install)
20+
- [Usage](#usage)
21+
- [Quickstart](#quickstart)
22+
- [With Config](#with-config)
23+
- [Custom timeout or base URI](#custom-timeout-or-base-uri)
24+
- [Extra Headers per Client](#extra-headers-per-client)
25+
- [Verbose Logging](#verbose-logging)
26+
- [Azure](#azure)
27+
- [Counting Tokens](#counting-tokens)
28+
- [Models](#models)
29+
- [Examples](#examples)
30+
- [Chat](#chat)
31+
- [Streaming Chat](#streaming-chat)
32+
- [Vision](#vision)
33+
- [JSON Mode](#json-mode)
34+
- [Functions](#functions)
35+
- [Edits](#edits)
36+
- [Embeddings](#embeddings)
37+
- [Files](#files)
38+
- [Finetunes](#finetunes)
39+
- [Assistants](#assistants)
40+
- [Threads and Messages](#threads-and-messages)
41+
- [Runs](#runs)
42+
- [Runs involving function tools](#runs-involving-function-tools)
43+
- [Image Generation](#image-generation)
44+
- [DALL·E 2](#dalle-2)
45+
- [DALL·E 3](#dalle-3)
46+
- [Image Edit](#image-edit)
47+
- [Image Variations](#image-variations)
48+
- [Moderations](#moderations)
49+
- [Whisper](#whisper)
50+
- [Translate](#translate)
51+
- [Transcribe](#transcribe)
52+
- [Speech](#speech)
53+
- [Errors](#errors)
54+
- [Development](#development)
55+
- [Release](#release)
56+
- [Contributing](#contributing)
57+
- [License](#license)
58+
- [Code of Conduct](#code-of-conduct)
5659

5760
## Installation
5861

@@ -839,9 +842,10 @@ After checking out the repo, run `bin/setup` to install dependencies. You can ru
839842

840843
To install this gem onto your local machine, run `bundle exec rake install`.
841844

842-
### Warning
845+
To run all tests, execute the command `bundle exec rake`, which will also run the linter (Rubocop). This repository uses [VCR](https://github.com/vcr/vcr) to log API requests.
843846

844-
If you have an `OPENAI_ACCESS_TOKEN` in your `ENV`, running the specs will use this to run the specs against the actual API, which will be slow and cost you money - 2 cents or more! Remove it from your environment with `unset` or similar if you just want to run the specs against the stored VCR responses.
847+
> [!WARNING]
848+
> If you have an `OPENAI_ACCESS_TOKEN` in your `ENV`, running the specs will use this to run the specs against the actual API, which will be slow and cost you money - 2 cents or more! Remove it from your environment with `unset` or similar if you just want to run the specs against the stored VCR responses.
845849
846850
## Release
847851

Rakefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
require "bundler/gem_tasks"
22
require "rspec/core/rake_task"
3+
require "rubocop/rake_task"
34

45
RSpec::Core::RakeTask.new(:spec)
56

6-
task default: :spec
7+
task :default do
8+
Rake::Task["test"].invoke
9+
Rake::Task["lint"].invoke
10+
end
11+
12+
task :test do
13+
Rake::Task["spec"].invoke
14+
end
15+
16+
task :lint do
17+
RuboCop::RakeTask.new(:rubocop)
18+
Rake::Task["rubocop"].invoke
19+
end

0 commit comments

Comments
 (0)