source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
test/rails_root/app/controllers/photo_bares_controller.rb
Ruby
mit
241
master
2,164
class PhotoBaresController < ApplicationController # GET /photo_bares # GET /photo_bares.xml def index @photo_bares = PhotoBare.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @photo_bares } end end # GET /photo_bares/1 # GET /photo_bares...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
test/rails_root/app/controllers/photo_dbs_controller.rb
Ruby
mit
241
master
2,074
class PhotoDbsController < ApplicationController # GET /photo_dbs # GET /photo_dbs.xml def index @photo_dbs = PhotoDb.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @photo_dbs } end end # GET /photo_dbs/1 # GET /photo_dbs/1.xml def sho...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
test/rails_root/app/controllers/application.rb
Ruby
mit
241
master
467
# Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base helper :all # include all helpers, all the time # See ActionController::RequestForgeryProtection for details...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage.rb
Ruby
mit
241
master
1,573
require 'open-uri' require 'base64' require 'digest/sha1' require 'aws/s3' # Load RMagick begin require 'RMagick' rescue MissingSourceFile => e puts %{ERROR :: FlexImage requires the RMagick gem. http://rmagick.rubyforge.org/install-faq.html} raise e end # Apply a few RMagick patches require 'fleximage/rmagick...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/dsl_accessor.rb
Ruby
mit
241
master
1,755
require 'active_support' unless defined?(ActiveSupport) class Class def dsl_accessor(name, options = {}) raise TypeError, "DSL Error: options should be a hash. but got `#{options.class}'" unless options.is_a?(Hash) writer = options[:writer] || options[:setter] writer = case writer when NilCla...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/blank.rb
Ruby
mit
241
master
2,224
module Fleximage # The +Blank+ class allows easy creation of dynamic images for views which depends models that # do not store images. For example, perhaps you want a rendering of a text label, or a comment, # or some other type of data that is not inherently image based. # # Your model doesn't need to kn...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/view.rb
Ruby
mit
241
master
1,826
module Fleximage # Renders a .flexi template class View < ActionView::TemplateHandler #:nodoc: class TemplateDidNotReturnImage < RuntimeError #:nodoc: end def self.call(template) "Fleximage::View.new(self).render(template)" end def initialize(action_view) @view = action_view...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/legacy_view.rb
Ruby
mit
241
master
2,025
module Fleximage # Renders a .flexi template class LegacyView #:nodoc: class TemplateDidNotReturnImage < RuntimeError #:nodoc: end def initialize(view) @view = view end def render(template, local_assigns = {}) # process the view result = @view.instance_eval do ...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/aviary_controller.rb
Ruby
mit
241
master
2,506
module Fleximage module AviaryController def self.api_key(value = nil) value ? @api_key = value : @api_key end def self.api_key=(value = nil) api_key value end # Include acts_as_fleximage class method def self.included(base) #:nodoc: base.extend(ClassMethods) ...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/helper.rb
Ruby
mit
241
master
1,941
module Fleximage module Helper # Creates an image tag that links directly to image data. Recommended for displays of a # temporary upload that is not saved to a record in the databse yet. def embedded_image_tag(model, options = {}) model.load_image format = options[:format] || :jpg ...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/image_proxy.rb
Ruby
mit
241
master
2,115
module Fleximage # An instance of this class is yielded when Model#operate is called. It enables image operators # to be called to transform the image. You should never need to directly deal with this class. # You simply call image operators on this object when inside an Model#operate block # # @photo....
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/model.rb
Ruby
mit
241
master
27,630
module Fleximage # Container for Fleximage model method inclusion modules module Model class MasterImageNotFound < RuntimeError #:nodoc: end # Include acts_as_fleximage class method def self.included(base) #:nodoc: base.extend(ClassMethods) end # Provides class method...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/text.rb
Ruby
mit
241
master
3,910
module Fleximage module Operator # Draw text on the image. Customize size, position, color, dropshadow, and font. # # image.text(string_to_write, options = {}) # # Use the following keys in the +options+ hash: # # * alignment: symbol like in <tt>ImageOverlay</tt> # * offset: ...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/resize.rb
Ruby
mit
241
master
3,552
module Fleximage module Operator # Resize this image, constraining proportions. Options allow cropping, stretching, upsampling and # padding. # # image.resize(size, options = {}) # # +size+ is size of the output image after the resize operation. Accepts either <tt>'123x456'</tt>...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/crop.rb
Ruby
mit
241
master
1,836
module Fleximage module Operator # Crops the image without doing any resizing first. The operation crops from the :+from+ coordinate, # and returns an image of size :+size+ down and right from there. # # image.crop(options = {}) # # Use the following keys in the +options+ hash: # ...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/border.rb
Ruby
mit
241
master
1,499
module Fleximage module Operator # Add a border to the outside of the image # # image.border(options = {}) # # Use the following keys in the +options+ hash: # # * +size+: Width of the border on each side. You can use a 2 dimensional value ('5x10') if you want # different...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/image_overlay.rb
Ruby
mit
241
master
4,031
module Fleximage module Operator # Adds an overlay to the base image. It's useful for things like attaching a logo, # watermark, or even a border to the image. It will work best with a 24-bit PNG with # alpha channel since it will properly deal with partial transparency. # # image.resize...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/unsharp_mask.rb
Ruby
mit
241
master
1,318
module Fleximage module Operator # Sharpen an image using an unsharp mask filter. # # image.unsharp_mask(options = {}) # # Use the following keys in the +options+ hash: # # * +radius+: The radius of the Gaussian operator. The default is 0.0. # * +sigma+: The standard deviation ...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/background.rb
Ruby
mit
241
master
2,922
module Fleximage module Operator # Composites a transparent image over a colored backgroud # # It accepts the following options: # # * +color+: the color of the background image. # Use an RMagick named color or use the +color+ method in Fleximage::Controller, or a # Magick::Pixel obje...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/base.rb
Ruby
mit
241
master
6,895
module Fleximage module Operator class BadOperatorResult < Exception #:nodoc: end class OperationNotImplemented < Exception #:nodoc: end # The Operator::Base class is what all other Operator classes inherit from. # To write your own Operator class, simply inherit from this class...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/trim.rb
Ruby
mit
241
master
256
module Fleximage module Operator # Trim off all the pixels around the image border that have the same color. # # image.trim class Trim < Operator::Base def operate() @image.trim!(true) end end end end
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
lib/fleximage/operator/shadow.rb
Ruby
mit
241
master
3,188
module Fleximage module Operator # Add a drop shadow to the image. # # image.shadow(options = {}) # # Use the following keys in the +options+ hash: # # * +offset+: distance of the dropsahdow form the image, in FlexImage *size* format. Positive # number move it down and r...
github
AlexJWayne/fleximage
https://github.com/AlexJWayne/fleximage
tasks/fleximage_tasks.rake
Ruby
mit
241
master
5,443
namespace :fleximage do # Find the model class def model_class raise 'You must specify a FLEXIMAGE_CLASS=MyClass' unless ENV['FLEXIMAGE_CLASS'] @model_class ||= ENV['FLEXIMAGE_CLASS'].camelcase.constantize end desc "Populate width and height magic columns from the current image store. Useful when...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
ruby_llm-mcp.gemspec
Ruby
mit
241
main
2,026
# frozen_string_literal: true require_relative "lib/ruby_llm/mcp/version" Gem::Specification.new do |spec| spec.name = "ruby_llm-mcp" spec.version = RubyLLM::MCP::VERSION spec.authors = ["Patrick Vice"] spec.email = ["patrickgvice@gmail.com"] spec.summary = "A RubyLLM MCP Client" spec.description = <<~DE...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
Gemfile
Ruby
mit
241
main
628
# frozen_string_literal: true source "https://rubygems.org" gemspec group :development do if RUBY_VERSION >= "3.1.0" gem "mcp", "~> 0.7" end # Development dependencies gem "activesupport" gem "bundler", ">= 2.0" gem "debug", platforms: :mri gem "dotenv", ">= 3.0" gem "json_schemer" gem "rake",...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
Rakefile
Ruby
mit
241
main
264
# frozen_string_literal: true require "bundler/gem_tasks" require "rspec/core/rake_task" Dir.glob("lib/tasks/*.rake").each { |file| load file } RSpec::Core::RakeTask.new(:spec) require "rubocop/rake_task" RuboCop::RakeTask.new task default: %i[spec rubocop]
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/spec_helper.rb
Ruby
mit
241
main
7,402
# frozen_string_literal: true begin require "debug" rescue LoadError # debug is optional (e.g., JRuby in CI). end require "dotenv" require "simplecov" require "vcr" require "webmock/rspec" Dotenv.load SimpleCov.start do add_filter "/spec/" add_filter "/examples/" enable_coverage :branch end require "bund...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/chat_spec.rb
Ruby
mit
241
main
8,846
# frozen_string_literal: true RSpec.describe RubyLLM::Chat do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end before do MCPTest...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp_spec.rb
Ruby
mit
241
main
12,778
# frozen_string_literal: true RSpec.describe RubyLLM::MCP do it "has a version number" do expect(RubyLLM::MCP::VERSION).not_to be_nil end describe "#client" do it "calls RubyLLM::MCP::Client" do client = instance_double(RubyLLM::MCP::Client) allow(RubyLLM::MCP::Client).to receive(:new).and_r...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/prompt_spec.rb
Ruby
mit
241
main
2,473
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Prompt do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end context "with ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/oauth_authentication_spec.rb
Ruby
mit
241
main
6,033
# frozen_string_literal: true RSpec.describe "OAuth Authentication" do # rubocop:disable RSpec/DescribeClass describe "OAuth Configuration" do it "accepts OAuth configuration for streamable transport" do expect do RubyLLM::MCP::Client.new( name: "oauth-test-client", transport_ty...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/roots_spec.rb
Ruby
mit
241
main
5,044
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Roots do let(:adapter) do adapter = instance_double(RubyLLM::MCP::Adapters::BaseAdapter) allow(adapter).to receive(:roots_list_change_notification).and_return(true) adapter end # Integration tests - only run on adapter...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/server_capabilities_spec.rb
Ruby
mit
241
main
12,800
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::ServerCapabilities do describe "#initialize" do context "when no capabilities are provided" do let(:capabilities) { described_class.new } it "initializes with empty capabilities hash" do expect(capabilities.capabilities).to eq({}) ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/client_spec.rb
Ruby
mit
241
main
18,682
# frozen_string_literal: true require "stringio" RSpec.describe RubyLLM::MCP::Client do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all e...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/human_in_the_loop_handler_integration_spec.rb
Ruby
mit
241
main
4,180
# frozen_string_literal: true require "spec_helper" RSpec.describe "Human-in-the-Loop Handler Integration" do # rubocop:disable RSpec/DescribeClass let(:coordinator) do double( "Coordinator", native_client: double("NativeClient") ) end before do RubyLLM::MCP::Handlers::HumanInTheLoopReg...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/sample_spec.rb
Ruby
mit
241
main
10,169
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Sample do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) end before do MCPTestConfiguration.reset_config! MCPTestConfiguration.configure_ruby_llm! end let(...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/completion_spec.rb
Ruby
mit
241
main
5,285
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Completion do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end # Completi...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/resource_spec.rb
Ruby
mit
241
main
8,485
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Resource do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end context "wit...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/tool_spec.rb
Ruby
mit
241
main
42,815
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Tool do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end # Test environme...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/error_spec.rb
Ruby
mit
241
main
4,721
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Error do describe "#initialize" do it "extracts code, message, and data from error_data" do error_data = { "code" => -32_700, "message" => "Parse error", "data" => { "details" => "Invalid JSON" } } error = descr...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/apps_metadata_spec.rb
Ruby
mit
241
main
6,214
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Tool do # rubocop:disable RSpec/SpecFilePathFormat let(:tool_payload_class) do Struct.new(:name, :description, :input_schema, :output_schema, :meta, keyword_init: true) do def [](key) return meta if key == "_meta" nil end ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/tool_name_sanitization_spec.rb
Ruby
mit
241
main
1,308
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Tool do let(:client) { instance_double(RubyLLM::MCP::Client, name: "my/client") } let(:adapter) { instance_double(RubyLLM::MCP::Adapters::BaseAdapter, client: client) } describe "name formatting" do it "sanitizes invalid characters in tool names" do...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/elicitation_handler_integration_spec.rb
Ruby
mit
241
main
10,813
# frozen_string_literal: true require "spec_helper" RSpec.describe "Elicitation Handler Integration" do # rubocop:disable RSpec/DescribeClass let(:coordinator) do double( "Coordinator", elicitation_callback: nil, elicitation_response: true ) end let(:result) do RubyLLM::MCP::Resul...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth_spec.rb
Ruby
mit
241
main
2,927
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth do describe ".create_oauth" do let(:server_url) { "https://mcp.example.com" } let(:scope) { "mcp:read mcp:write" } let(:callback_port) { 8080 } context "with type: :standard" do it "creates an OAuthProvider ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/client_protocol_spec.rb
Ruby
mit
241
main
3,652
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Client do after do RubyLLM::MCP.config.reset! MCPTestConfiguration.configure! end describe "protocol version resolution" do let(:ruby_llm_adapter) do instance_double( RubyLLM::MCP::Adapters::RubyLLMAdapter, supports?: f...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/sample_handler_integration_spec.rb
Ruby
mit
241
main
4,911
# frozen_string_literal: true require "spec_helper" RSpec.describe "Sample Handler Integration" do # rubocop:disable RSpec/DescribeClass let(:coordinator) do double( "Coordinator", sampling_callback_enabled?: true, sampling_create_message_response: true, error_response: true ) end ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/result_spec.rb
Ruby
mit
241
main
5,798
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Result do describe "JSON-RPC 2.0 message type detection" do describe "#notification?" do it "returns true for messages without id but with method" do response = { "jsonrpc" => "2.0", "method" => "n...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/cancellation_integration_spec.rb
Ruby
mit
241
main
5,395
# frozen_string_literal: true require "spec_helper" require "timeout" RSpec.describe "Cancellation Integration", :vcr do # rubocop:disable RSpec/DescribeClass before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) end before do MCPTestConfiguration.rese...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/task_integration_spec.rb
Ruby
mit
241
main
3,808
# frozen_string_literal: true require "spec_helper" RSpec.describe "Task Integration" do # rubocop:disable RSpec/DescribeClass before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) end before do MCPTestConfiguration.reset_config! MCPTestConfigurati...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/client_capabilities_integration_spec.rb
Ruby
mit
241
main
2,681
# frozen_string_literal: true require "spec_helper" RSpec.describe "Client Capabilities Integration" do # rubocop:disable RSpec/DescribeClass before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) end before do MCPTestConfiguration.reset_config! MCP...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/progress_spec.rb
Ruby
mit
241
main
1,952
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Progress do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end # Progress t...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/resource_template_spec.rb
Ruby
mit
241
main
6,255
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::ResourceTemplate do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end cont...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/elicitation_spec.rb
Ruby
mit
241
main
17,891
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Elicitation do before(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.build_client_runners(CLIENT_OPTIONS) ClientRunner.start_all end after(:all) do # rubocop:disable RSpec/BeforeAfterAll ClientRunner.stop_all end describe ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/configuration_spec.rb
Ruby
mit
241
main
11,215
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Configuration do after do RubyLLM::MCP.config.reset! MCPTestConfiguration.configure! end describe "initialization" do it "sets default values" do config = RubyLLM::MCP::Configuration.new expect(config.request_timeout).to eq(8000...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/notification_handler_spec.rb
Ruby
mit
241
main
3,767
# frozen_string_literal: true require_relative "../../../lib/ruby_llm/mcp/result" class FakeLogger def error(message) @error_message = message end attr_reader :error_message end RSpec.describe RubyLLM::MCP::NotificationHandler do let(:client) { instance_double(RubyLLM::MCP::Client) } let(:notification...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/human_in_the_loop_registry_spec.rb
Ruby
mit
241
main
6,184
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::HumanInTheLoopRegistry do let(:approval_id) { "approval-123" } let(:promise) { RubyLLM::MCP::Handlers::Promise.new } let(:approval_context) do { promise: promise, timeout: 300, tool_name: "delete_fil...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/concerns_integration_spec.rb
Ruby
mit
241
main
6,626
# frozen_string_literal: true require "spec_helper" RSpec.describe "Handlers::Concerns Integration" do # rubocop:disable RSpec/DescribeClass describe "Complete handler with all concerns" do let(:notification_service) { double("NotificationService") } let(:approval_handler_class) do Class.new do ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/async_response_improvements_spec.rb
Ruby
mit
241
main
8,958
# frozen_string_literal: true require "spec_helper" RSpec.describe "AsyncResponse Improvements" do # rubocop:disable RSpec/DescribeClass describe "callback execution safety" do it "executes callbacks outside mutex to prevent deadlocks" do async_resp = RubyLLM::MCP::Handlers::AsyncResponse.new( eli...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/promise_spec.rb
Ruby
mit
241
main
5,134
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::Promise do describe "initialization" do it "starts in pending state" do promise = described_class.new expect(promise.state).to eq(:pending) expect(promise).to be_pending end end describe "#resol...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/async_response_spec.rb
Ruby
mit
241
main
4,949
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::AsyncResponse do let(:elicitation_id) { "test-elicit-123" } describe "initialization" do it "starts in pending state" do response = described_class.new(elicitation_id: elicitation_id) expect(response.state)...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/concurrency_spec.rb
Ruby
mit
241
main
12,836
# frozen_string_literal: true require "spec_helper" RSpec.describe "Handler Concurrency" do # rubocop:disable RSpec/DescribeClass before do RubyLLM::MCP::Handlers::ElicitationRegistry.clear RubyLLM::MCP::Handlers::HumanInTheLoopRegistry.clear end after do RubyLLM::MCP::Handlers::ElicitationRegistry...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/approval_decision_spec.rb
Ruby
mit
241
main
1,522
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::ApprovalDecision do describe ".from_handler_result" do it "parses approved decisions" do decision = described_class.from_handler_result( { status: :approved }, approval_id: "approval-1" ) ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/promise_improvements_spec.rb
Ruby
mit
241
main
5,752
# frozen_string_literal: true require "spec_helper" RSpec.describe "Promise Improvements" do # rubocop:disable RSpec/DescribeClass describe "condition variable waiting" do it "wakes up immediately when resolved" do promise = RubyLLM::MCP::Handlers::Promise.new start_time = Time.now thread = ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/elicitation_registry_spec.rb
Ruby
mit
241
main
5,126
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::ElicitationRegistry do let(:elicitation_id) { "test-elicit-123" } let(:coordinator) { double("Coordinator") } let(:elicitation) do double( "Elicitation", id: elicitation_id, message: "Test message", ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/concerns/guard_checks_spec.rb
Ruby
mit
241
main
3,077
# frozen_string_literal: true require "spec_helper" # rubocop:disable Naming/PredicateMethod RSpec.describe RubyLLM::MCP::Handlers::Concerns::GuardChecks do let(:base_handler_class) do Class.new do include RubyLLM::MCP::Handlers::Concerns::Lifecycle include RubyLLM::MCP::Handlers::Concerns::GuardChe...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/concerns/lifecycle_spec.rb
Ruby
mit
241
main
2,691
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::Concerns::Lifecycle do let(:test_handler_class) do Class.new do include RubyLLM::MCP::Handlers::Concerns::Lifecycle before_execute :before_hook after_execute :after_hook attr_reader :before_calle...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/concerns/approval_actions_spec.rb
Ruby
mit
241
main
3,937
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::Concerns::ApprovalActions do let(:handler_class) do Class.new do include RubyLLM::MCP::Handlers::Concerns::Lifecycle include RubyLLM::MCP::Handlers::Concerns::ApprovalActions def initialize(tool_name:, ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/handlers/concerns/options_spec.rb
Ruby
mit
241
main
2,120
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Handlers::Concerns::Options do let(:test_handler_class) do Class.new do include RubyLLM::MCP::Handlers::Concerns::Options option :test_option, default: "default_value" option :flag_option, default: false op...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/extensions/configuration_spec.rb
Ruby
mit
241
main
1,975
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Extensions::Configuration do let(:canonical_id) { RubyLLM::MCP::Extensions::Constants::UI_EXTENSION_ID } describe "#register" do it "registers an extension" do config = described_class.new config.register(canonical_id, "enabled" => true) ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/extensions/registry_spec.rb
Ruby
mit
241
main
1,523
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Extensions::Registry do let(:canonical_id) { RubyLLM::MCP::Extensions::Constants::UI_EXTENSION_ID } let(:alias_id) { RubyLLM::MCP::Extensions::Constants::APPS_EXTENSION_ALIAS } describe ".canonicalize_id" do it "normalizes the legacy alias to canoni...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/cancellable_operation_spec.rb
Ruby
mit
241
main
3,694
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Native::CancellableOperation do let(:request_id) { "test-request-123" } let(:operation) { described_class.new(request_id) } describe "#initialize" do it "sets the request_id" do expect(operation.request_id).to eq(request_id) end it "i...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/json_rpc_spec.rb
Ruby
mit
241
main
8,663
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Native::JsonRpc do describe "ErrorCodes" do it "defines standard JSON-RPC 2.0 error codes" do expect(described_class::ErrorCodes::PARSE_ERROR).to eq(-32_700) expect(described_class::ErrorCodes::INVALID_REQUEST).to eq(-3...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/client_spec.rb
Ruby
mit
241
main
5,716
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Native::Client do let(:request_result) do RubyLLM::MCP::Result.new( { "result" => { "content" => [{ "type" => "text", "text" => "ok" }] } } ) end def build_client(human_callback: nil, ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/response_handler_spec.rb
Ruby
mit
241
main
4,999
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Native::ResponseHandler do let(:client) { instance_double(RubyLLM::MCP::Native::Client) } let(:request_handler) { RubyLLM::MCP::Native::ResponseHandler.new(client) } let(:task_registry) { RubyLLM::MCP::Native::TaskRegistry.new } before do allow(cl...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/messages_spec.rb
Ruby
mit
241
main
30,040
# frozen_string_literal: true require "spec_helper" require "json_schemer" RSpec.describe RubyLLM::MCP::Native::Messages do let(:schema_path) { File.join(__dir__, "../../../fixtures/mcp_definition/2025-11-25-schema.json") } let(:schema_json) { JSON.parse(File.read(schema_path)) } let(:schemer) { JSONSchemer.sch...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/client_extensions_spec.rb
Ruby
mit
241
main
2,288
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Native::Client do let(:extension_id) { RubyLLM::MCP::Extensions::Constants::UI_EXTENSION_ID } let(:extensions_capabilities) { { extension_id => {} } } describe "extension capability advertisement" do it "advertises extensions on stable protocol" do ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/protocol_spec.rb
Ruby
mit
241
main
2,924
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Native::Protocol do describe "supported versions" do it "includes the draft protocol version" do expect(described_class.supported_versions).to include(described_class::DRAFT_PROTOCOL_VERSION) expect(described_class.supported_version?(describe...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/transport_spec.rb
Ruby
mit
241
main
8,039
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Native::Transport do let(:coordinator) { instance_double(RubyLLM::MCP::Native::Client) } let(:config) { { timeout: 30 } } describe ".transports" do it "returns a hash of registered transports" do transports = described_class.transports ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/transports/streamable_http_spec.rb
Ruby
mit
241
main
83,426
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Native::Transports::StreamableHTTP do let(:client) do RubyLLM::MCP::Client.new( name: "test-client", transport_type: :streamable, request_timeout: 5000, config: { url: TestServerManager::HTTP_SERVER_...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/transports/stdio_spec.rb
Ruby
mit
241
main
20,044
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Native::Transports::Stdio do let(:coordinator) { instance_double(RubyLLM::MCP::Native::Client) } let(:command) { "echo" } let(:args) { [] } let(:env) { {} } let(:request_timeout) { 5000 } # Mock transport that bypasses process creation for testing...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/transports/sse_spec.rb
Ruby
mit
241
main
22,743
# frozen_string_literal: true class Runner class << self def instance @instance ||= Runner.new end end def start client.start end def stop client&.stop end def client @client ||= RubyLLM::MCP::Client.new( name: "fast-mcp-ruby", transport_type: :sse, config: ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/native/transports/support/rate_limiter_spec.rb
Ruby
mit
241
main
5,130
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Native::Transports::Support::RateLimiter do describe "#initialize" do it "uses default values when no arguments provided" do rate_limiter = described_class.new # Should allow up to 10 requests initially 10.times ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/adapters/mcp_sdk_streamable_spec.rb
Ruby
mit
241
main
2,283
# frozen_string_literal: true class MCPSdkStreamableRunner class << self def instance @instance ||= MCPSdkStreamableRunner.new end end def start client.start end def stop client&.stop end def client @client ||= RubyLLM::MCP::Client.new( name: "typescript-mcp-streamable"...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/adapters/extensions_spec.rb
Ruby
mit
241
main
3,630
# frozen_string_literal: true RSpec.describe RubyLLM::MCP::Adapters::RubyLLMAdapter do # rubocop:disable RSpec/SpecFilePathFormat let(:extension_id) { RubyLLM::MCP::Extensions::Constants::UI_EXTENSION_ID } let(:tool_payload_class) do Struct.new(:name, :description, :input_schema, :output_schema, :meta, keyword...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/adapters/mcp_sdk_stdio_spec.rb
Ruby
mit
241
main
3,942
# frozen_string_literal: true class MCPSdkStdioRunner class << self def instance @instance ||= MCPSdkStdioRunner.new end end def start client.start end def stop client&.stop end def client @client ||= RubyLLM::MCP::Client.new( name: "typescript-mcp-stdio", adapter...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/adapters/mcp_sdk_sse_spec.rb
Ruby
mit
241
main
2,204
# frozen_string_literal: true class MCPSdkSSERunner class << self def instance @instance ||= MCPSdkSSERunner.new end end def start client.start end def stop client&.stop end def client @client ||= RubyLLM::MCP::Client.new( name: "fast-mcp-ruby-sdk", adapter: :mcp_...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/http_response_handler_spec.rb
Ruby
mit
241
main
5,691
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::HttpResponseHandler do describe ".handle_response" do context "with successful response" do let(:response) do instance_double( HTTPX::Response, status: 200, body: '{"access_token": ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/url_builder_spec.rb
Ruby
mit
241
main
6,600
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::UrlBuilder do describe ".build_discovery_url" do it "builds first-priority authorization server discovery URL" do url = described_class.build_discovery_url("https://mcp.example.com/api", :authorization_server) exp...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/browser_oauth_provider_spec.rb
Ruby
mit
241
main
48,370
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::BrowserOAuthProvider do # rubocop:disable RSpec/SpecFilePathFormat let(:oauth_provider) { instance_double(RubyLLM::MCP::Auth::OAuthProvider) } let(:callback_port) { 8080 } let(:callback_path) { "/callback" } let(:logger) { ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/session_manager_spec.rb
Ruby
mit
241
main
3,549
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::SessionManager do let(:storage) { RubyLLM::MCP::Auth::MemoryStorage.new } let(:manager) { described_class.new(storage) } let(:server_url) { "https://mcp.example.com/api" } describe "#create_session" do it "creates PKCE...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/token_spec.rb
Ruby
mit
241
main
699
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::Token do describe "#to_header" do it "formats default bearer token type" do token = described_class.new(access_token: "abc123") expect(token.to_header).to eq("Bearer abc123") end it "normalizes lowercase...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/client_registrar_spec.rb
Ruby
mit
241
main
7,261
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::ClientRegistrar do let(:http_client) { instance_double(HTTPX::Session) } let(:storage) { RubyLLM::MCP::Auth::MemoryStorage.new } let(:logger) { instance_double(Logger) } let(:config) { RubyLLM::MCP.config } let(:registrar...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/token_manager_spec.rb
Ruby
mit
241
main
13,757
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::TokenManager do let(:http_client) { instance_double(HTTPX::Session) } let(:logger) { instance_double(Logger) } let(:manager) { described_class.new(http_client, logger) } let(:server_url) { "https://mcp.example.com/api" } ...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/security_spec.rb
Ruby
mit
241
main
4,375
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::Security do describe ".secure_compare" do it "returns true for identical strings" do a = "test_string_123" b = "test_string_123" expect(described_class.secure_compare(a, b)).to be true end it "retu...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/oauth_provider_spec.rb
Ruby
mit
241
main
21,700
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::OAuthProvider do # rubocop:disable RSpec/SpecFilePathFormat let(:server_url) { "https://mcp.example.com/api" } let(:redirect_uri) { "http://localhost:8080/callback" } let(:scope) { "mcp:read mcp:write" } let(:storage) { Rub...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/memory_storage_spec.rb
Ruby
mit
241
main
3,066
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::MemoryStorage do let(:storage) { described_class.new } let(:server_url) { "https://mcp.example.com/api" } describe "token storage" do let(:token) do RubyLLM::MCP::Auth::Token.new(access_token: "test_token") end...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/discoverer_spec.rb
Ruby
mit
241
main
19,702
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::Discoverer do let(:http_client) { instance_double(HTTPX::Session) } let(:storage) { RubyLLM::MCP::Auth::MemoryStorage.new } let(:logger) { instance_double(Logger) } let(:discoverer) { described_class.new(http_client, storag...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/grant_strategies_spec.rb
Ruby
mit
241
main
1,803
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::GrantStrategies do describe "Base" do subject(:strategy) { RubyLLM::MCP::Auth::GrantStrategies::Base.new } it "raises NotImplementedError for auth_method" do expect { strategy.auth_method }.to raise_error(NotImplem...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/flows/client_credentials_flow_spec.rb
Ruby
mit
241
main
4,640
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::Flows::ClientCredentialsFlow do let(:discoverer) { instance_double(RubyLLM::MCP::Auth::Discoverer) } let(:client_registrar) { instance_double(RubyLLM::MCP::Auth::ClientRegistrar) } let(:token_manager) { instance_double(RubyLL...
github
patvice/ruby_llm-mcp
https://github.com/patvice/ruby_llm-mcp
spec/ruby_llm/mcp/auth/flows/authorization_code_flow_spec.rb
Ruby
mit
241
main
9,096
# frozen_string_literal: true require "spec_helper" RSpec.describe RubyLLM::MCP::Auth::Flows::AuthorizationCodeFlow do let(:discoverer) { instance_double(RubyLLM::MCP::Auth::Discoverer) } let(:client_registrar) { instance_double(RubyLLM::MCP::Auth::ClientRegistrar) } let(:session_manager) { instance_double(Ruby...