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
juliancheal/code-extractor
https://github.com/juliancheal/code-extractor
test/code_extractor_test.rb
Ruby
mit
19
master
2,743
require 'test_helper' class CodeExtractorTest < CodeExtractor::TestCase def test_code_extractor repo_structure = %w[ foo/bar baz ] create_repo repo_structure do update_file "foo/bar", "Bar Content" commit "add Bar content" tag "v1.0" add_file "qux", "QUX!!!" co...
github
juliancheal/code-extractor
https://github.com/juliancheal/code-extractor
lib/code_extractor.rb
Ruby
mit
19
master
3,214
require 'yaml' # Class to extract files and folders from a git repository, while maintaining # The git history. module CodeExtractor def run Runner.new.extract end module_function :run class Config def initialize(config_file = 'extractions.yml') @config = YAML.load_file(config_file) @conf...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
Gemfile
Ruby
mit
19
main
2,379
source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.7.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem 'rails', '~> 6.1.3', '>= 6.1.3.2' # Use sqlite3 as the database for Active Record gem 'sqlite3', '~> 1.4' # Use Puma as the app...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
app/controllers/stytch_controller.rb
Ruby
mit
19
main
2,004
class StytchController < ApplicationController class StytchError < StandardError; end def login; end def create email = params.require(:email) resp = stytch_client.magic_links.email.login_or_create( email: email, # Make sure to use the `*_url` helpers instead of `*_path` ones! The # d...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
app/controllers/users_controller.rb
Ruby
mit
19
main
407
class UsersController < ApplicationController def edit @user = current_user redirect_to login_path unless @user end def update @user = current_user redirect_to login_path unless @user @user.update(user_params) if @user.save redirect_to root_path else render 'edit' end...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
app/controllers/application_controller.rb
Ruby
mit
19
main
484
class ApplicationController < ActionController::Base def current_user @_current_user ||= session[:current_user_id] && User.find_by(id: session[:current_user_id]) end def default_url_options if Rails.env.development? # Rails uses the hostname from the request as the base for URL helpers. To match th...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
db/schema.rb
Ruby
mit
19
main
1,085
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
db/migrate/20210423014055_create_users.rb
Ruby
mit
19
main
248
class CreateUsers < ActiveRecord::Migration[6.1] def change create_table :users do |t| t.string :stytch_user_id, null: false t.string :name t.timestamps end add_index :users, :stytch_user_id, unique: true end end
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
config/application.rb
Ruby
mit
19
main
704
require_relative "boot" require "rails/all" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module Greeter class Application < Rails::Application # Initialize configuration defaults for originally generated Rails v...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
config/routes.rb
Ruby
mit
19
main
616
Rails.application.routes.draw do # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html # Greet users on the home page! root 'welcome#index' # Login form get '/login', to: 'stytch#login' # Handle the login form submission post '/login', to: 'stytch#create' ...
github
stytchauth/stytch-ruby-on-rails-example
https://github.com/stytchauth/stytch-ruby-on-rails-example
config/environments/production.rb
Ruby
mit
19
main
5,334
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your applica...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
bundler_mcp.gemspec
Ruby
mit
19
main
1,586
# frozen_string_literal: true require_relative "lib/bundler_mcp/version" EXCLUDE_FILES = %w[ bin/ test/ spec/ features/ .git .github .cursor .cursorignore .rspec .rubocop.yml example.mcp.json Gemfile ].freeze Gem::Specification.new do |spec| spec.name = "bundler_mcp" spec.version = BundlerMCP::VERSION spec...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp.rb
Ruby
mit
19
main
426
# frozen_string_literal: true require_relative "bundler_mcp/version" # Namespace for BundlerMCP code module BundlerMCP # Base error class for BundlerMCP Error = Class.new(StandardError) # Raised when Bundler cannot find a Gemfile class GemfileNotFound < Error def initialize(msg = DEFAULT_MESSAGE) s...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/environment_checker.rb
Ruby
mit
19
main
553
# frozen_string_literal: true require "bundler" require "bundler_mcp" module BundlerMCP # Responsible for checking the environment to make sure Bundler can find gems class EnvironmentChecker # Check for a Gemfile and raise an error if not found # @return [Pathname] The path to the Gemfile # @raise [Ge...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/server.rb
Ruby
mit
19
main
1,218
# frozen_string_literal: true require "bundler" require "fast_mcp" require "json" require "pathname" require "logger" require_relative "version" require_relative "resource_collection" require_relative "tool_collection" require_relative "environment_checker" module BundlerMCP # Main server class for BundlerMCP # @...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/resource_collection.rb
Ruby
mit
19
main
863
# frozen_string_literal: true require_relative "gem_resource" require "singleton" module BundlerMCP # Represents a collection of GemResource objects defining all currently bundled gems # @see GemResource class ResourceCollection include Singleton include Enumerable def initialize @resources =...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/gem_resource.rb
Ruby
mit
19
main
1,145
# frozen_string_literal: true require "forwardable" require "pathname" module BundlerMCP # Represents a Ruby gem and its associated data # @see https://docs.ruby-lang.org/en/2.5.0/Gem/Specification.html class GemResource extend Forwardable def_delegators :gem, :name, :description, :full_gem_path #...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/tool_collection.rb
Ruby
mit
19
main
478
# frozen_string_literal: true require "pathname" Pathname(__dir__).glob("tools/*.rb").each do |tool| require tool end module BundlerMCP # Contains all tools that can be used by the caller class ToolCollection # @yield [Tool] each MCP tool # @yieldparam tool [Tool] a tool in the collection def self....
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/tools/get_gem_details.rb
Ruby
mit
19
main
1,761
# frozen_string_literal: true require "fast_mcp" module BundlerMCP module Tools # Retrieve details about a specific bundled Ruby gem # @see ResourceCollection class GetGemDetails < FastMcp::Tool description <<~DESC Returns detailed information about one **Ruby Gem** that is installed in th...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
lib/bundler_mcp/tools/list_project_gems.rb
Ruby
mit
19
main
1,464
# frozen_string_literal: true require "mcp/tool" module BundlerMCP module Tools # Informs the client of all bundled Ruby gems with their versions, descriptions, installation paths, # documentation, and (optionally) source code locations # @see https://github.com/yjacquin/fast-mcp/blob/main/docs/tools.md...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/spec_helper.rb
Ruby
mit
19
main
656
# frozen_string_literal: true require "bundler_mcp" require "debug" Dir[File.expand_path("support/**/*.rb", __dir__)].each do |file| require file end RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSp...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/support/integration_spec_helper.rb
Ruby
mit
19
main
2,051
# frozen_string_literal: true # rubocop:disable Metrics/AbcSize,Metrics/MethodLength module IntegrationSpecHelper attr_accessor :read_io, :write_io, :child_pid # Forks so that we can test the server's behavior in isolation using STDIN/STDOUT. # We use IO.pipe to create a pair of pipes, one for reading and one ...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/lib/resource_collection_spec.rb
Ruby
mit
19
main
590
# frozen_string_literal: true require "spec_helper" require "bundler_mcp/gem_resource" require "bundler_mcp/resource_collection" RSpec.describe BundlerMCP::ResourceCollection do let(:gem) do Bundler.load.specs.find { |s| s.name == "bundler_mcp" } end describe "#each" do it "yields each gem" do ex...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/lib/environment_checker_spec.rb
Ruby
mit
19
main
719
# frozen_string_literal: true require "spec_helper" require "bundler_mcp/environment_checker" RSpec.describe BundlerMCP::EnvironmentChecker do describe ".check" do context "when Gemfile exists" do it "returns the Gemfile path" do expect(described_class.check!).to eq(Bundler.default_gemfile) ...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/lib/gem_resource_spec.rb
Ruby
mit
19
main
1,139
# frozen_string_literal: true require "bundler_mcp/gem_resource" require "rubygems" RSpec.describe BundlerMCP::GemResource do subject(:resource) { described_class.new(gem_spec) } let(:gem_spec) { Gem::Specification.find_by_name("bundler_mcp") } describe "#to_h" do it "returns basic gem details" do a...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/lib/server_spec.rb
Ruby
mit
19
main
1,281
# frozen_string_literal: true require "spec_helper" require "bundler_mcp/server" RSpec.describe BundlerMCP::Server do before do allow(BundlerMCP::EnvironmentChecker).to receive(:check!) allow(FastMcp::Server).to receive(:new).and_return(mcp_server) end let(:mcp_server) do instance_double(FastMcp::S...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/lib/tools/get_gem_details_spec.rb
Ruby
mit
19
main
1,072
# frozen_string_literal: true require "bundler_mcp/tools/get_gem_details" require "bundler_mcp/gem_resource" RSpec.describe BundlerMCP::Tools::GetGemDetails do subject(:tool) { described_class.new([gem_resource]) } let(:gem_resource) do instance_double(BundlerMCP::GemResource, name: "rspe...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/lib/tools/list_project_gems_spec.rb
Ruby
mit
19
main
965
# frozen_string_literal: true require "bundler_mcp/tools/list_project_gems" require "bundler_mcp/gem_resource" RSpec.describe BundlerMCP::Tools::ListProjectGems do subject(:tool) { described_class.new(gem_resources) } let(:gem_resources) do [ instance_double(BundlerMCP::GemResource, ...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/integration/listing_project_gems_spec.rb
Ruby
mit
19
main
694
# frozen_string_literal: true require "spec_helper" require "json" require "timeout" RSpec.describe "Listing gems" do around do |example| setup_server example.run teardown_server end it "returns a list of gems via MCP protocol" do gem_list = request("list_project_gems") # this is a little ...
github
subelsky/bundler_mcp
https://github.com/subelsky/bundler_mcp
spec/integration/getting_gem_details_spec.rb
Ruby
mit
19
main
954
# frozen_string_literal: true require "spec_helper" require "json" require "timeout" RSpec.describe "Fetching a gem" do around do |example| setup_server example.run teardown_server end it "returns gem details via MCP protocol" do gem_details = request("get_gem_details", name: "bundler_mcp") ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
shopify_api.gemspec
Ruby
mit
19
main
1,280
# frozen_string_literal: true $LOAD_PATH.push(File.expand_path("../lib", __FILE__)) require "shopify_api/version" Gem::Specification.new do |s| s.name = "shopify_api" s.version = ShopifyAPI::VERSION s.author = "Shopify" s.summary = "The gem for accessing the Shopify API" s.description = <<~HERE This ge...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api.rb
Ruby
mit
19
main
565
# typed: strict # frozen_string_literal: true $LOAD_PATH.unshift(File.dirname(__FILE__)) require "oj" require "sorbet-runtime" require "securerandom" require "cgi" require "uri" require "openssl" require "httparty" require "zeitwerk" require "jwt" require "concurrent" require_relative "shopify_api/inflector" require...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/context.rb
Ruby
mit
19
main
6,250
# typed: strict # frozen_string_literal: true module ShopifyAPI class Context extend T::Sig @api_key = T.let("", String) @api_secret_key = T.let("", String) @api_version = T.let(LATEST_SUPPORTED_ADMIN_VERSION, String) @api_host = T.let(nil, T.nilable(String)) @scope = T.let(Auth::AuthScopes....
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/admin_versions.rb
Ruby
mit
19
main
622
# typed: strict # frozen_string_literal: true module ShopifyAPI module AdminVersions SUPPORTED_ADMIN_VERSIONS = T.let([ "unstable", "2024-10", "2024-07", "2024-04", "2024-01", "2023-10", "2023-07", "2023-04", "2023-01", "2022-10", "2022-07", ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/auth/oauth.rb
Ruby
mit
19
main
4,031
# typed: strict # frozen_string_literal: true module ShopifyAPI module Auth module Oauth extend T::Sig NONCE_LENGTH = 15 class << self extend T::Sig sig do params( shop: String, redirect_path: String, is_online: T.nilable(T::Boole...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/auth/jwt_payload.rb
Ruby
mit
19
main
2,748
# typed: strict # frozen_string_literal: true module ShopifyAPI module Auth class JwtPayload extend T::Sig JWT_LEEWAY = 10 JWT_EXPIRATION_LEEWAY = JWT_LEEWAY sig { returns(String) } attr_reader :iss, :dest, :aud, :sub, :jti, :sid sig { returns(Integer) } attr_reader :...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/auth/session.rb
Ruby
mit
19
main
4,950
# typed: strict # frozen_string_literal: true module ShopifyAPI module Auth class Session extend T::Sig sig { returns(String) } attr_reader :id sig { returns(T.nilable(String)) } attr_accessor :state, :access_token sig { returns(String) } attr_accessor :shop si...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/auth/token_exchange.rb
Ruby
mit
19
main
2,891
# typed: strict # frozen_string_literal: true module ShopifyAPI module Auth module TokenExchange extend T::Sig TOKEN_EXCHANGE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange" ID_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:id_token" class RequestedTokenType < T::Enum ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/auth/oauth/access_token_response.rb
Ruby
mit
19
main
1,042
# typed: strict # frozen_string_literal: true module ShopifyAPI module Auth module Oauth class AccessTokenResponse < T::Struct extend T::Sig const :access_token, String const :scope, String const :session, T.nilable(String) const :expires_in, T.nilable(Integer) ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/handler.rb
Ruby
mit
19
main
795
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks class WebhookMetadata < T::Struct const :topic, String const :shop, String const :body, T::Hash[String, T.untyped] const :api_version, String const :webhook_id, String end module Handler i...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/request.rb
Ruby
mit
19
main
1,837
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks class Request extend T::Sig include Utils::VerifiableQuery sig { override.returns(String) } def hmac Digest.hexencode(Base64.decode64(T.cast(@headers["x-shopify-hmac-sha256"], String))) end ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/registration.rb
Ruby
mit
19
main
3,025
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks class Registration extend T::Sig extend T::Helpers abstract! FIELDS_DELIMITER = "," sig { returns(String) } attr_reader :topic sig { returns(T.nilable(T.any(Handler, WebhookHandler))) } ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/registry.rb
Ruby
mit
19
main
10,042
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks class Registry @registry = T.let({}, T::Hash[String, Registration]) MANDATORY_TOPICS = T.let([ "shop/redact", "customers/redact", "customers/data_request", ].freeze, T::Array[String]) ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/registrations/event_bridge.rb
Ruby
mit
19
main
2,323
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks module Registrations class EventBridge < Registration extend T::Sig sig { override.returns(String) } def callback_address @path end sig { override.returns(T::Hash[Symbol, Stri...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/registrations/pub_sub.rb
Ruby
mit
19
main
2,617
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks module Registrations class PubSub < Registration extend T::Sig sig { override.returns(String) } def callback_address @path end sig { override.returns(T::Hash[Symbol, String]) ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/webhooks/registrations/http.rb
Ruby
mit
19
main
2,658
# typed: strict # frozen_string_literal: true module ShopifyAPI module Webhooks module Registrations class Http < Registration extend T::Sig sig { override.returns(String) } def callback_address if @path.match?(%r{^https?://}) @path elsif @path.match...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/clients/http_client.rb
Ruby
mit
19
main
4,215
# typed: strict # frozen_string_literal: true module ShopifyAPI module Clients class HttpClient extend T::Sig RETRY_WAIT_TIME = 1 sig { params(base_path: String, session: T.nilable(Auth::Session)).void } def initialize(base_path:, session: nil) session ||= Context.active_session...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/clients/rest/admin.rb
Ruby
mit
19
main
4,495
# typed: strict # frozen_string_literal: true module ShopifyAPI module Clients module Rest class Admin < HttpClient extend T::Sig sig { params(session: T.nilable(Auth::Session), api_version: T.nilable(String)).void } def initialize(session: nil, api_version: nil) @api_ver...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/clients/graphql/storefront.rb
Ruby
mit
19
main
2,456
# typed: strict # frozen_string_literal: true module ShopifyAPI module Clients module Graphql class Storefront < Client sig do params( shop: String, storefront_access_token: T.nilable(String), private_token: T.nilable(String), public_token: ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
lib/shopify_api/utils/session_utils.rb
Ruby
mit
19
main
2,291
# typed: strict # frozen_string_literal: true module ShopifyAPI module Utils class SessionUtils extend T::Sig class << self extend T::Sig sig do params( shopify_id_token: T.nilable(String), cookies: T.nilable(T::Hash[String, String]), on...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/test_helper.rb
Ruby
mit
19
main
3,216
# typed: strict # frozen_string_literal: true $VERBOSE = nil $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "minitest/autorun" require "webmock/minitest" require "mocha" require "mocha/minitest" require "shopify_api" require "pry-byebug" require_relative("test_helpers/constants.rb") Dir...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/context_test.rb
Ruby
mit
19
main
6,241
# typed: true # frozen_string_literal: true require_relative "test_helper" module ShopifyAPITest class ContextTest < Minitest::Test def setup @reader, writer = IO.pipe ENV["HOST"] = "http://localhost:3000" ShopifyAPI::Context.setup( api_key: "key", api_secret_key: "secret", ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/admin_versions_test.rb
Ruby
mit
19
main
438
# typed: true # frozen_string_literal: true require_relative "test_helper" module ShopifyAPITest class AdminVersionsTest < Minitest::Test def test_supported_admin_versions assert_instance_of(Array, ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS) end def test_supported_latest_supported_admin_...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/webhooks/registry_test_queries.rb
Ruby
mit
19
main
27,769
# typed: false # frozen_string_literal: true module ShopifyAPITest module Webhooks module RegistryTestQueries def queries { http: { check_query: <<~QUERY, { webhookSubscriptions(first: 1, topics: SOME_TOPIC) { ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/webhooks/registry_test.rb
Ruby
mit
19
main
15,648
# typed: false # frozen_string_literal: true require_relative "../test_helper.rb" require_relative "registry_test_queries.rb" module ShopifyAPITest module Webhooks class RegistryTest < Test::Unit::TestCase include RegistryTestQueries def setup super @topic = "some/topic" @sho...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/webhooks/request_test.rb
Ruby
mit
19
main
1,086
# typed: false # frozen_string_literal: true require_relative "../test_helper" module ShopifyAPITest module Webhooks class WebhookRequestTest < Minitest::Test def test_create_webhook_request headers = { "HTTP_X_SHOPIFY_TOPIC" => "some/topic", "HTTP_X_SHOPIFY_HMAC_SHA256" => "so...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/auth/jwt_payload_test.rb
Ruby
mit
19
main
4,773
# typed: true # frozen_string_literal: true require_relative "../test_helper" module ShopifyAPITest module Auth class JwtPayloadTest < Test::Unit::TestCase def setup super @jwt_payload = { iss: "https://test-shop.myshopify.io/admin", dest: "https://test-shop.myshopify.i...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/auth/oauth_test.rb
Ruby
mit
19
main
12,293
# typed: false # frozen_string_literal: true require_relative "../test_helper" module ShopifyAPITest module Auth class OauthTest < Test::Unit::TestCase ALPHANUMERIC_REGEX = /\A[a-zA-Z0-9]*\z/ def setup super() @stubbed_time_now = Time.now @shop = "test-shop.myshopify.com" ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/auth/token_exchange_test.rb
Ruby
mit
19
main
7,404
# typed: false # frozen_string_literal: true require_relative "../test_helper" module ShopifyAPITest module Auth class TokenExchangeTest < Test::Unit::TestCase def setup super() @stubbed_time_now = Time.now @shop = "test-shop.myshopify.com" @jwt_payload = { iss: ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/auth/session_test.rb
Ruby
mit
19
main
6,795
# typed: false # frozen_string_literal: true require_relative "../test_helper" module ShopifyAPITest module Auth class SessionTest < Test::Unit::TestCase UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ def test_create_session_with_id session = ShopifyAPI::Auth:...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/auth/oauth/access_token_response_test.rb
Ruby
mit
19
main
1,260
# typed: true # frozen_string_literal: true require_relative "../../test_helper" module ShopifyAPITest module Auth module Oauth class AccessTokenResponseTest < Test::Unit::TestCase def test_online_token_is_false_when_no_associated_user token_response = ShopifyAPI::Auth::Oauth::AccessToke...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/clients/http_client_test.rb
Ruby
mit
19
main
12,338
# typed: false # frozen_string_literal: true require_relative "../test_helper.rb" module ShopifyAPITest module Clients class HttpClientTest < Test::Unit::TestCase def setup super @shop = "test-shop.myshopify.com" @token = SecureRandom.alphanumeric(10) @base_path = "/base_pa...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/clients/base_rest_resource_test.rb
Ruby
mit
19
main
37,856
# typed: false # frozen_string_literal: true require_relative "../test_helper" require "shopify_api" module ShopifyAPITest module Rest class BaseTest < Test::Unit::TestCase def setup @session = ShopifyAPI::Auth::Session.new(shop: "test-shop.myshopify.com", access_token: SecureRandom.alph...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/clients/graphql/storefront_test.rb
Ruby
mit
19
main
3,273
# typed: false # frozen_string_literal: true require_relative "../../test_helper.rb" module ShopifyAPITest module Clients module Graphql class StorefrontTest < Test::Unit::TestCase include TestHelpers::GraphQLClient def setup super @shop = "test-shop.myshopify.com" ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/clients/rest/admin_test.rb
Ruby
mit
19
main
2,727
# typed: false # frozen_string_literal: true require_relative "../../test_helper.rb" class AdminTest < Test::Unit::TestCase def test_get run_test(:get) end def test_delete run_test(:delete) end def test_put run_test(:put) end def test_post run_test(:post) end def test_does_not_ap...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/test_helpers/fake_webhook_handler.rb
Ruby
mit
19
main
350
# typed: false # frozen_string_literal: true require_relative "../../lib/shopify_api/webhooks/handler" module TestHelpers class FakeWebhookHandler include ShopifyAPI::Webhooks::Handler def initialize(handler) @handler = handler end def handle(topic:, shop:, body:) @handler.call(topic, ...
github
Mickey9315/shopify-api-ruby
https://github.com/Mickey9315/shopify-api-ruby
test/test_helpers/new_fake_webhook_handler.rb
Ruby
mit
19
main
331
# typed: false # frozen_string_literal: true require_relative "../../lib/shopify_api/webhooks/handler" module TestHelpers class NewFakeWebhookHandler include ShopifyAPI::Webhooks::WebhookHandler def initialize(handler) @handler = handler end def handle(data:) @handler.call(data) end...
github
kickstarter/caption_crunch
https://github.com/kickstarter/caption_crunch
Rakefile
Ruby
mit
19
master
265
require "rubygems" require "bundler/setup" require 'rake/testtask' require "bundler/gem_tasks" namespace :test do Rake::TestTask.new(:units) do |t| t.pattern = "spec/*_spec.rb" end end desc 'Run tests' task :test => %w[test:units] task :default => :test
github
kickstarter/caption_crunch
https://github.com/kickstarter/caption_crunch
caption_crunch.gemspec
Ruby
mit
19
master
971
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'caption_crunch/version' Gem::Specification.new do |spec| spec.name = "caption_crunch" spec.version = CaptionCrunch::VERSION spec.authors = ["David Peter"] spec.email ...
github
kickstarter/caption_crunch
https://github.com/kickstarter/caption_crunch
lib/caption_crunch.rb
Ruby
mit
19
master
331
module CaptionCrunch # Delegates to Adapters::VTT.parse. # Returns a CaptionCrunch::Track instance def self.parse(file) Adapters::VTT.parse(file) end end require "caption_crunch/version" require 'caption_crunch/parse_error' require 'caption_crunch/track' require 'caption_crunch/cue' require 'caption_crunch...
github
kickstarter/caption_crunch
https://github.com/kickstarter/caption_crunch
lib/caption_crunch/adapters/vtt.rb
Ruby
mit
19
master
4,003
module CaptionCrunch module Adapters class VTT SIGNATURE_REGEX = /\AWEBVTT\Z|\AWEBVTT[ \t\n]/.freeze COMMENT_REGEX = /\ANOTE\Z|\ANOTE[ \t\n]/.freeze ARROW_REGEX = /-->/.freeze # Format: hour:minute:second.milliseconds # hour: is optional. # 11:22:33 ...
github
kickstarter/caption_crunch
https://github.com/kickstarter/caption_crunch
spec/caption_crunch_spec.rb
Ruby
mit
19
master
4,854
require_relative './spec_helper' describe 'CaptionCrunch' do describe 'parse' do describe 'parsing entirely wrong signature' do it 'should raise CaptionCrunch::ParseError' do error = ->{ CaptionCrunch.parse('SPIDERWEBVTT') }.must_raise CaptionCrunch::ParseError error.messa...
github
kickstarter/caption_crunch
https://github.com/kickstarter/caption_crunch
spec/spec_helper.rb
Ruby
mit
19
master
256
require "rubygems" require "bundler/setup" require "minitest/autorun" require "minitest/pride" require "caption_crunch" class MiniTest::Spec def fixture(path) path = File.join(File.dirname(__FILE__), 'fixtures', path) File.open(path) end end
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
Rakefile
Ruby
apache-2.0
19
master
2,020
require 'rubygems' require 'rake' require 'yaml' begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "net-ssh-kerberos" gem.summary = %Q{Add Kerberos support to Net::SSH} gem.description = <<-EOTEXT Extends Net::SSH by adding Kerberos authentication capability for password-less logins on mul...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
net-ssh-kerberos.gemspec
Ruby
apache-2.0
19
master
2,371
# Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{net-ssh-kerberos} s.version = "0.2.7" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :requir...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
test/sspi_test.rb
Ruby
apache-2.0
19
master
3,019
require File.join(File.dirname(__FILE__), 'test_helper.rb') class SspiTest < Test::Unit::TestCase if Net::SSH::Kerberos::Drivers.available.include? 'SSPI' include Net::SSH::Kerberos::Drivers::SSPI def test_query_security_package_info result = API.querySecurityPackageInfo "Kerberos", nil assert result.ok...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
test/gss_test.rb
Ruby
apache-2.0
19
master
3,463
require File.join(File.dirname(__FILE__), 'test_helper.rb') class GssTest < Test::Unit::TestCase if Net::SSH::Kerberos::Drivers.available.include? 'GSS' include Net::SSH::Kerberos::Drivers::GSS def test_acquire_cred result = API.gss_acquire_cred nil, 60, nil, GSS_C_INITIATE, nil, nil, 0 assert result.ok...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
test/test_helper.rb
Ruby
apache-2.0
19
master
209
require 'rubygems' require 'test/unit' $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'net/ssh/kerberos' class Test::Unit::TestCase end
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
test/sspi_context_test.rb
Ruby
apache-2.0
19
master
489
require File.join(File.dirname(__FILE__), 'test_helper.rb') class SspiContextTest < Test::Unit::TestCase if Net::SSH::Kerberos::Drivers.available.include? 'SSPI' def setup @gss = Net::SSH::Kerberos::Drivers::SSPI::Context.new end def teardown @gss.dispose end def test_create @gss.create ENV[...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
test/net_ssh_kerberos_test.rb
Ruby
apache-2.0
19
master
209
require File.join(File.dirname(__FILE__), 'test_helper.rb') class NetSshKerberosTest < Test::Unit::TestCase def test_net_ssh_integration flunk "write some unit tests for Net::SSH integration" end end
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
test/gss_context_test.rb
Ruby
apache-2.0
19
master
817
require File.join(File.dirname(__FILE__), 'test_helper.rb') class GssContextTest < Test::Unit::TestCase if Net::SSH::Kerberos::Drivers.available.include? 'GSS' def setup @gss = Net::SSH::Kerberos::Drivers::GSS::Context.new end def teardown @gss.dispose end def test_create @gss.create ENV['US...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos.rb
Ruby
apache-2.0
19
master
295
require 'net/ssh' require 'net/ssh/errors' module Net; module SSH; module Kerberos end; end; end require 'net/ssh/kerberos/constants' require 'net/ssh/kerberos/context' require 'net/ssh/kerberos/drivers' #require 'net/ssh/kerberos/kex' require 'net/ssh/authentication/methods/gssapi_with_mic'
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/authentication/methods/gssapi_with_mic.rb
Ruby
apache-2.0
19
master
4,228
require 'net/ssh/authentication/methods/abstract' require 'net/ssh/kerberos/constants' module Net module SSH module Authentication module Methods # Implements the Kerberos 5 SSH authentication method. class GssapiWithMic < Abstract include Net::SSH::Kerberos::Constants ...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos/kex.rb
Ruby
apache-2.0
19
master
527
require 'net/ssh/kerberos/kex/krb5_diffie_hellman_group1_sha1' require 'net/ssh/kerberos/kex/krb5_diffie_hellman_group_exchange_sha1' module Net; module SSH; module Kerberos module Kex GSS_MAP = { 'gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==' => KRB5DiffieHellmanGroup1SHA1, 'gss-gex-sha1-toWM5Slw5E...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos/drivers.rb
Ruby
apache-2.0
19
master
1,789
require 'dl/import' require 'dl/struct' module Net; module SSH; module Kerberos; module Drivers # Some useful DL extensions. module DLDriver PTR_ENC = proc{|v| v && (DL::PtrData===v ? v : v.to_ptr) } PTR_REF_ENC = proc{|v| (v.nil? ? DL::PtrData.new(v) : (DL::PtrData===v ? v : v.to_ptr)).ref } ...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos/context.rb
Ruby
apache-2.0
19
master
2,241
module Net; module SSH; module Kerberos class Context class GeneralError < StandardError; end class State < Struct.new(:handle, :result, :token, :timestamp) def complete?; result.complete? end end attr_reader :cred_name, :cred_krb_name, :server_name, :server_krb_name def initialize ...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos/constants.rb
Ruby
apache-2.0
19
master
940
module Net; module SSH; module Kerberos module Constants # GSSAPI Key exchange method specific messages KEXGSS_INIT = 30 KEXGSS_CONTINUE = 31 KEXGSS_COMPLETE = 32 KEXGSS_HOSTKEY = 33 KEXGSS_ERROR ...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos/drivers/sspi.rb
Ruby
apache-2.0
19
master
8,690
module Net; module SSH; module Kerberos; module Drivers module SSPI SEC_E_OK = 0x00000000 SEC_I_CONTINUE_NEEDED = 0x00090312 SEC_I_COMPLETE_NEEDED = 0x00090313 SEC_I_COMPLETE_AND_CONTINUE = 0x00090314 SEC_I_INCOMPLETE_CREDENTIALS = 0x00090320 SEC_I_RENEGOTIATE = 0x00090321 SEC_E_INSU...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
lib/net/ssh/kerberos/drivers/gss.rb
Ruby
apache-2.0
19
master
10,495
module Net; module SSH; module Kerberos; module Drivers; module GSS include Net::SSH::Kerberos::Constants GSS_C_INITIATE = 1 GSS_C_DELEG_FLAG = 1 GSS_C_MUTUAL_FLAG = 2 GSS_C_REPLAY_FLAG = 4 GSS_C_SEQUENCE_FLAG = 8 GSS_C_CONF_FLAG = 16 GSS_C_INTEG_FLAG = 32 G...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
example/gss.rb
Ruby
apache-2.0
19
master
3,417
require 'socket' require 'rubygems' gem 'net-ssh' $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') require 'net/ssh' require 'net/ssh/errors' require 'net/ssh/kerberos' unless Net::SSH::Kerberos::Drivers.available.include? 'GSS' $stderr.puts "No drivers supporting GSSAPI could be loaded." exit 1 end incl...
github
joekhoobyar/net-ssh-kerberos
https://github.com/joekhoobyar/net-ssh-kerberos
example/sspi.rb
Ruby
apache-2.0
19
master
2,511
#$DEBUG = 1 require 'socket' require 'rubygems' gem 'net-ssh' $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') require 'net/ssh' require 'net/ssh/errors' require 'net/ssh/kerberos' unless Net::SSH::Kerberos::Drivers.available.include? 'SSPI' $stderr.puts "No drivers supporting SSPI could be loaded." exit...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
Rakefile
Ruby
mit
18
master
521
require 'bundler/gem_tasks' require 'rspec/core/rake_task' require 'rubocop/rake_task' RSpec::Core::RakeTask.new(:specs) task default: :specs task :spec do Rake::Task['specs'].invoke Rake::Task['rubocop'].invoke Rake::Task['spec_docs'].invoke end desc 'Run RuboCop on the lib/specs directory' RuboCop::RakeTask...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
Guardfile
Ruby
mit
18
master
478
# A guardfile for making Danger Plugins # For more info see https://github.com/guard/guard#readme # To run, use `bundle exec guard`. guard :rspec, cmd: 'bundle exec rspec' do require 'guard/rspec/dsl' dsl = Guard::RSpec::Dsl.new(self) # RSpec files rspec = dsl.rspec watch(rspec.spec_helper) { rspec.spec_di...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
danger-lgtm.gemspec
Ruby
mit
18
master
1,691
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'lgtm/version.rb' Gem::Specification.new do |spec| spec.name = 'danger-lgtm' spec.version = Lgtm::VERSION spec.authors = ['leonhartX'] spec.email = ['leonhar...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
spec/lgtm_spec.rb
Ruby
mit
18
master
1,956
# frozen_string_literal: true require File.expand_path('spec_helper', __dir__) describe Danger::DangerLgtm do it 'should be a plugin' do expect(Danger::DangerLgtm.new(nil)).to be_a(Danger::Plugin) end describe '#check_lgtm' do shared_examples 'returns correctly message' do it { expect(markdowns.f...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
spec/spec_helper.rb
Ruby
mit
18
master
2,013
# frozen_string_literal: true require 'pathname' ROOT = Pathname.new(File.expand_path('..', __dir__)) $LOAD_PATH.unshift((ROOT + 'lib').to_s) $LOAD_PATH.unshift((ROOT + 'spec').to_s) require 'bundler/setup' require 'pry' require 'rspec' require 'danger' # Use coloured output, it's the best. RSpec.configure do |conf...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
lib/lgtm/network.rb
Ruby
mit
18
master
1,300
# frozen_string_literal: true module Lgtm # Network is module of HTTP communication module Network class NetworkError < StandardError; end # process_request Send HTTP request # # @param [URI] uri Request uri # # @return [Net::HTTP] HTTP response # def process_request(uri) r...
github
leonhartX/danger-lgtm
https://github.com/leonhartX/danger-lgtm
lib/lgtm/plugin.rb
Ruby
mit
18
master
3,144
# frozen_string_literal: true require 'uri' require 'net/http' require_relative 'network' module Danger # Lgtm let danger say lgtm when there is no violations. # Default use random lgtm image from [lgtm.in](https://lgtm.in). # # @example Post lgtm with a specific image # # lgtm.check_lgtm image_...
github
deployku/deployku
https://github.com/deployku/deployku
Rakefile
Ruby
mit
18
master
274
# -*- coding: utf-8 -*- # vi: fenc=utf-8:expandtab:ts=2:sw=2:sts=2 # # @author: Petr Kovar <pejuko@gmail.com> require 'rubygems/package_task' require 'rake/clean' CLEAN << "pkg" task :default => [:gem] Gem::PackageTask.new(eval(File.read("deployku.gemspec"))) {|pkg|}
github
deployku/deployku
https://github.com/deployku/deployku
deployku.gemspec
Ruby
mit
18
master
663
# -*- coding: utf-8 -*- # vi: fenc=utf-8:expandtab:ts=2:sw=2:sts=2 # # @author: Petr Kovar <pejuko@gmail.com> require 'rubygems' require 'find' spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.summary = "Deploy applications using git with zero down time" s.homepage = "http://github.com/d...