repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
deivid-rodriguez/byebug
https://github.com/deivid-rodriguez/byebug/blob/994848cd3b20ff6218d73f790ab7afbaed92358e/lib/byebug/processors/post_mortem_processor.rb
lib/byebug/processors/post_mortem_processor.rb
# frozen_string_literal: true require_relative "command_processor" module Byebug # # Processes commands in post_mortem mode # class PostMortemProcessor < CommandProcessor def commands super.select(&:allow_in_post_mortem) end def prompt "(byebug:post_mortem) " end end end
ruby
BSD-2-Clause
994848cd3b20ff6218d73f790ab7afbaed92358e
2026-01-04T15:50:47.976763Z
false
deivid-rodriguez/byebug
https://github.com/deivid-rodriguez/byebug/blob/994848cd3b20ff6218d73f790ab7afbaed92358e/lib/byebug/processors/control_processor.rb
lib/byebug/processors/control_processor.rb
# frozen_string_literal: true require_relative "command_processor" module Byebug # # Processes commands when there's not program running # class ControlProcessor < CommandProcessor # # Available commands # def commands super.select(&:allow_in_control) end # # Prompt shown be...
ruby
BSD-2-Clause
994848cd3b20ff6218d73f790ab7afbaed92358e
2026-01-04T15:50:47.976763Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai_spec.rb
spec/openai_spec.rb
RSpec.describe OpenAI do it "has a version number" do expect(OpenAI::VERSION).not_to be nil end describe "#configure" do let(:access_token) { "abc123" } let(:api_version) { "v2" } let(:organization_id) { "def456" } let(:custom_uri_base) { "ghi789" } let(:custom_request_timeout) { 25 } ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/spec_helper.rb
spec/spec_helper.rb
require "bundler/setup" require "dotenv/load" require "openai" require "vcr" require "byebug" Dir[File.expand_path("spec/support/**/*.rb")].sort.each { |f| require f } tokens_present = ENV.fetch("OPENAI_ACCESS_TOKEN", nil) && ENV.fetch("OPENAI_ADMIN_TOKEN", nil) VCR.configure do |c| c.hook_into :webmock c.casset...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/support/vcr_multipart_matcher.rb
spec/support/vcr_multipart_matcher.rb
class VCRMultipartMatcher MULTIPART_HEADER_MATCHER = %r{^multipart/form-data; boundary=(.+)$}.freeze BOUNDARY_SUBSTITUTION = "----MultipartBoundaryAbcD3fGhiXyz00001".freeze def call(request1, request2) return false unless same_content_type?(request1, request2) unless headers_excluding_content_type(reques...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/embeddings_spec.rb
spec/openai/client/embeddings_spec.rb
RSpec.describe OpenAI::Client do describe "#embeddings", :vcr do let(:input) { "The food was delicious and the waiter..." } let(:cassette) { "#{model} embeddings #{input}".downcase } let(:response) do OpenAI::Client.new.embeddings( parameters: { model: model, input: input...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/moderations_spec.rb
spec/openai/client/moderations_spec.rb
RSpec.describe OpenAI::Client do describe "#moderations", :vcr do let(:input) { "Have a great day!" } let(:cassette) { "moderations #{input}".downcase } let(:response) do OpenAI::Client.new.moderations( parameters: { input: input } ) end it "succeeds" do ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/audio_spec.rb
spec/openai/client/audio_spec.rb
RSpec.describe OpenAI::Client do describe "#audio" do describe "#transcribe" do context "with audio", :vcr do let(:filename) { "audio_sample.mp3" } let(:audio) { File.join(RSPEC_ROOT, "fixtures/files", filename) } let(:response) do OpenAI::Client.new.audio.transcribe( ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/completions_spec.rb
spec/openai/client/completions_spec.rb
RSpec.describe OpenAI::Client do describe "#completions: gpt-3.5-turbo-instruct" do context "with a prompt and max_tokens", :vcr do let(:prompt) { "Once upon a time" } let(:max_tokens) { 5 } let(:response) do OpenAI::Client.new.completions( parameters: { model: mod...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/finetunes_spec.rb
spec/openai/client/finetunes_spec.rb
RSpec.describe OpenAI::Client do describe "#finetunes", :vcr do let(:model) { "gpt-4o-2024-08-06" } describe "#list" do let(:cassette) { "finetunes list" } let(:response) { OpenAI::Client.new.finetunes.list } it "succeeds" do VCR.use_cassette(cassette) do expect(response....
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/models_spec.rb
spec/openai/client/models_spec.rb
RSpec.describe OpenAI::Client do describe "#models" do describe "#list", :vcr do let(:response) { OpenAI::Client.new.models.list } let(:cassette) { "models list" } it "succeeds" do VCR.use_cassette(cassette) do expect(response.dig("data", 0, "object")).to eq("model") e...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/realtime_spec.rb
spec/openai/client/realtime_spec.rb
RSpec.describe OpenAI::Realtime do let(:client) { OpenAI::Client.new } let(:realtime) { client.realtime } describe "#create" do it "uses the specified model" do model = "gpt-4o-realtime-preview-2024-12-18" VCR.use_cassette("realtime_session_create") do response = realtime.create(parameter...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/client_spec.rb
spec/openai/client/client_spec.rb
RSpec.describe OpenAI::Client do context "with clients with different access tokens" do before do OpenAI.configure do |config| config.organization_id = "organization_id0" config.extra_headers = { "test" => "X-Default" } end end after do # Necessary otherwise the dummy or...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/runs_spec.rb
spec/openai/client/runs_spec.rb
RSpec.describe OpenAI::Client do let(:max_prompt_tokens) { 256 } let(:max_completion_tokens) { 16 } describe "#runs" do let(:thread_id) do VCR.use_cassette("#{cassette} thread setup") do OpenAI::Client.new.threads.create(parameters: {})["id"] end end let(:assistant_id) do VC...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/batches_spec.rb
spec/openai/client/batches_spec.rb
RSpec.describe OpenAI::Client do describe "#batches" do let(:filename) { "batch.jsonl" } let(:file) { File.join(RSPEC_ROOT, "fixtures/files", filename) } let(:upload_purpose) { "batch" } let(:input_file) do VCR.use_cassette(input_cassette) do OpenAI::Client.new.files.upload(parameters: {...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/run_steps_spec.rb
spec/openai/client/run_steps_spec.rb
RSpec.describe OpenAI::Client do describe "#run_steps" do let(:thread_id) do VCR.use_cassette("#{cassette} thread setup") do OpenAI::Client.new.threads.create(parameters: {})["id"] end end let(:assistant_id) do VCR.use_cassette("#{cassette} assistant setup") do OpenAI::Cl...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/threads_spec.rb
spec/openai/client/threads_spec.rb
RSpec.describe OpenAI::Client do describe "#threads" do let(:thread_id) do VCR.use_cassette("#{cassette} setup") do OpenAI::Client.new.threads.create(parameters: {})["id"] end end describe "#retrieve" do let(:cassette) { "threads retrieve" } let(:response) { OpenAI::Client...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/files_spec.rb
spec/openai/client/files_spec.rb
RSpec.describe OpenAI::Client do describe "#files", :vcr do let(:filename) { "sentiment.jsonl" } let(:file) { File.join(RSPEC_ROOT, "fixtures/files", filename) } let(:upload_purpose) { "fine-tune" } let(:upload) do VCR.use_cassette(upload_cassette) do OpenAI::Client.new.files.upload(para...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/responses_spec.rb
spec/openai/client/responses_spec.rb
RSpec.describe OpenAI::Client do describe "#responses" do describe "#create", :vcr do let(:model) { "gpt-4o" } let(:input) { "Hello!" } let(:stream) { false } let(:uri_base) { nil } let(:parameters) { { model: model, input: input, stream: stream } } let(:response) do Op...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/chat_spec.rb
spec/openai/client/chat_spec.rb
RSpec.describe OpenAI::Client do describe "#chat" do context "with messages", :vcr do let(:messages) { [{ role: "user", content: "Hello!" }] } let(:stream) { false } let(:uri_base) { nil } let(:response) do OpenAI::Client.new({ uri_base: uri_base }).chat( parameters: para...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/vector_store_file_batches_spec.rb
spec/openai/client/vector_store_file_batches_spec.rb
RSpec.describe OpenAI::Client do describe "#vector_store_file_batches" do let(:vector_store_id) do VCR.use_cassette("#{cassette} vector_store setup") do OpenAI::Client.new.vector_stores.create(parameters: {})["id"] end end let(:filename) { "text.txt" } let(:file) { File.join(RSPEC...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/stream_spec.rb
spec/openai/client/stream_spec.rb
RSpec.describe OpenAI::Stream do let(:user_proc) { proc { |data, event| [data, event] } } let(:stream) { OpenAI::Stream.new(user_proc: user_proc) } let(:bytes) { 0 } let(:env) { Faraday::Env.new.tap { |env| env.status = 200 } } describe "#call" do context "with a proc" do context "when called with ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/http_spec.rb
spec/openai/client/http_spec.rb
RSpec.describe OpenAI::HTTP do describe "with an aggressive timeout" do let(:timeout_errors) { [Faraday::ConnectionFailed, Faraday::TimeoutError] } let(:timeout) { 0 } # We disable VCR and WebMock for timeout specs, otherwise VCR will return instant # responses when using the recorded responses and t...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/conversations_spec.rb
spec/openai/client/conversations_spec.rb
RSpec.describe OpenAI::Client do describe "#conversations" do let(:conversation_id) do VCR.use_cassette("#{cassette} setup") do OpenAI::Client.new.conversations.create(parameters: {})["id"] end end let(:item_id) do VCR.use_cassette("#{cassette} item setup") do OpenAI::Cli...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/vector_store_files_spec.rb
spec/openai/client/vector_store_files_spec.rb
RSpec.describe OpenAI::Client do describe "#vector_store_files" do let(:vector_store_id) do VCR.use_cassette("#{cassette} vector_store setup") do OpenAI::Client.new.vector_stores.create(parameters: {})["id"] end end let(:filename) { "text.txt" } let(:file) { File.join(RSPEC_ROOT, ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/usage_spec.rb
spec/openai/client/usage_spec.rb
RSpec.describe OpenAI::Client do describe "#usage" do let(:some_time_ago) { 1_739_096_063 } let(:client) { OpenAI::Client.new } shared_examples "usage endpoint" do |endpoint_name| describe "##{endpoint_name}" do let(:response) do client.usage.public_send(endpoint_name, parameters:...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/images_spec.rb
spec/openai/client/images_spec.rb
RSpec.describe OpenAI::Client do describe "#images" do describe "#dall-e-2" do describe "#generate", :vcr do let(:response) do OpenAI::Client.new.images.generate( parameters: { prompt: prompt, size: size, model: model } ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/messages_spec.rb
spec/openai/client/messages_spec.rb
RSpec.describe OpenAI::Client do describe "#messages" do let(:thread_id) do VCR.use_cassette("#{cassette} thread setup") do OpenAI::Client.new.threads.create(parameters: {})["id"] end end let(:message_id) do VCR.use_cassette("#{cassette} message setup") do OpenAI::Client....
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/vector_stores_spec.rb
spec/openai/client/vector_stores_spec.rb
RSpec.describe OpenAI::Client do describe "#vector_stores" do let(:vector_store_id) do VCR.use_cassette("#{cassette} setup") do OpenAI::Client.new.vector_stores.create(parameters: {})["id"] end end describe "#list" do let(:cassette) { "vector_stores list" } let(:response) ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/spec/openai/client/assistants_spec.rb
spec/openai/client/assistants_spec.rb
RSpec.describe OpenAI::Client do describe "#assistants" do let(:assistant_id) do VCR.use_cassette("#{cassette} setup") do OpenAI::Client.new.assistants.create( parameters: { model: "gpt-4", name: "OpenAI-Ruby test assistant" } )["id"] end ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai.rb
lib/openai.rb
require "faraday" require "faraday/multipart" if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new("2.0") require_relative "openai/http" require_relative "openai/client" require_relative "openai/files" require_relative "openai/finetunes" require_relative "openai/images" require_relative "openai/models" require_rel...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/vector_store_files.rb
lib/openai/vector_store_files.rb
module OpenAI class VectorStoreFiles def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list(vector_store_id:, parameters: {}) @client.get(path: "/vector_stores/#{vector_store_id}/files", parameters: parameters) end def retrieve(vector...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/http_headers.rb
lib/openai/http_headers.rb
module OpenAI module HTTPHeaders def add_headers(headers) @extra_headers = extra_headers.merge(headers.transform_keys(&:to_s)) end private def headers if azure? azure_headers else openai_headers end.merge(extra_headers) end def openai_headers { ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/runs.rb
lib/openai/runs.rb
module OpenAI class Runs def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list(thread_id:, parameters: {}) @client.get(path: "/threads/#{thread_id}/runs", parameters: parameters) end def retrieve(thread_id:, id:) @client.get(pa...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/files.rb
lib/openai/files.rb
module OpenAI class Files PURPOSES = %w[ assistants batch fine-tune vision user_data evals ].freeze def initialize(client:) @client = client end def list(parameters: {}) @client.get(path: "/files", parameters: parameters) end def upload(pa...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/version.rb
lib/openai/version.rb
module OpenAI VERSION = "8.3.0".freeze end
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/usage.rb
lib/openai/usage.rb
module OpenAI class Usage def initialize(client:) @client = client end def completions(parameters: {}) @client.admin.get( path: "/organization/usage/completions", parameters: parameters ) end def embeddings(parameters: {}) @client.admin.get( path: ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/batches.rb
lib/openai/batches.rb
module OpenAI class Batches def initialize(client:) @client = client end def list(parameters: {}) @client.get(path: "/batches", parameters: parameters) end def retrieve(id:) @client.get(path: "/batches/#{id}") end def create(parameters: {}) @client.json_post(path...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/responses.rb
lib/openai/responses.rb
module OpenAI class Responses def initialize(client:) @client = client end def create(parameters: {}) @client.json_post(path: "/responses", parameters: parameters) end def retrieve(response_id:) @client.get(path: "/responses/#{response_id}") end def delete(response_id:...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/assistants.rb
lib/openai/assistants.rb
module OpenAI class Assistants BETA_VERSION = "v2".freeze def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list @client.get(path: "/assistants") end def retrieve(id:) @client.get(path: "/assistants/#{id}") end def...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/stream.rb
lib/openai/stream.rb
module OpenAI class Stream DONE = "[DONE]".freeze private_constant :DONE def initialize(user_proc:, parser: EventStreamParser::Parser.new) @user_proc = user_proc @parser = parser # To be backwards compatible, we need to check how many arguments the user_proc takes. @user_proc_ari...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/run_steps.rb
lib/openai/run_steps.rb
module OpenAI class RunSteps def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list(thread_id:, run_id:, parameters: {}) @client.get(path: "/threads/#{thread_id}/runs/#{run_id}/steps", parameters: parameters) end def retrieve(thread_i...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/models.rb
lib/openai/models.rb
module OpenAI class Models def initialize(client:) @client = client end def list @client.get(path: "/models") end def retrieve(id:) @client.get(path: "/models/#{id}") end def delete(id:) @client.delete(path: "/models/#{id}") end end end
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/http.rb
lib/openai/http.rb
require "event_stream_parser" require_relative "http_headers" module OpenAI module HTTP include HTTPHeaders def get(path:, parameters: nil) parse_json(conn.get(uri(path: path), parameters) do |req| req.headers = headers end&.body) end def post(path:) parse_json(conn.post(...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/threads.rb
lib/openai/threads.rb
module OpenAI class Threads def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def retrieve(id:) @client.get(path: "/threads/#{id}") end def create(parameters: {}) @client.json_post(path: "/threads", parameters: parameters) end ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/messages.rb
lib/openai/messages.rb
module OpenAI class Messages def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list(thread_id:, parameters: {}) @client.get(path: "/threads/#{thread_id}/messages", parameters: parameters) end def retrieve(thread_id:, id:) @clien...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/vector_store_file_batches.rb
lib/openai/vector_store_file_batches.rb
module OpenAI class VectorStoreFileBatches def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list(vector_store_id:, id:, parameters: {}) @client.get( path: "/vector_stores/#{vector_store_id}/file_batches/#{id}/files", parameter...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/client.rb
lib/openai/client.rb
# rubocop:disable Metrics/ClassLength module OpenAI class Client include OpenAI::HTTP SENSITIVE_ATTRIBUTES = %i[@access_token @admin_token @organization_id @extra_headers].freeze CONFIG_KEYS = %i[access_token admin_token api_type api_version extra_headers log_errors organization_id r...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/conversations.rb
lib/openai/conversations.rb
module OpenAI class Conversations def initialize(client:) @client = client end def retrieve(id:) @client.get(path: "/conversations/#{id}") end def create(parameters: {}) @client.json_post(path: "/conversations", parameters: parameters) end def modify(id:, parameters: {...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/audio.rb
lib/openai/audio.rb
module OpenAI class Audio def initialize(client:) @client = client end def transcribe(parameters: {}) @client.multipart_post(path: "/audio/transcriptions", parameters: parameters) end def translate(parameters: {}) @client.multipart_post(path: "/audio/translations", parameters: ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/vector_stores.rb
lib/openai/vector_stores.rb
module OpenAI class VectorStores def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end def list(parameters: {}) @client.get(path: "/vector_stores", parameters: parameters) end def retrieve(id:) @client.get(path: "/vector_stores/#{id}") ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/images.rb
lib/openai/images.rb
module OpenAI class Images def initialize(client: nil) @client = client end def generate(parameters: {}) @client.json_post(path: "/images/generations", parameters: parameters) end def edit(parameters: {}) @client.multipart_post(path: "/images/edits", parameters: open_files(para...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/finetunes.rb
lib/openai/finetunes.rb
module OpenAI class Finetunes def initialize(client:) @client = client end def list @client.get(path: "/fine_tuning/jobs") end def create(parameters: {}) @client.json_post(path: "/fine_tuning/jobs", parameters: parameters) end def retrieve(id:) @client.get(path: ...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/openai/realtime.rb
lib/openai/realtime.rb
module OpenAI class Realtime def initialize(client:) @client = client.beta(realtime: "v1") end # Create a new real-time session with OpenAI. # # This method sets up a new session for real-time voice interaction with an OpenAI model. # It returns session details that can be used to estab...
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
alexrudall/ruby-openai
https://github.com/alexrudall/ruby-openai/blob/6c834c21c31c31a1191d6776cb1cdff6068cb3b1/lib/ruby/openai.rb
lib/ruby/openai.rb
require_relative "../openai"
ruby
MIT
6c834c21c31c31a1191d6776cb1cdff6068cb3b1
2026-01-04T15:51:24.641902Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/tasks/query_tasks.rb
app/volt/tasks/query_tasks.rb
class QueryTasks < Volt::Task def add_listener(collection, query) live_query = @volt_app.live_query_pool.lookup(collection, query) track_channel_in_live_query(live_query) if @channel # For requests from the client (with @channel), we track the channel # so we can send the results back. Serve...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/tasks/store_tasks.rb
app/volt/tasks/store_tasks.rb
require 'volt/models' class StoreTasks < Volt::Task def db @@db ||= Volt::DataStore.fetch end def load_model(collection, path, data) model_name = collection.singularize.camelize # Fetch the model collection = store.get(path[-2]) # See if the model has already been made model_promise = ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/tasks/user_tasks.rb
app/volt/tasks/user_tasks.rb
class UserTasks < Volt::Task # Login a user, takes a login and password. Login can be either a username # or an e-mail based on Volt.config.public.auth.use_username # # login_info is a key with login and password (login may be e-mail) def login(login_info) login = login_info['login'] password = login...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/tasks/live_query/live_query.rb
app/volt/tasks/live_query/live_query.rb
require_relative 'query_tracker' # Tracks a channel and a query on a collection. Alerts # the listener when the data in the query changes. class LiveQuery attr_reader :current_ids, :collection, :query def initialize(pool, data_store, collection, query) @pool = pool @collection = collection @query = q...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/tasks/live_query/query_tracker.rb
app/volt/tasks/live_query/query_tracker.rb
# The query tracker runs queries and then tracks the changes # that take place. class QueryTracker attr_accessor :results def initialize(live_query, data_store) @live_query = live_query @data_store = data_store # Stores the list of id's currently associated with this query @current_ids = [] @r...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/tasks/live_query/live_query_pool.rb
app/volt/tasks/live_query/live_query_pool.rb
require_relative 'live_query' require 'volt/utils/generic_pool' # LiveQueryPool runs on the server and keeps track of all outstanding # queries. class LiveQueryPool < Volt::GenericPool def initialize(data_store, volt_app) @data_store = data_store @volt_app = volt_app super() end def lookup(collecti...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/controllers/notices_controller.rb
app/volt/controllers/notices_controller.rb
module Volt class NoticesController < ModelController model :page def hey 'yep' end def map_key_class(key) case key when 'errors' 'danger' when 'warnings' 'warning' when 'successes' 'success' else # notices 'info' end ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/models/volt_app_property.rb
app/volt/models/volt_app_property.rb
# VoltAppProperty backs the volt_app.properties hash. properties is designed # to allow things like gems that have external setup processes (creating an # S3 bucket for example) to keep track of if that action has been completed on # a global level. class VoltAppProperty < Volt::Model field :name, String field :va...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/models/active_volt_instance.rb
app/volt/models/active_volt_instance.rb
class ActiveVoltInstance < Volt::Model field :server_id, String field :ips, String field :port, Fixnum field :time#, Time end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/models/user.rb
app/volt/models/user.rb
require 'bcrypt' unless RUBY_PLATFORM == 'opal' module Volt class User < Model field :password # returns login field name depending on config settings def self.login_field if Volt.config.try(:public).try(:auth).try(:use_username) :username else :email end end p...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/app/volt/config/dependencies.rb
app/volt/config/dependencies.rb
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/spec_helper.rb
spec/spec_helper.rb
require 'volt/spec/setup' unless RUBY_PLATFORM == 'opal' begin require 'rack/test' require 'pry-byebug' rescue LoadError => e # Ignore if not installed end require 'coveralls' Coveralls.wear! SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/tasks/user_tasks_spec.rb
spec/tasks/user_tasks_spec.rb
require 'spec_helper' if RUBY_PLATFORM != 'opal' describe UserTasks do let(:user_promise) { double('UserPromise', then: true) } let(:fake_response) { double('FakeResponse', first: user_promise) } let(:fake_users_collection) do double('FakeUsersCollection', where: fake_response) end let(:f...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/tasks/dispatcher_spec.rb
spec/tasks/dispatcher_spec.rb
require 'spec_helper' if RUBY_PLATFORM != 'opal' class TestTask < Volt::Task def allowed_method(arg1, arg2) 'yes' + arg1 + arg2 end def set_cookie cookies._something = 'awesome' end end class WorkerPoolStub def post(*args) yield(*args) end end describe Volt::Dispa...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/tasks/live_query_spec.rb
spec/tasks/live_query_spec.rb
if RUBY_PLATFORM != 'opal' describe 'LiveQuery' do before do load File.join(File.dirname(__FILE__), '../../app/volt/tasks/live_query/live_query.rb') end it 'should run a query' do pool = double('volt/pool') data_store = double('volt/data store') expect(data_store).to receive(:que...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/tasks/query_tasks.rb
spec/tasks/query_tasks.rb
if RUBY_PLATFORM != 'opal' describe 'Volt::QueryTasks' do before do load File.join(File.dirname(__FILE__), '../../app/volt/tasks/query_tasks.rb') end end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/tasks/query_tracker_spec.rb
spec/tasks/query_tracker_spec.rb
if RUBY_PLATFORM != 'opal' describe 'LiveQuery' do before do load File.join(File.dirname(__FILE__), '../../app/volt/tasks/live_query/live_query.rb') end # LiveQueryStub behaves as the front-end would with the changes to a # live query. Instead of passing changes to the models to the front ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/http_endpoints_spec.rb
spec/integration/http_endpoints_spec.rb
require 'spec_helper' describe 'http endpoints', type: :feature, sauce: true do it 'should show the page' do visit '/simple_http' expect(page).to have_content('this is just some text') end it 'should have access to the store' do store._simple_http_tests << { name: 'hello' } visit '/simple_http/s...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/flash_spec.rb
spec/integration/flash_spec.rb
# This spec fails on sauce randomly, disable for now if ENV['BROWSER'] && ENV['BROWSER'] != 'sauce' require 'spec_helper' describe 'flash messages', type: :feature, sauce: true do it 'should flash on sucesses, notices, warnings, and errors' do visit '/' click_link 'Flash' click_link 'Flash ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/callbacks_spec.rb
spec/integration/callbacks_spec.rb
require 'spec_helper' describe 'lifecycle callbacks', type: :feature, sauce: true do context 'with a user' do before do # Add the user store._users! << { email: 'test@test.com', password: 'awes0mesEcRet', name: 'Test Account 9550' } end it 'should trigger a user_connect event when a user lo...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/yield_spec.rb
spec/integration/yield_spec.rb
require 'spec_helper' describe 'yield binding', type: :feature, sauce: true do before do visit '/yield' end it 'should render the yielded content multiple times' do expect(page).to have_content('My yielded content 1') expect(page).to have_content('My yielded content 2') end it 'should render th...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/save_spec.rb
spec/integration/save_spec.rb
require 'spec_helper' describe 'saving', type: :feature, sauce: true do it 'should return an error as an instance of Volt::Error' do visit '/save' fill_in 'post_title', with: 'ok' click_button 'Save' expect(page).to have_content('#<Volt::Errors {"title"=>["must be at least 5 characters"]}>') end...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/bindings_spec.rb
spec/integration/bindings_spec.rb
require 'spec_helper' describe 'bindings test', type: :feature, sauce: true do it 'should load the page' do visit '/' expect(page).to have_content('Kitchen Sink') end describe 'text/fields' do it 'should load the bindings page and update bindings' do visit '/' click_link 'Bindings' ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/cookies_spec.rb
spec/integration/cookies_spec.rb
require 'spec_helper' describe 'cookies collection', type: :feature, sauce: true do if ENV['BROWSER'] != 'phantom' # TODO: fails in phantom for some reason it 'should add' do visit '/' click_link 'Cookies' fill_in('cookieName', with: 'one') fill_in('cookieValue', with: 'one') ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/templates_spec.rb
spec/integration/templates_spec.rb
require 'spec_helper' describe 'bindings test', type: :feature, sauce: true do it 'should change the title when changing pages' do visit '/' expect(page).to have_title 'KitchenSink - KitchenSink' click_link 'Bindings' expect(page).to have_title 'Bindings - KitchenSink' end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/first_last_spec.rb
spec/integration/first_last_spec.rb
require 'spec_helper' describe 'first, last', type: :feature, sauce: true do # Currently failing, fixing # it 'should render first with a number argument' do # store._messages << {body: 'hey, sup?'} # store._messages << {body: 'not much'} # store._messages << {body: 'you?'} # store._messages << {bo...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/todos_spec.rb
spec/integration/todos_spec.rb
require 'spec_helper' describe 'todos app', type: :feature, sauce: true do ENTER_KEY = ENV["BROWSER"] == 'phantom' ? :Enter : :return it 'should add a todo and remove it' do visit '/todos' store._todos fill_in 'newtodo', with: 'Todo 1' find('#newtodo').native.send_keys(ENTER_KEY) expect(page)...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/store_spec.rb
spec/integration/store_spec.rb
require 'spec_helper' # describe 'store', type: :feature, sauce: true do # it 'should sync between nested root properties on store' do # visit '/store' # fill_in('field1', with: 'should sync') # expect(find('#field2').value).to eq('should sync') # end # end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/url_spec.rb
spec/integration/url_spec.rb
if ENV['BROWSER'] && ENV['BROWSER'] != 'phantom' require 'spec_helper' describe 'url features', type: :feature, sauce: true do it 'should update the page when using the back button' do visit '/' expect(current_url).to match(/\/$/) click_link 'Bindings' expect(current_url).to match(/\/b...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/list_spec.rb
spec/integration/list_spec.rb
if ENV['BROWSER'] == 'firefox' require 'spec_helper' describe 'todo example spec', type: :feature, sauce: true do before do visit '/' click_link 'Todos' fill_in('newtodo', with: "Item 1\n") fill_in('newtodo', with: "Item 2\n") fill_in('newtodo', with: "Item 3\n") end it...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/raw_html_binding.rb
spec/integration/raw_html_binding.rb
require 'spec_helper' describe 'HTML safe/raw', type: :feature do it 'should render html with the raw helper' do visit '/html_safe' expect(page).to have_selector('button[id="examplebutton"]') end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/images_spec.rb
spec/integration/images_spec.rb
require 'spec_helper' describe 'image loading', type: :feature, sauce: true do it 'should load images in assets' do visit '/images' loaded = page.evaluate_script("$('img').get(0).complete") expect(loaded).to eq(true) end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/event_spec.rb
spec/integration/event_spec.rb
require 'spec_helper' describe 'events and bubbling', type: :feature, sauce: true do it 'should bubble events through the dom' do visit '/events' click_button 'Run Some Event' expect(page).to have_content('ran some_event') end it 'should let you specify an e- handler on components' do visit '/...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/client_require_spec.rb
spec/integration/client_require_spec.rb
require 'spec_helper' describe 'client require', type: :feature, sauce: true do it 'should require code in controllers' do visit '/require_test' expect(page).to have_content('Date Class: true') end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/user_spec.rb
spec/integration/user_spec.rb
require 'spec_helper' describe 'user accounts', type: :feature, sauce: true do it 'should create an account' do visit '/' click_link 'Login' click_link 'Signup here' fields = all(:css, 'form .form-control') fields[0].set('test@test.com') fields[1].set('awes0mesEcRet') fields[2].set('T...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/integration/missing_spec.rb
spec/integration/missing_spec.rb
require 'spec_helper' describe "missing tags and view's", type: :feature do it 'should show a message about the missing tag/view' do visit '/missing' expect(page).to have_content('view or tag at "some/wrong/path"') expect(page).to have_content('view or tag at "not/a/component"') end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/tasks/login_tasks.rb
spec/apps/kitchen_sink/app/main/tasks/login_tasks.rb
class LoginTasks < Volt::Task def login_first_user store.users.first.then do |first_user| login_as(first_user) end end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/yield_component_controller.rb
spec/apps/kitchen_sink/app/main/controllers/yield_component_controller.rb
module Main class YieldComponentController < Volt::ModelController def content_string 'wrong' end end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/main_controller.rb
spec/apps/kitchen_sink/app/main/controllers/main_controller.rb
# Require date for require test require 'date' module Main class MainController < Volt::ModelController model :page reactive_accessor :blur_count, :focus_count, :image_loaded def index a = {} a[{}] = 5 end def store_demo puts "STORE DEMO" end def form_ready `$(...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/events_controller.rb
spec/apps/kitchen_sink/app/main/controllers/events_controller.rb
module Main class EventsController < Volt::ModelController reactive_accessor :ran_some_event reactive_accessor :ran_other_event def trig_some_event trigger('some_event', 'yes') end def some_event(passes_args, event) if passes_args == 'yes' && event.is_a?(Volt::JSEvent) self.r...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/todos_controller.rb
spec/apps/kitchen_sink/app/main/controllers/todos_controller.rb
require 'volt/helpers/time' module Main class TodosController < Volt::ModelController model :store def add_todo _todos.create({ name: page._new_todo, created_at: VoltTime.new }) page._new_todo = '' end def remove_todo(todo) todo.destroy end def completed _todos.coun...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/save_controller.rb
spec/apps/kitchen_sink/app/main/controllers/save_controller.rb
module Main class SaveController < Volt::ModelController def add_post store.posts.create(page._new_post.to_h).fail do |err| flash._notices << err.inspect end end end end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/upload_controller.rb
spec/apps/kitchen_sink/app/main/controllers/upload_controller.rb
module Main class UploadController < Volt::ModelController model :page def index # Nothing to setup here end def upload `form_data = new FormData(); form_data.append("file", $('#file')[0].files[0]); $.ajax({ url: '/simple_http/upload', data: form_data, ...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/controllers/server/simple_http_controller.rb
spec/apps/kitchen_sink/app/main/controllers/server/simple_http_controller.rb
module Main class SimpleHttpController < Volt::HttpController def index render text: 'this is just some text' end def show render text: "You had me at #{store._simple_http_tests.first._name.sync}" end def create render text: params.inspect end def upload uploaded...
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false
voltrb/volt
https://github.com/voltrb/volt/blob/f942b92385adbc894ee4a37903ee6a9c1a65e9a4/spec/apps/kitchen_sink/app/main/models/post.rb
spec/apps/kitchen_sink/app/main/models/post.rb
class Post < Volt::Model field :title, String validate :title, length: 5 end
ruby
MIT
f942b92385adbc894ee4a37903ee6a9c1a65e9a4
2026-01-04T15:51:19.582691Z
false