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 |
|---|---|---|---|---|---|---|---|---|
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/features/step_definitions.rb | features/step_definitions.rb | # frozen_string_literal: true
Before do
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
FileUtils.mkdir_p(Paths.test_dir) unless Paths.test_dir.directory?
Dir.chdir(Paths.test_dir)
end
After do
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
Paths.output_file.delete if Paths.output_file.ex... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/features/support/helpers.rb | features/support/helpers.rb | # frozen_string_literal: true
require 'fileutils'
require 'jekyll'
require 'time'
require 'yaml'
class Paths
SOURCE_DIR = Pathname.new(File.expand_path('../..', __dir__))
def self.test_dir
source_dir.join('tmp', 'jekyll')
end
def self.output_file
test_dir.join('jekyll_output.txt')
end
def self.... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/webmention_tags_spec.rb | spec/webmention_tags_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.shared_context 'webmention_tag_context' do
include_context 'webmention_io_stubs'
let(:url) { 'http://www.test.com' }
let(:context) { Struct.new(:page, :line_number, :registers).new(Struct.new(:url).new(url), 1, {}) }
let(:incoming_webmentions) { {} }
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/webmentions_spec.rb | spec/webmentions_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Jekyll::WebmentionIO::Webmentions do
let(:mock_policy) { instance_double('Jekyll::WebmentionIO::WebmentionPolicy') }
let(:mock_client) { instance_double('Jekyll::WebmentionIO::NetworkClient') }
let(:webmentions) { described_class.new(mock_policy... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/templates_spec.rb | spec/templates_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'fileutils'
require 'nokogiri'
RSpec.describe 'Template Rendering' do
# Shared context for browser-based testing with Capybara
shared_context 'capybara_browser' do
def test_html_dir
File.expand_path('../tmp/template_tests', __dir__)
end
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/webmention_command_spec.rb | spec/webmention_command_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'timecop'
describe Jekyll::WebmentionIO::Commands::WebmentionCommand do
include_context 'webmention_io_stubs'
let(:policy) { Jekyll::WebmentionIO::WebmentionPolicy.new(config, caches) }
let(:outgoing_webmentions) { {} }
let(:bad_uris) { {} }
let(... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/jekyll_webmention_io_spec.rb | spec/jekyll_webmention_io_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Jekyll::WebmentionIO do
let(:dest_dir) { File.expand_path('../tmp/dest', __dir__) }
let(:source_dir) { File.expand_path('fixtures', __dir__) }
let(:config_defaults) do
{
'source' => source_dir,
'destination' => dest_dir,
'gems' =... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/queue_webmentions_spec.rb | spec/queue_webmentions_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Jekyll::WebmentionIO::QueueWebmentions do
include_context 'webmention_io_stubs'
let(:outgoing_webmentions_cache) { {} }
let(:documents) { [] }
let(:collections) { {} }
before do
allow(config).to receive(:documents).and_return(documents)
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/caches_spec.rb | spec/caches_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'fileutils'
require 'yaml'
require 'safe_yaml/load'
RSpec.describe Jekyll::WebmentionIO::Caches do
let(:temp_dir) { Dir.mktmpdir('jekyll_webmention_io_test') }
let(:config) { double('Config', cache_folder: temp_dir) }
let(:caches) { described_class.new... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/gather_webmentions_spec.rb | spec/gather_webmentions_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'securerandom'
require 'timecop'
describe Jekyll::WebmentionIO::GatherWebmentions do
include_context 'webmention_io_stubs'
let(:incoming_webmentions_cache) { spy('Cache') }
let(:site_lookups_cache) { spy('Cache') }
let(:documents) { [] }
before d... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/config_spec.rb | spec/config_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Jekyll::WebmentionIO::Config do
let(:site) { instance_double('Jekyll::Site') }
let(:config_hash) do
{
'url' => 'https://example.com',
'baseurl' => '',
'webmentions' => webmentions_config,
}
end
before do
allow(si... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'jekyll'
require 'jekyll-webmention_io'
require 'html-proofer'
require 'json'
require 'capybara/rspec'
require 'capybara/cuprite'
Capybara.register_driver(:cuprite) do |app|
Capybara::Cuprite::Driver.new(app, window_size: ... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/spec/support/shared_contexts.rb | spec/support/shared_contexts.rb | # frozen_string_literal: true
RSpec.shared_context 'webmention_io_stubs' do
let(:config) { Jekyll::WebmentionIO::Config.new }
let(:caches) { instance_double('Jekyll::WebmentionIO::Caches') }
let(:webmentions) { instance_double('Jekyll::WebmentionIO::Webmentions') }
let(:policy) { Jekyll::WebmentionIO::Webmenti... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll-webmention_io.rb | lib/jekyll-webmention_io.rb | # frozen_string_literal: false
require 'jekyll'
require 'jekyll/webmention_io'
Jekyll::Hooks.register :site, :after_init do |site|
Jekyll::WebmentionIO.bootstrap(site)
end
| ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/webmention_policy.rb | lib/jekyll/webmention_policy.rb | # frozen_string_literal: true
module Jekyll
module WebmentionIO
# The WebmentionPolicy class encapsulates all the configuration and
# state management logic for dealing with request failures.
class WebmentionPolicy
module State
UNSUPPORTED = 'unsupported'
ERROR = 'error'
FAI... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/templates.rb | lib/jekyll/templates.rb | # frozen_string_literal: true
module Jekyll
module WebmentionIO
class Templates
attr_reader :supported_templates
def initialize(site)
@site = site
@supported_templates = (WebmentionIO.types + %w(count webmentions)).freeze
@template_file_cache = {}
@template_content_... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/webmention_io.rb | lib/jekyll/webmention_io.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
require_relative 'webmention_io/version'
require_rel... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/network_client.rb | lib/jekyll/network_client.rb | # frozen_string_literal: true
require 'webmention'
require 'indieweb/endpoints'
require 'net/http'
require 'openssl'
module Jekyll
module WebmentionIO
class NetworkClient
module HTTPStatus
SUCCESS = 0
FAILURE = 1
end
EXCEPTIONS = [
SocketError, Timeout::Error,
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/caches.rb | lib/jekyll/caches.rb | # frozen_string_literal: true
require 'forwardable'
require 'fileutils'
module Jekyll
module WebmentionIO
# The Caches class is a utility service that provides access to the cache files used
# by this plugin.
#
# It is initialized with a config object and creates a folder in the configured cache fol... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/webmentions.rb | lib/jekyll/webmentions.rb | # frozen_string_literal: true
require_relative 'network_client'
module Jekyll
module WebmentionIO
class Webmentions
attr_writer :api_suffix
# Initializes a Webmention.io client, taking a WebmentionPolicy instance
# that is being used to control retry behaviour, a NetworkClient instance
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/config.rb | lib/jekyll/config.rb | # frozen_string_literal: true
module Jekyll
module WebmentionIO
class Config
module HtmlProofer
NONE = 'none'
ALL = 'all'
TEMPLATES = 'templates'
def self.get_const(val)
constants.find { |sym| const_get(sym) == val }
end
end
module UriPolicy
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/webmention_io/version.rb | lib/jekyll/webmention_io/version.rb | # frozen_string_literal: true
module Jekyll
module WebmentionIO
VERSION = '4.1.0'
end
end
| ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/webmention_io/js_handler.rb | lib/jekyll/webmention_io/js_handler.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
module Jekyll
module WebmentionIO
class JSHandler
def render
if WebmentionIO.config.js.disabled?
WebmentionIO.log 'info',
'JavaScri... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/webmention_io/webmention_item.rb | lib/jekyll/webmention_io/webmention_item.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmention into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
module Jekyll
module WebmentionIO
class Webment... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/commands/webmention.rb | lib/jekyll/commands/webmention.rb | # frozen_string_literal: true
require 'json'
module Jekyll
module WebmentionIO
module Commands
class WebmentionCommand < Command
def self.init_with_program(prog)
prog.command(:webmention) do |c|
c.syntax 'webmention'
c.description 'Sends queued webmentions'
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/bookmarks.rb | lib/jekyll/tags/bookmarks.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_bookmarks post.url %}
#
module Je... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/reposts.rb | lib/jekyll/tags/reposts.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_reposts post.url %}
#
module Jeky... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/webmentions_head.rb | lib/jekyll/tags/webmentions_head.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# Stuff for the `head`
#
module Jekyll
module WebmentionIO
class WebmentionHeadTag < Liquid::Tag
def render(context)
head = +'' # unfrozen String
head << '<lin... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/webmention.rb | lib/jekyll/tags/webmention.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# Base webmention tag
#
require 'htmlbeautifier'
module Jekyll
module WebmentionIO
class WebmentionTag < Liquid::Tag
def lookup(context, name)
lookup = context
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/count.rb | lib/jekyll/tags/count.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_count post.url [ bookmarks | like... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/likes.rb | lib/jekyll/tags/likes.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_likes post.url %}
#
module Jekyll... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/replies.rb | lib/jekyll/tags/replies.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_replies post.url %}
#
module Jeky... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/posts.rb | lib/jekyll/tags/posts.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_posts post.url %}
#
module Jekyll... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/rsvps.rb | lib/jekyll/tags/rsvps.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_rsvps post.url %}
#
module Jekyll... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/webmentions_js.rb | lib/jekyll/tags/webmentions_js.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# JS stuff
#
module Jekyll
module WebmentionIO
class WebmentionJSTag < Liquid::Tag
def render(_context)
WebmentionIO.js_handler.render
end
end
end
end
Liq... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/webmentions.rb | lib/jekyll/tags/webmentions.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmentions post.url [ bookmarks | likes | l... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/webmention_type.rb | lib/jekyll/tags/webmention_type.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/
#
module Jekyll
module WebmentionIO
# Superclass for Webmention types:
... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/tags/links.rb | lib/jekyll/tags/links.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# this liquid plugin insert a webmentions into your Octopress or Jekyll blog
# using http://webmention.io/ and the following syntax:
#
# {% webmention_links post.url %}
#
module Jekyll... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/generators/gather_webmentions.rb | lib/jekyll/generators/gather_webmentions.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# This generator gathers webmentions of your pages
#
require 'time'
require_relative '../caches'
module Jekyll
module WebmentionIO
class GatherWebmentions < Generator
safe tr... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/generators/queue_webmentions.rb | lib/jekyll/generators/queue_webmentions.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# This generator caches sites you mention so they can be mentioned
#
require 'jsonpath'
module Jekyll
module WebmentionIO
class QueueWebmentions < Generator
safe true
p... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
aarongustafson/jekyll-webmention_io | https://github.com/aarongustafson/jekyll-webmention_io/blob/a4a473e5eb7170e9e27623481287774817955c56/lib/jekyll/generators/compile_js.rb | lib/jekyll/generators/compile_js.rb | # frozen_string_literal: true
# (c) Aaron Gustafson
# https://github.com/aarongustafson/jekyll-webmention_io
# Licence : MIT
#
# This generator gathers webmentions of your pages
#
require 'uglifier'
require 'fileutils'
require 'active_support'
module Jekyll
module WebmentionIO
class JavaScriptFile < Static... | ruby | MIT | a4a473e5eb7170e9e27623481287774817955c56 | 2026-01-04T17:39:33.821659Z | false |
diogot/danger-xcode_summary | https://github.com/diogot/danger-xcode_summary/blob/435463e932e8076f4a104db555c25571c20ad32d/spec/xcode_summary_spec.rb | spec/xcode_summary_spec.rb | # frozen_string_literal: true
# rubocop:disable Layout/LineLength
require File.expand_path('spec_helper', __dir__)
module Danger
describe Danger::DangerXcodeSummary do
it 'should be a plugin' do
expect(Danger::DangerXcodeSummary.new(nil)).to be_a Danger::Plugin
end
describe 'with Dangerfile' do
... | ruby | MIT | 435463e932e8076f4a104db555c25571c20ad32d | 2026-01-04T17:39:41.147732Z | false |
diogot/danger-xcode_summary | https://github.com/diogot/danger-xcode_summary/blob/435463e932e8076f4a104db555c25571c20ad32d/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'pathname'
ROOT = Pathname.new(File.expand_path('..', __dir__))
$LOAD_PATH.unshift("#{ROOT}lib")
$LOAD_PATH.unshift("#{ROOT}spec")
require 'bundler/setup'
require 'pry'
require 'rspec'
require 'danger'
require 'danger_plugin'
# Use coloured output, it's the best.
RSpec.configu... | ruby | MIT | 435463e932e8076f4a104db555c25571c20ad32d | 2026-01-04T17:39:41.147732Z | false |
diogot/danger-xcode_summary | https://github.com/diogot/danger-xcode_summary/blob/435463e932e8076f4a104db555c25571c20ad32d/lib/danger_plugin.rb | lib/danger_plugin.rb | # frozen_string_literal: true
require 'xcode_summary/plugin'
| ruby | MIT | 435463e932e8076f4a104db555c25571c20ad32d | 2026-01-04T17:39:41.147732Z | false |
diogot/danger-xcode_summary | https://github.com/diogot/danger-xcode_summary/blob/435463e932e8076f4a104db555c25571c20ad32d/lib/danger_xcode_summary.rb | lib/danger_xcode_summary.rb | # frozen_string_literal: true
require 'xcode_summary/gem_version'
| ruby | MIT | 435463e932e8076f4a104db555c25571c20ad32d | 2026-01-04T17:39:41.147732Z | false |
diogot/danger-xcode_summary | https://github.com/diogot/danger-xcode_summary/blob/435463e932e8076f4a104db555c25571c20ad32d/lib/xcode_summary/plugin.rb | lib/xcode_summary/plugin.rb | # frozen_string_literal: true
require 'json'
require 'xcresult'
module Danger
# Shows all build errors, warnings and unit tests results generated from `xcodebuild`.
# You need to use the `xcresult` produced by Xcode 11. It's located in the Derived Data folder.
# @example Showing summary
#
# xcode_s... | ruby | MIT | 435463e932e8076f4a104db555c25571c20ad32d | 2026-01-04T17:39:41.147732Z | false |
diogot/danger-xcode_summary | https://github.com/diogot/danger-xcode_summary/blob/435463e932e8076f4a104db555c25571c20ad32d/lib/xcode_summary/gem_version.rb | lib/xcode_summary/gem_version.rb | # frozen_string_literal: true
module XcodeSummary
VERSION = '1.5.0'
end
| ruby | MIT | 435463e932e8076f4a104db555c25571c20ad32d | 2026-01-04T17:39:41.147732Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/test/test_helper.rb | test/test_helper.rb | $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'minitest/autorun'
| ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/test/plugins/aws_access_token_test.rb | test/plugins/aws_access_token_test.rb | require_relative '../test_helper'
require 'plugins/base_plugin'
require 'plugins/aws_access_token'
describe Vcsmap::Plugin::AwsAccessToken do
let(:plugin) { Vcsmap::Plugin::AwsAccessToken.new }
let(:file) do
<<-eos
[contoso]
aws_access_key_id = AKIAED8B369A90EDAB2A
aws_secret_access_key = E... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap.rb | lib/vcsmap.rb | require 'http'
require 'yaml'
require 'nokogiri'
# TODO: include only if needed
require_relative 'vcsmap/cli'
require_relative 'vcsmap/csv_writer'
require_relative 'vcsmap/progress_bar'
require_relative 'vcsmap/helpers'
require_relative 'vcsmap/plugin'
require_relative 'vcsmap/plugin_list'
require_relative 'vcsmap/pr... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/provider.rb | lib/vcsmap/provider.rb | module Vcsmap
module Provider
end
end
| ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugin.rb | lib/vcsmap/plugin.rb | module Vcsmap
module Plugin
end
end
| ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/helpers.rb | lib/vcsmap/helpers.rb | module Vcsmap
module Helpers
def self.project_directory
File.dirname(File.dirname(__FILE__)).to_s
end
end
end
| ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/cli.rb | lib/vcsmap/cli.rb | require 'tty'
module Vcsmap
class CLI
def initialize(arguments)
@command = arguments[0]
@plugin = arguments[1]
@pages = arguments[2]
@output = arguments[3]
end
def run
case @command
when 'list'
list_plugins
when 'run'
run_plugin(@output === '--no... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/csv_writer.rb | lib/vcsmap/csv_writer.rb | require 'csv'
module Vcsmap
class CsvWriter
def initialize(plugin_name, plugin_header, data)
@file_path = file_path(plugin_name)
@header = header(plugin_header)
@data = data
end
def write!
puts "Writing CSV to #{@file_path} ..."
CSV.open(@file_path, 'wb', force_quotes: true... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/progress_bar.rb | lib/vcsmap/progress_bar.rb | require 'tty'
module Vcsmap
class ProgressBar
def initialize(count)
@bar = TTY::ProgressBar.new("Loading #{count} possible results [:bar]", total: count)
end
def step
@bar.advance
end
def clear
print "\r"
$stdout.flush
end
end
end
| ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugin_list.rb | lib/vcsmap/plugin_list.rb | module Vcsmap
class PluginList
PLUGINS = {
aws: {
title: 'AWS access key',
description: 'Extracts AWS credentials from config and credentials files.',
class_name: 'Vcsmap::Plugin::AwsAccessToken'
},
wordpress_config: {
title: 'Wordpress configuration files',
... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/github_sublimesettings.rb | lib/vcsmap/plugins/github_sublimesettings.rb | module Vcsmap
module Plugin
class GithubSublimesettings < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'filename:GitHub.sublime-settings+github_token'
@token_regex = /(?:\"|')github_token(?:\"|')\:(?:\ |)(?:\"|')(.*?)(?:\"|')/i
end
def credentials(file)
@to... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/instagram_tokens.rb | lib/vcsmap/plugins/instagram_tokens.rb | module Vcsmap
module Plugin
class InstagramTokens < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'instagram+access_token'
@access_token_regex = /([0-9]{9,10}\.[a-f0-9]{7}\.[a-f0-9]{31,32})/
end
def credentials(file)
@access_token = capture_match(@access_tok... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/facebook_client_secrets.rb | lib/vcsmap/plugins/facebook_client_secrets.rb | module Vcsmap
module Plugin
class FacebookClientSecrets < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'filename:fb_client_secrets.json+app_secret'
@app_id_regex = /(?:\"|')app_id(?:\"|')\:(?:\ |)(?:\"|')(.*?)(?:\"|')/i
@app_secret_regex = /(?:\"|')app_secret(?:\"|')\:(... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/solr_dataconfig.rb | lib/vcsmap/plugins/solr_dataconfig.rb | module Vcsmap
module Plugin
class SolrDataconfig < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'filename:dataConfig.xml+dataSource+JdbcDataSource+password'
@url_regex = /url=\"(jdbc(.*?))\"/
@username_regex = /user=\"(.*?)\"/
@password_regex = /password=\"(.*?)... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/wordpress_config.rb | lib/vcsmap/plugins/wordpress_config.rb | module Vcsmap
module Plugin
class WordpressConfig < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'filename:wp-config.php+DB_PASSWORD'
@host_regex = /(?:\'|\")DB_HOST(?:\'|\")\,(?:\ |)(?:\'|\")(.*?)(?:\'|\")/i
@username_regex = /(?:\'|\")DB_USER(?:\'|\")\,(?:\ |)(?:\'|\"... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/aws_access_token.rb | lib/vcsmap/plugins/aws_access_token.rb | module Vcsmap
module Plugin
class AwsAccessToken < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = ['aws_secret_access_key',
'filename:config',
'filename:credentials'].join('+')
@access_key_id_regex = /=\s+(AKIA[0-9A-Z]{16})/
... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/base_plugin.rb | lib/vcsmap/plugins/base_plugin.rb | module Vcsmap
module Plugin
class BasePlugin
attr_reader :search_string
def capture_match(regex, file)
match = regex.match(clean_file(file))
return '' if match.nil?
match.captures.first
end
private
def clean_file(file)
file.scrub
end
end
... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/google_oauth.rb | lib/vcsmap/plugins/google_oauth.rb | module Vcsmap
module Plugin
class GoogleOauth < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'filename:client_secrets.json+.apps.googleusercontent.com'
@client_id_regex = /(?:\"|')client_id(?:\"|')\:(?:\ |)(?:\"|')(.*?)(?:\"|')/i
@client_secret_regex = /(?:\"|')client_s... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/plugins/filezilla_xml.rb | lib/vcsmap/plugins/filezilla_xml.rb | module Vcsmap
module Plugin
class FilezillaXml < Vcsmap::Plugin::BasePlugin
def initialize
@search_string = 'filename:filezilla.xml+Pass'
@host_regex = /<Host>(.*)<\/Host>/
@username_regex = /<User>(.*)<\/User>/
@password_regex = /<Pass>(.*)<\/Pass>/
@encoded_password... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
melvinsh/vcsmap | https://github.com/melvinsh/vcsmap/blob/3889964bf23e05efabca8d4400d48aae49a3ac6c/lib/vcsmap/providers/github.rb | lib/vcsmap/providers/github.rb | module Vcsmap
module Provider
class GitHub
def initialize
@cookie = get_cookie
end
def search(plugin, total_pages)
result_urls = []
@query = plugin.search_string
(1..total_pages).each do |page|
result_urls += get_results_from_page(page)
end
... | ruby | MIT | 3889964bf23e05efabca8d4400d48aae49a3ac6c | 2026-01-04T17:39:48.818919Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/setup.rb | setup.rb | #
# setup.rb
#
# Copyright (c) 2000-2005 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
module Enumerable
alias map collect
end
end
un... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | true |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/bench/04_select_prepare.rb | bench/04_select_prepare.rb | m = Mysql.connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT, MYSQL_SOCKET)
p = m.prepare((['select * from bench_test']*100).join(' union all '))
10.times do
p.execute.each{}
end
| ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/bench/05_many_query.rb | bench/05_many_query.rb | m = Mysql.connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT, MYSQL_SOCKET)
100000.times do
m.query('set @a=1')
end
| ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/bench/01_insert.rb | bench/01_insert.rb | my = Mysql.connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT, MYSQL_SOCKET)
my.query(<<EOF)
create temporary table test (
tiny tinyint,
utiny tinyint unsigned,
small smallint,
usmall smallint unsigned,
medium mediumint,
umedium mediumint unsigned,
i int,
ui int unsigned,
big... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/bench/02_insert_prepare.rb | bench/02_insert_prepare.rb | my = Mysql.connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT, MYSQL_SOCKET)
my.query(<<EOF)
create temporary table test (
tiny tinyint,
utiny tinyint unsigned,
small smallint,
usmall smallint unsigned,
medium mediumint,
umedium mediumint unsigned,
i int,
ui int unsigned,
big... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/bench/run.rb | bench/run.rb | require 'mysql'
class Mysql::Result
include Enumerable
end
MYSQL_SERVER = ENV['MYSQL_SERVER']
MYSQL_USER = ENV['MYSQL_USER']
MYSQL_PASSWORD = ENV['MYSQL_PASSWORD']
MYSQL_DATABASE = ENV['MYSQL_DATABASE'] || 'test'
MYSQL_PORT = ENV['MYSQL_PORT']
MYSQL_SOCKET = ENV['MYSQL_SOCKET']
m = Mysql.connect(MYSQL_S... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/bench/03_select.rb | bench/03_select.rb | m = Mysql.connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT, MYSQL_SOCKET)
10.times do
m.query((['select * from bench_test']*100).join(' union all ')).each{}
end
| ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/test/test_mysql_packet.rb | test/test_mysql_packet.rb | # coding: binary
require 'test/unit'
require 'test/unit/rr'
begin
require 'test/unit/notify'
rescue LoadError
# ignore
end
require 'mysql'
class TestMysqlPacket < Test::Unit::TestCase
def self._(s)
s.unpack('H*').first
end
def subject
Mysql::Packet.new(data)
end
sub_test_case '#lcb' do
[
... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/test/test_mysql.rb | test/test_mysql.rb | # -*- coding: utf-8 -*-
require 'test/unit'
require 'test/unit/rr'
begin
require 'test/unit/notify'
rescue LoadError
# ignore
end
require 'mysql'
# MYSQL_USER must have ALL privilege for MYSQL_DATABASE.* and RELOAD privilege for *.*
MYSQL_SERVER = ENV['MYSQL_SERVER']
MYSQL_USER = ENV['MYSQL_USER']
MYSQL_PAS... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | true |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql.rb | lib/mysql.rb | # coding: ascii-8bit
# Copyright (C) 2008 TOMITA Masahiro
# mailto:tommy@tmtm.org
require 'uri'
# MySQL connection class.
# @example
# my = Mysql.connect('hostname', 'user', 'password', 'dbname')
# res = my.query 'select col1,col2 from tbl where id=123'
# res.each do |c1, c2|
# p c1, c2
# end
class Mysql
re... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/packet.rb | lib/mysql/packet.rb | # coding: ascii-8bit
class Mysql
class Packet
# convert Numeric to LengthCodedBinary
def self.lcb(num)
return "\xfb" if num.nil?
return [num].pack("C") if num < 251
return [252, num].pack("Cv") if num < 65536
return [253, num&0xffff, num>>16].pack("CvC") if num < 16777216
return ... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/authenticator.rb | lib/mysql/authenticator.rb | class Mysql
class Authenticator
@plugins = {}
# @param plugin [String]
def self.plugin_class(plugin)
return @plugins[plugin] if @plugins[plugin]
raise ClientError, "invalid plugin name: #{plugin}" unless plugin.match?(/\A\w+\z/)
begin
require_relative "authenticator/#{plugin}"
... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/constants.rb | lib/mysql/constants.rb | # coding: ascii-8bit
# Copyright (C) 2003 TOMITA Masahiro
# mailto:tommy@tmtm.org
class Mysql
# Command
COM_SLEEP = 0
COM_QUIT = 1
COM_INIT_DB = 2
COM_QUERY = 3
COM_FIELD_LIST = 4
COM_CREATE_DB = 5
COM_DROP_DB = 6
C... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/protocol.rb | lib/mysql/protocol.rb | # coding: ascii-8bit
# Copyright (C) 2008 TOMITA Masahiro
# mailto:tommy@tmtm.org
require "socket"
require "stringio"
require "openssl"
require_relative 'authenticator.rb'
class Mysql
# MySQL network protocol
class Protocol
VERSION = 10
MAX_PACKET_LENGTH = 2**24-1
# Convert netdata to Ruby value
... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/charset.rb | lib/mysql/charset.rb | # coding: ascii-8bit
# Copyright (C) 2008-2012 TOMITA Masahiro
# mailto:tommy@tmtm.org
#
class Mysql
# @!attribute [r] number
# @private
# @!attribute [r] name
# @return [String] charset name
# @!attribute [r] csname
# @return [String] collation name
class Charset
# @private
# @param [Integ... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/error.rb | lib/mysql/error.rb | # coding: ascii-8bit
# Copyright (C) 2003-2010 TOMITA Masahiro
# mailto:tommy@tmtm.org
class Mysql
class Error < StandardError
ERRNO = 0
def self.define_error_class(prefix_re)
self.constants.each do |errname|
errname = errname.to_s
next unless errname =~ prefix_re
errno = self.... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | true |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/authenticator/mysql_native_password.rb | lib/mysql/authenticator/mysql_native_password.rb | require 'digest/sha1'
class Mysql
class Authenticator
class MysqlNativePassword
# @param protocol [Mysql::Protocol]
def initialize(protocol)
@protocol = protocol
end
# @return [String]
def name
'mysql_native_password'
end
# @param passwd [String]
... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/authenticator/caching_sha2_password.rb | lib/mysql/authenticator/caching_sha2_password.rb | require 'digest/sha2'
class Mysql
class Authenticator
class CachingSha2Password
# @param protocol [Mysql::Protocol]
def initialize(protocol)
@protocol = protocol
end
# @return [String]
def name
'caching_sha2_password'
end
# @param passwd [String]
... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
tmtm/ruby-mysql | https://github.com/tmtm/ruby-mysql/blob/1cca6a22e768a7acb8f570712148268cd064758f/lib/mysql/authenticator/sha256_password.rb | lib/mysql/authenticator/sha256_password.rb | require 'openssl'
class Mysql
class Authenticator
class Sha256Password
# @param protocol [Mysql::Protocol]
def initialize(protocol)
@protocol = protocol
end
# @return [String]
def name
'sha256_password'
end
# @param passwd [String]
# @param scramb... | ruby | MIT | 1cca6a22e768a7acb8f570712148268cd064758f | 2026-01-04T17:39:52.900723Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/doc.rb | doc.rb | class Store
# Returns the value of a key.
# @example
# Store['foo']
# #=> 42
def self.[](key); end
# Sets a value for a key.
# @example
# Store['foo'] = 42
def self.[]=(key, value); end
# Deletes a key from storage.
# @example
# Store.delete('foo')
def self.delete(key); end
# Retu... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/store/cocoa/store.rb | flow/store/cocoa/store.rb | class Store
def self.[](key)
_storage.objectForKey(key.to_s)
end
def self.[]=(key, value)
_storage.setObject(value, forKey:key.to_s)
end
def self.delete(key)
_storage.removeObjectForKey(key.to_s)
end
def self.all
_storage.dictionaryRepresentation
end
def self._storage
NSUserDef... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/store/android/store.rb | flow/store/android/store.rb | class Store
DoesNotExist = '<____does_not_exist____>'
def self.[](key)
val = _storage.getString(key.to_s, DoesNotExist)
val == DoesNotExist ? nil : JSON.load(val)
end
def self.[]=(key, value)
editor = _storage.edit
editor.putString(key.to_s, value.to_json)
editor.commit
end
def self.de... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/json/cocoa/json.rb | flow/json/cocoa/json.rb | class JSON
def self.load(string)
error_ptr = Pointer.new(:id)
obj = NSJSONSerialization.JSONObjectWithData(string.dataUsingEncoding(NSUTF8StringEncoding), options:0, error:error_ptr)
if obj == nil
raise error_ptr[0].description
end
obj
end
end
class Object
def to_json
raise "Invalid... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/json/android/json.rb | flow/json/android/json.rb | class JSON
def self.load(str)
tok = Org::JSON::JSONTokener.new(str)
obj = tok.nextValue
if obj == nil
raise "Can't deserialize object from JSON"
end
# Transform pure-Java JSON objects to Ruby types.
convert_java(obj)
end
def self.convert_java(obj)
case obj
when Org::JSON:... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/actions.rb | flow/net/actions.rb | module Net
class Request
module Actions
[:get, :post, :put, :delete, :patch, :options, :head].each do |http_method|
define_method(http_method) do |base_url, *options, callback|
options = options.shift || {}
request = Request.new(base_url, options.merge(method: http_method))
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/session.rb | flow/net/session.rb | module Net
class Session
attr_reader :authorization
def initialize(base_url, &block)
@base_url = base_url
@authorization = false
@headers = []
self.instance_eval(&block)
end
def self.build(base_url, &block)
new(base_url, &block)
end
[:get, :post, :put, :delete,... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/response.rb | flow/net/response.rb | module Net
class Response
attr_accessor :options, :mock
def initialize(options = {})
@options = options
@headers = options[:headers]
@mock = false
end
def status
options[:status_code]
end
def status_message
options[:status_message]
end
def mime_type
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/expectation.rb | flow/net/expectation.rb | module Net
class Expectation
attr_reader :response
attr_reader :url
def initialize(url)
@url = url
end
def and_return(response)
@response = response
end
def response
@response.mock = true
@response
end
def matches?(request)
url_match?(request.base_... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/config.rb | flow/net/config.rb | module Net
module Config
USER_AGENT = "Flow - https://github.com/HipByte/flow"
class << self
attr_accessor :user_agent
attr_accessor :connect_timeout
attr_accessor :read_timeout
def user_agent
@user_agent ||= Net::Config::USER_AGENT
end
def connect_timeout
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/authorization.rb | flow/net/authorization.rb | module Net
class Authorization
def initialize(options = {})
@options = options
if !basic? && !token?
raise "Invalid arguments given for Authorization"
end
end
def to_s
if basic?
base_64 = Base64.encode("#{username}:#{password}")
return "Basic #{base_64}"
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/header.rb | flow/net/header.rb | module Net
class Header
SHORTHANDS = {
content_type: 'Content-Type',
accept: 'Accept',
json: 'application/json'
}
attr_reader :field, :value
def initialize(field, value)
@field = SHORTHANDS.fetch(field, field)
@value = SHORTHANDS.fetch(value, value)
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/net.rb | flow/net/net.rb | module Net
class << self
def build(base_url, &block)
Session.build(base_url, &block)
end
def reachable?(hostname = 'www.google.com', &block)
Reachability.new(hostname, &block)
end
def stub(base_url)
expectation = Expectation.all.find{ |e| e.base_url == base_url }
if expec... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/mime_types.rb | flow/net/mime_types.rb | module Net
module MimeTypes
JSON = %w(
application/json
application/vnd.api+json
)
def self.json
JSON
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.