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 |
|---|---|---|---|---|---|---|---|---|
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source.rb | lib/html2rss/auto_source.rb | # frozen_string_literal: true
require 'parallel'
require 'dry-validation'
module Html2rss
##
# The AutoSource class automatically extracts articles from a given URL by
# utilizing a collection of Scrapers. These scrapers analyze and
# parse popular structured data formats—such as schema, microdata, and
# op... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rss_builder.rb | lib/html2rss/rss_builder.rb | # frozen_string_literal: true
require 'rss'
module Html2rss
##
# Builds an RSS Feed by providing channel, articles and stylesheets.
class RssBuilder
class << self
def add_item(article, item_maker)
add_item_string_values(article, item_maker)
add_item_categories(article, item_maker)
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/html_navigator.rb | lib/html2rss/html_navigator.rb | # frozen_string_literal: true
module Html2rss
##
# HtmlNavigator provides methods to navigate through HTML nodes.
class HtmlNavigator
class << self
##
# Returns the first parent that satisfies the condition.
# If the condition is met, it returns the node itself.
#
# @param node ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering.rb | lib/html2rss/rendering.rb | # frozen_string_literal: true
module Html2rss
# Namespace for HTML rendering logic, used to generate rich content such as
# images, audio, video, or embedded documents for feed descriptions.
#
# @example
# Html2rss::Rendering::ImageRenderer.new(...).to_html
# Html2rss::Rendering::MediaRenderer.for(...)... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/url.rb | lib/html2rss/url.rb | # frozen_string_literal: true
require 'addressable/uri'
require 'cgi'
module Html2rss
##
# A value object representing a resolved, absolute URL with built-in operations.
# Provides URL resolution, sanitization, and titleization capabilities.
#
# @example Creating a URL from a relative path
# url = Url.f... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/cli.rb | lib/html2rss/cli.rb | # frozen_string_literal: true
require 'thor'
##
# The Html2rss namespace / command line interface.
module Html2rss
##
# The Html2rss command line interface.
class CLI < Thor
check_unknown_options!
def self.exit_on_failure?
true
end
desc 'feed YAML_FILE [feed_name]', 'Print RSS built from... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors.rb | lib/html2rss/selectors.rb | # frozen_string_literal: true
require 'nokogiri'
module Html2rss
##
# This scraper is designed to scrape articles from a given HTML page using CSS
# selectors defined in the feed config.
#
# It supports the traditional feed configs that html2rss originally provided,
# ensuring compatibility with existing ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/config.rb | lib/html2rss/config.rb | # frozen_string_literal: true
require 'yaml'
module Html2rss
##
# The provided configuration is used to generate the RSS feed.
# This class provides methods to load and process configuration from a YAML file,
# supporting both single and multiple feed configurations.
#
# Configuration is validated during ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/error.rb | lib/html2rss/error.rb | # frozen_string_literal: true
module Html2rss
# The Html2rss::Error base class.
class Error < StandardError; end
end
| ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/cleanup.rb | lib/html2rss/auto_source/cleanup.rb | # frozen_string_literal: true
module Html2rss
class AutoSource
##
# Cleanup is responsible for cleaning up the extracted articles.
# :reek:MissingSafeMethod { enabled: false }
# It applies various strategies to filter and refine the article list.
class Cleanup
DEFAULT_CONFIG = {
kee... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper.rb | lib/html2rss/auto_source/scraper.rb | # frozen_string_literal: true
module Html2rss
class AutoSource
##
# The Scraper module contains all scrapers that can be used to extract articles.
# Each scraper should implement a `call` method that returns an array of article hashes.
# Each scraper should also implement an `articles?` method that r... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/semantic_html.rb | lib/html2rss/auto_source/scraper/semantic_html.rb | # frozen_string_literal: true
require 'parallel'
module Html2rss
class AutoSource
module Scraper
##
# Scrapes articles by looking for common markup tags (article, section, li)
# containing an <a href> tag.
#
# See:
# 1. https://developer.mozilla.org/en-US/docs/Web/HTML/Elemen... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/rss_feed_detector.rb | lib/html2rss/auto_source/scraper/rss_feed_detector.rb | # frozen_string_literal: true
module Html2rss
class AutoSource
module Scraper
##
# Detects RSS, Atom, and JSON feeds in HTML link tags and creates articles for them.
# This scraper is used as a fallback when no other scrapers can find articles.
#
# Features:
# - Detects RSS, A... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/json_state.rb | lib/html2rss/auto_source/scraper/json_state.rb | # frozen_string_literal: true
require 'json'
module Html2rss
class AutoSource
module Scraper
#
# Scrapes JSON state blobs embedded in script tags such as Next.js, Nuxt,
# or custom window globals. The scraper searches `<script type="application/json">`
# tags and well-known JavaScript gl... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/schema.rb | lib/html2rss/auto_source/scraper/schema.rb | # frozen_string_literal: true
require 'json'
require 'nokogiri'
module Html2rss
class AutoSource
module Scraper
##
# Scrapes articles from Schema.org objects, by looking for the objects in:
# <script type="application/ld+json"> "schema" tags.
#
# See:
# 1. https://schema.org... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/html.rb | lib/html2rss/auto_source/scraper/html.rb | # frozen_string_literal: true
require 'nokogiri'
module Html2rss
class AutoSource
module Scraper
##
# Scrapes articles from HTML pages by
# finding similar structures around anchor tags in the parsed_body.
class Html
include Enumerable
TAGS_TO_IGNORE = /(nav|footer|heade... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/schema/category_extractor.rb | lib/html2rss/auto_source/scraper/schema/category_extractor.rb | # frozen_string_literal: true
module Html2rss
class AutoSource
module Scraper
class Schema
##
# Extracts categories from Schema.org structured data.
module CategoryExtractor
##
# Extracts categories from a schema object.
#
# @param schema_obje... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/schema/item_list.rb | lib/html2rss/auto_source/scraper/schema/item_list.rb | # frozen_string_literal: true
module Html2rss
class AutoSource
module Scraper
class Schema
##
# Handles schema.org ItemList objects, which contain
# 1. itemListElements, and/or
# 2. interesting attributes, i.e. description, url, image, itself.
#
# @see https:... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/schema/thing.rb | lib/html2rss/auto_source/scraper/schema/thing.rb | # frozen_string_literal: true
require 'date'
module Html2rss
class AutoSource
module Scraper
class Schema
##
# A Thing is kind of the 'base class' for Schema.org schema_objects.
#
# @see https://schema.org/Thing
class Thing
SUPPORTED_TYPES = %w[
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/auto_source/scraper/schema/list_item.rb | lib/html2rss/auto_source/scraper/schema/list_item.rb | # frozen_string_literal: true
module Html2rss
class AutoSource
module Scraper
class Schema
##
#
# @see https://schema.org/ListItem
class ListItem < Thing
def id = (id = (schema_object.dig(:item, :@id) || super).to_s).empty? ? nil : id
def title =... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/pdf_renderer.rb | lib/html2rss/rendering/pdf_renderer.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
module Rendering
# Renders an HTML <iframe> for PDF documents.
class PdfRenderer
def initialize(url:)
@url = url
end
def to_html
%(<iframe src="#{escaped_url}" width="100%" height="75vh"
sandbox=... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/video_renderer.rb | lib/html2rss/rendering/video_renderer.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
module Rendering
# Renders an HTML <video> tag from a URL and type.
class VideoRenderer
def initialize(url:, type:)
@url = url
@type = type
end
def to_html
%(<video controls preload="none" referrerpolicy="... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/image_renderer.rb | lib/html2rss/rendering/image_renderer.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
module Rendering
# Renders an HTML <img> tag from a URL and title.
class ImageRenderer
def initialize(url:, title:)
@url = url
@title = title
end
def to_html
%(<img src="#{@url}"
alt="#{escap... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/media_table_renderer.rb | lib/html2rss/rendering/media_table_renderer.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
module Rendering
# Renders a collapsible table of all available media resources.
#
# Creates an HTML <details><summary> section with a table listing
# all enclosures and fallback images found for an article.
#
# @example Basic usage... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/audio_renderer.rb | lib/html2rss/rendering/audio_renderer.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
module Rendering
# Renders an HTML <audio> tag from a URL and type.
class AudioRenderer
def initialize(url:, type:)
@url = url
@type = type
end
def to_html
%(<audio controls preload="none" referrerpolicy="... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/media_renderer.rb | lib/html2rss/rendering/media_renderer.rb | # frozen_string_literal: true
module Html2rss
module Rendering
# Picks the appropriate media renderer based on the enclosure type or fallback image.
#
# Factory class that creates the correct renderer for different media types.
# Supports images, audio, video, and PDF documents.
#
# @example ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rendering/description_builder.rb | lib/html2rss/rendering/description_builder.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
module Rendering
# Builds a sanitized article description from the base text, title, and optional media.
#
# Combines media elements (images, audio, video, PDFs) with sanitized text content
# to create rich RSS descriptions that reveal more... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/request_service/strategy.rb | lib/html2rss/request_service/strategy.rb | # frozen_string_literal: true
module Html2rss
class RequestService
##
# Defines the interface of every request strategy.
class Strategy
##
# @param ctx [Context] the context for the request
def initialize(ctx)
@ctx = ctx
end
##
# Executes the request.
# ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/request_service/response.rb | lib/html2rss/request_service/response.rb | # frozen_string_literal: true
require 'nokogiri'
module Html2rss
class RequestService
##
# To be used by strategies to provide their response.
class Response
##
# @param body [String] the body of the response
# @param headers [Hash] the headers of the response
def initialize(body... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/request_service/faraday_strategy.rb | lib/html2rss/request_service/faraday_strategy.rb | # frozen_string_literal: true
require 'faraday'
require 'faraday/follow_redirects'
require 'faraday/gzip'
module Html2rss
class RequestService
##
# Strategy to use Faraday for the request.
# @see https://rubygems.org/gems/faraday
class FaradayStrategy < Strategy
# return [Response]
def e... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/request_service/puppet_commander.rb | lib/html2rss/request_service/puppet_commander.rb | # frozen_string_literal: true
module Html2rss
class RequestService
##
# Commands the Puppeteer Browser to the website and builds the Response.
class PuppetCommander
# @param ctx [Context]
# @param browser [Puppeteer::Browser]
# @param skip_request_resources [Set<String>] the resource ty... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/request_service/context.rb | lib/html2rss/request_service/context.rb | # frozen_string_literal: true
module Html2rss
class RequestService
##
# Holds information needed to send requests to websites.
# To be passed down to the RequestService's strategies.
class Context
##
# @param url [String, Html2rss::Url] the URL to request
# @param headers [Hash] HTT... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/request_service/browserless_strategy.rb | lib/html2rss/request_service/browserless_strategy.rb | # frozen_string_literal: true
require 'puppeteer'
module Html2rss
class RequestService
##
# Browserless.io strategy to request websites.
#
# Provide the WebSocket URL and your API token via environment variables:
# - BROWSERLESS_IO_WEBSOCKET_URL
# - BROWSERLESS_IO_API_TOKEN
#
# To us... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/articles/deduplicator.rb | lib/html2rss/articles/deduplicator.rb | # frozen_string_literal: true
require 'set' # rubocop:disable Lint/RedundantRequireStatement
module Html2rss
module Articles
##
# Deduplicates a list of articles while preserving their original order.
#
# The deduplicator prefers each article's URL (combined with its ID when
# available) to dete... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/extractors.rb | lib/html2rss/selectors/extractors.rb | # frozen_string_literal: true
module Html2rss
class Selectors
##
# Provides a namespace for item extractors.
module Extractors
##
# Maps the extractor name to the class implementing the extractor.
#
# The key is the name to use in the feed config.
NAME_TO_CLASS = {
a... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/config.rb | lib/html2rss/selectors/config.rb | # frozen_string_literal: true
require 'dry-validation'
module Html2rss
class Selectors
##
# Validates the configuration hash for :selectors.
class Config < Dry::Validation::Contract
NESTING_KEY = :dynamic_keys_workaround
##
# Validates the configuration of the :items selector
cl... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/object_to_xml_converter.rb | lib/html2rss/selectors/object_to_xml_converter.rb | # frozen_string_literal: true
require 'cgi'
module Html2rss
class Selectors
##
# A naive implementation of "Object to XML": converts a Ruby object to XML format.
class ObjectToXmlConverter
OBJECT_TO_XML_TAGS = {
hash: ['<object>', '</object>'],
array: ['<array>', '</array>']
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors.rb | lib/html2rss/selectors/post_processors.rb | # frozen_string_literal: true
module Html2rss
class Selectors
##
# Provides a namespace for attribute post processors.
module PostProcessors
##
# Error raised when an unknown post processor name is requested.
class UnknownPostProcessorName < Html2rss::Error; end
##
# Error ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/extractors/href.rb | lib/html2rss/selectors/extractors/href.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module Extractors
##
# Returns the value of the +href+ attribute.
# It always returns absolute URLs. If the extracted +href+ value is a
# relative URL, it prepends the channel's URL.
#
# Imagine this +a+ HTML elemen... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/extractors/text.rb | lib/html2rss/selectors/extractors/text.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module Extractors
##
# Return the text content of the attribute. This is the default extractor used,
# when no extractor is explicitly given.
#
# Example HTML structure:
#
# <p>Lorem <b>ipsum</b> dolor ...... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/extractors/attribute.rb | lib/html2rss/selectors/extractors/attribute.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module Extractors
##
# Returns the value of the attribute.
#
# Imagine this +time+ HTML tag with a +datetime+ attribute:
#
# <time datetime="2019-07-01">...</time>
#
# YAML usage example:
#
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/extractors/static.rb | lib/html2rss/selectors/extractors/static.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module Extractors
##
# Returns a static value provided in the options.
#
# Example usage in YAML:
#
# selectors:
# author:
# extractor: static
# static: Foobar
#
#... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/extractors/html.rb | lib/html2rss/selectors/extractors/html.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module Extractors
##
# Returns the HTML content of the specified element.
#
# Example HTML structure:
#
# <p>Lorem <b>ipsum</b> dolor ...</p>
#
# YAML usage example:
#
# selectors:
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/parse_uri.rb | lib/html2rss/selectors/post_processors/parse_uri.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module PostProcessors
##
# Returns the URI as String.
# If the URL is relative, it builds an absolute one with the channel's URL as base.
#
# Imagine this HTML structure:
#
# <span>http://why-not-use-a-link... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/gsub.rb | lib/html2rss/selectors/post_processors/gsub.rb | # frozen_string_literal: true
require 'regexp_parser'
module Html2rss
class Selectors
module PostProcessors
##
# Imagine this HTML:
# <h1>Foo bar and boo<h1>
#
# YAML usage example:
# selectors:
# title:
# selector: h1
# post_process... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/html_to_markdown.rb | lib/html2rss/selectors/post_processors/html_to_markdown.rb | # frozen_string_literal: true
require 'reverse_markdown'
module Html2rss
class Selectors
module PostProcessors
##
# Returns HTML code as Markdown formatted String.
# Before converting to markdown, the HTML is sanitized with SanitizeHtml.
# Imagine this HTML structure:
#
# ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/base.rb | lib/html2rss/selectors/post_processors/base.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module PostProcessors
##
# All post processors must inherit from this base class and implement `self.validate_args!` and `#get`.
class Base
# Validates the presence of required options in the context
#
# @para... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/substring.rb | lib/html2rss/selectors/post_processors/substring.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module PostProcessors
##
# Returns a defined part of a String.
#
# Both parameters must be an Integer and they can be negative.
# The +end+ parameter can be omitted, in that case it will not cut the
# String at the ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/markdown_to_html.rb | lib/html2rss/selectors/post_processors/markdown_to_html.rb | # frozen_string_literal: true
require 'kramdown'
require_relative 'sanitize_html'
module Html2rss
class Selectors
module PostProcessors
##
# Generates HTML from Markdown.
#
# It's particularly useful in conjunction with the Template post processor
# to generate a description from o... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/template.rb | lib/html2rss/selectors/post_processors/template.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module PostProcessors
##
# Returns a formatted String according to the string pattern.
# It uses [Kernel#format](https://ruby-doc.org/core/Kernel.html#method-i-format)
#
# It supports the format pattern `%<key>s` and `%{k... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/sanitize_html.rb | lib/html2rss/selectors/post_processors/sanitize_html.rb | # frozen_string_literal: true
require 'sanitize'
require_relative 'html_transformers/transform_urls_to_absolute_ones'
require_relative 'html_transformers/wrap_img_in_a'
module Html2rss
class Selectors
module PostProcessors
##
# Returns sanitized HTML code as String.
#
# It sanitizes by u... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/parse_time.rb | lib/html2rss/selectors/post_processors/parse_time.rb | # frozen_string_literal: true
require 'time'
require 'tzinfo'
module Html2rss
class Selectors
module PostProcessors
##
# Returns the {https://www.w3.org/Protocols/rfc822/ RFC822} representation of a time.
#
# Imagine this HTML structure:
#
# <p>Published on <span>2019-07-... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/html_transformers/transform_urls_to_absolute_ones.rb | lib/html2rss/selectors/post_processors/html_transformers/transform_urls_to_absolute_ones.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module PostProcessors
module HtmlTransformers
##
# Transformer that converts relative URLs to absolute URLs within specified HTML elements.
class TransformUrlsToAbsoluteOnes
URL_ELEMENTS_WITH_URL_ATTRIBUTE = {
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/selectors/post_processors/html_transformers/wrap_img_in_a.rb | lib/html2rss/selectors/post_processors/html_transformers/wrap_img_in_a.rb | # frozen_string_literal: true
module Html2rss
class Selectors
module PostProcessors
module HtmlTransformers
##
# Transformer that wraps <img> tags into <a> tags linking to `img.src`.
class WrapImgInA
##
# Wraps <img> tags into <a> tags that link to `img.src`.
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rss_builder/channel.rb | lib/html2rss/rss_builder/channel.rb | # frozen_string_literal: true
module Html2rss
class RssBuilder
##
# Extracts channel information from
# 1. the HTML document's <head>.
# 2. the HTTP response
class Channel
DEFAULT_TTL_IN_MINUTES = 360
DEFAULT_DESCRIPTION_TEMPLATE = 'Latest items from %<url>s'
##
#
#... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rss_builder/enclosure.rb | lib/html2rss/rss_builder/enclosure.rb | # frozen_string_literal: true
require 'mime/types'
module Html2rss
class RssBuilder
##
# Represents an enclosure for an RSS item.
class Enclosure
##
# Guesses the content type based on the file extension of the URL.
#
# @param url [Html2rss::Url]
# @param default [String] d... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rss_builder/article.rb | lib/html2rss/rss_builder/article.rb | # frozen_string_literal: true
require 'zlib'
require 'sanitize'
require 'nokogiri'
module Html2rss
class RssBuilder
##
# Article is a simple data object representing an article extracted from a page.
# It is enumerable and responds to all keys specified in PROVIDED_KEYS.
class Article
include ... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/rss_builder/stylesheet.rb | lib/html2rss/rss_builder/stylesheet.rb | # frozen_string_literal: true
module Html2rss
class RssBuilder
##
# Represents a stylesheet.
class Stylesheet
class << self
##
# Adds the stylesheet XML tags to the RSS.
#
# @param maker [RSS::Maker::RSS20] RSS maker object.
# @param stylesheets [Array<Html2r... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/config/multiple_feeds_config.rb | lib/html2rss/config/multiple_feeds_config.rb | # frozen_string_literal: true
module Html2rss
class Config
# Handles multiple feeds within a single configuration hash.
# Individual feed configurations should be placed under the :feeds key,
# where each feed name is the key for its feed configuration.
# All global configuration keys (outside :feeds... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/config/request_headers.rb | lib/html2rss/config/request_headers.rb | # frozen_string_literal: true
module Html2rss
class Config
##
# Normalizes HTTP headers for outgoing requests.
# Ensures a browser-like baseline while respecting caller overrides.
class RequestHeaders
DEFAULT_ACCEPT = %w[
text/html
application/xhtml+xml
application/xml;q... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/config/validator.rb | lib/html2rss/config/validator.rb | # frozen_string_literal: true
require 'dry-validation'
module Html2rss
class Config
# Validates the configuration hash using Dry::Validation.
# The configuration options adhere to the documented schema in README.md.
class Validator < Dry::Validation::Contract
URI_REGEXP = Url::URI_REGEXP
STY... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/config/dynamic_params.rb | lib/html2rss/config/dynamic_params.rb | # frozen_string_literal: true
module Html2rss
class Config
# Processes and applies dynamic parameter formatting in configuration values.
class DynamicParams
class ParamsMissing < Html2rss::Error; end
class << self
# Recursively traverses the given value and formats any strings containing... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/html_extractor/enclosure_extractor.rb | lib/html2rss/html_extractor/enclosure_extractor.rb | # frozen_string_literal: true
module Html2rss
class HtmlExtractor
##
# Extracts enclosures from HTML tags using various strategies.
class EnclosureExtractor
def self.call(article_tag, base_url)
[
Extractors::Image,
Extractors::Media,
Extractors::Pdf,
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/html_extractor/date_extractor.rb | lib/html2rss/html_extractor/date_extractor.rb | # frozen_string_literal: true
module Html2rss
class HtmlExtractor
# Extracts the earliest date from an article_tag.
class DateExtractor
# @return [DateTime, nil]
def self.call(article_tag)
times = article_tag.css('[datetime]').filter_map do |tag|
DateTime.parse(tag['datetime'])
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
html2rss/html2rss | https://github.com/html2rss/html2rss/blob/400e796540e82a69e1f1e014b6f89c626acf32fd/lib/html2rss/html_extractor/image_extractor.rb | lib/html2rss/html_extractor/image_extractor.rb | # frozen_string_literal: true
module Html2rss
class HtmlExtractor
##
# Image is responsible for extracting image URLs the article_tag.
class ImageExtractor
def self.call(article_tag, base_url:)
img_src = from_source(article_tag) ||
from_img(article_tag) ||
... | ruby | MIT | 400e796540e82a69e1f1e014b6f89c626acf32fd | 2026-01-04T17:45:12.820049Z | false |
MiderWong/homebrew-flutter | https://github.com/MiderWong/homebrew-flutter/blob/e2e0c773ea813129b75994c9a2fe3f6f8c61c560/Formula/flutter.rb | Formula/flutter.rb | class Flutter < Formula
require 'json'
desc "Homebrew shell for Flutter"
homepage "https://flutter.io"
stable do
url "https://github.com/flutter/flutter.git", :branch => "stable"
version "stable"
end
devel do
url "https://github.com/flutter/flutter.git", :branch => "dev"
version "dev"
en... | ruby | BSD-3-Clause | e2e0c773ea813129b75994c9a2fe3f6f8c61c560 | 2026-01-04T17:45:21.142737Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift(File.dirname(__FILE__))
require 'bundler/setup'
require 'action_controller/railtie'
Bundler.require
require 'fake_app/rails_app'
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
# Dir["#{File.dirname(__FILE__)}/support/... | ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/spec/lib/methods_spec.rb | spec/lib/methods_spec.rb | require 'spec_helper'
describe '#assert_schema_conform', type: :request do
include Committee::Rails::Test::Methods
context 'when set option' do
before do
RSpec.configuration.add_setting :committee_options
RSpec.configuration.committee_options = { schema_path: Rails.root.join('schema', 'schema.yml'... | ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/spec/fake_app/rails_app.rb | spec/fake_app/rails_app.rb | FakeApp = Class.new(Rails::Application)
FakeApp.config.session_store :cookie_store, key: '_myapp_session'
FakeApp.config.eager_load = false
FakeApp.config.hosts << 'www.example.com' if FakeApp.config.respond_to?(:hosts)
FakeApp.config.root = File.dirname(__FILE__)
FakeApp.config.secret_key_base = 'secret'
FakeApp.confi... | ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/lib/committee/rails.rb | lib/committee/rails.rb | require "committee/rails/version"
require "committee/rails/test/methods"
module Committee
module Rails
# Your code goes here...
end
end
| ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/lib/committee/rails/version.rb | lib/committee/rails/version.rb | module Committee
module Rails
VERSION = "0.9.0"
end
end
| ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/lib/committee/rails/request_object.rb | lib/committee/rails/request_object.rb | require 'action_dispatch/http/request'
module Committee::Rails
class RequestObject
delegate_missing_to :@request
def initialize(request)
@request = request
end
def path
URI.parse(@request.original_fullpath).path
end
def path_info
URI.parse(@request.original_fullpath).path... | ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
willnet/committee-rails | https://github.com/willnet/committee-rails/blob/cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d/lib/committee/rails/test/methods.rb | lib/committee/rails/test/methods.rb | require 'committee'
require 'committee/rails/request_object'
module Committee::Rails
module Test
module Methods
include Committee::Test::Methods
def committee_options
if defined?(RSpec) && (options = RSpec.try(:configuration).try(:committee_options))
options
else
... | ruby | MIT | cc0d8275f285dca54e6c9b2dda7741d6c5b14c2d | 2026-01-04T17:45:20.952077Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/spec/httmultiparty_spec.rb | spec/httmultiparty_spec.rb | require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
gem 'httparty'
gem 'multipart-post'
require 'httparty'
require 'net/http/post/multipart'
describe HTTMultiParty do
let(:somefile) { File.new(File.join(File.dirname(__FILE__), 'fixtures/somefile.txt')) }
let(:somejpegfile) { File.new(File.jo... | ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/spec/spec_helper.rb | spec/spec_helper.rb | require File.join(File.dirname(__FILE__), '..', 'lib', 'httmultiparty')
require File.join(File.dirname(__FILE__), 'fixtures', 'custom_test_file')
require 'fakeweb'
def file_fixture(filename)
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename}")).read
end
Dir[File.expand_path(File.join(File.dirname(__FIL... | ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/spec/fixtures/custom_test_file.rb | spec/fixtures/custom_test_file.rb | class CustomTestFile < File; end
| ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/spec/httmultiparty/request_spec.rb | spec/httmultiparty/request_spec.rb | require 'spec_helper'
class Client
include HTTMultiParty
base_uri 'http://example.com'
default_params(token: 'test')
end
describe HTTMultiParty do
let(:somefile) { File.new(File.join(File.dirname(__FILE__), '../fixtures/somefile.txt')) }
it 'makes the request with correct query parameters' do
FakeWeb.r... | ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/spec/httmultiparty/multipartable_spec.rb | spec/httmultiparty/multipartable_spec.rb | require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))
describe HTTMultiParty::Multipartable do
let :request_class do
Class.new(Net::HTTP::Post) do
include HTTMultiParty::Multipartable
end
end
# this is how HTTParty works
context 'headers set by .body= are retained if .ini... | ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/lib/httmultiparty.rb | lib/httmultiparty.rb | require 'tempfile'
require 'httparty'
require 'net/http/post/multipart'
require 'mimemagic'
module HTTMultiParty
def self.included(base)
base.send :include, HTTParty
base.extend ClassMethods
end
def self.file_to_upload_io(file, detect_mime_type = false)
if file.respond_to? :original_filename
f... | ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/lib/httmultiparty/multipartable.rb | lib/httmultiparty/multipartable.rb | module HTTMultiParty::Multipartable
DEFAULT_BOUNDARY = '-----------RubyMultipartPost'
# prevent reinitialization of headers
def initialize_http_header(initheader)
super
set_headers_for_body
end
def body=(value)
@body_parts = Array(value).map { |(k, v)| Parts::Part.new(boundary, k, v) }
@body_... | ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/lib/httmultiparty/version.rb | lib/httmultiparty/version.rb | module HTTMultiParty
VERSION = '0.3.16'
end
| ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/lib/httmultiparty/multipart_patch.rb | lib/httmultiparty/multipart_patch.rb | class HTTMultiParty::MultipartPatch < Net::HTTP::Patch
include HTTMultiParty::Multipartable
end
HTTParty::Request::SupportedHTTPMethods << HTTMultiParty::MultipartPatch
| ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/lib/httmultiparty/multipart_put.rb | lib/httmultiparty/multipart_put.rb | class HTTMultiParty::MultipartPut < Net::HTTP::Put
include HTTMultiParty::Multipartable
end
HTTParty::Request::SupportedHTTPMethods << HTTMultiParty::MultipartPut
| ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
jwagener-soundcloud/httmultiparty | https://github.com/jwagener-soundcloud/httmultiparty/blob/ab6724553f708afb40ff21607b323dd7f83cfb41/lib/httmultiparty/multipart_post.rb | lib/httmultiparty/multipart_post.rb | class HTTMultiParty::MultipartPost < Net::HTTP::Post
include HTTMultiParty::Multipartable
end
HTTParty::Request::SupportedHTTPMethods << HTTMultiParty::MultipartPost
| ruby | MIT | ab6724553f708afb40ff21607b323dd7f83cfb41 | 2026-01-04T17:45:25.267705Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/spec/spec_helper.rb | spec/spec_helper.rb | require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
$:.unshift((ROOT + 'lib').to_s)
$:.unshift((ROOT + 'spec').to_s)
require 'bundler/setup'
require 'bacon'
require 'mocha-on-bacon'
require 'pretty_bacon'
require 'pathname'
require 'cocoapods'
Mocha::Configuration.prevent(:stubbing_non_existe... | ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/spec/command/frameworks_spec.rb | spec/command/frameworks_spec.rb | require File.expand_path('../../spec_helper', __FILE__)
module Pod
describe Command::Frameworks do
describe 'CLAide' do
it 'registers it self' do
Command.parse(%w{ frameworks }).should.be.instance_of Command::Frameworks
end
end
end
end
| ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/lib/cocoapods-user-defined-build-types.rb | lib/cocoapods-user-defined-build-types.rb | require 'cocoapods-user-defined-build-types/gem_version'
| ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/lib/cocoapods_plugin.rb | lib/cocoapods_plugin.rb | require 'cocoapods-user-defined-build-types/main'
| ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/lib/cocoapods-user-defined-build-types/main.rb | lib/cocoapods-user-defined-build-types/main.rb | require_relative 'private_api_hooks'
module Pod
class Podfile
module DSL
@@enable_user_defined_build_types = false
def self.enable_user_defined_build_types
@@enable_user_defined_build_types
end
def enable_user_defined_build_types!
@@enable_user_defined_build_type... | ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/lib/cocoapods-user-defined-build-types/private_api_hooks.rb | lib/cocoapods-user-defined-build-types/private_api_hooks.rb | require_relative 'podfile_options'
module Pod
class Podfile
class TargetDefinition
# [Hash{String, BuildType}] mapping of pod name to preferred build type if specified.
@@root_pod_building_options = Hash.new
def self.root_pod_building_options
@@root_pod_building_options
end... | ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/lib/cocoapods-user-defined-build-types/podfile_options.rb | lib/cocoapods-user-defined-build-types/podfile_options.rb | is_version_1_9_x = Pod.const_defined?(:BuildType) # CP v1.9.x
# Assign BuildType to proper module definition dependent on CP version.
BuildType = is_version_1_9_x ? Pod::BuildType : Pod::Target::BuildType
module Pod
class UserOption
def self.keyword
:build_type
end
# [Hash{String, BuildType}... | ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
joncardasis/cocoapods-user-defined-build-types | https://github.com/joncardasis/cocoapods-user-defined-build-types/blob/e34a802bb135ed3549f2b79ac0ac146c645106a7/lib/cocoapods-user-defined-build-types/gem_version.rb | lib/cocoapods-user-defined-build-types/gem_version.rb | module CocoapodsUserDefinedBuildTypes
VERSION = "0.0.7"
end
| ruby | MIT | e34a802bb135ed3549f2b79ac0ac146c645106a7 | 2026-01-04T17:45:29.409183Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/hooks/releases_json.rb | app/_plugins/hooks/releases_json.rb | # frozen_string_literal: true
Jekyll::Hooks.register :site, :post_write do |site|
releases = site.data['versions']
.filter { |v| !v.key?('label') || v['label'] != 'dev' }
.map { |v| v['version'] }.to_json
File.write "#{site.dest}/releases.json", releases
end
| ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/hooks/latest_version.rb | app/_plugins/hooks/latest_version.rb | # frozen_string_literal: true
Jekyll::Hooks.register :site, :post_write do |site|
latest = site.data['latest_version']
File.write "#{site.dest}/latest_version", latest['version']
end
| ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/blocks/mermaid.rb | app/_plugins/blocks/mermaid.rb | # frozen_string_literal: true
module Jekyll
class RenderMermaid < Liquid::Block
def render(context)
text = super
mermaid_script = generate_mermaid_script
mermaid_pre = "<pre class='mermaid'> #{text} </pre>"
"#{mermaid_script}#{mermaid_pre}"
end
private
def generate_mermaid... | ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/blocks/custom_block.rb | app/_plugins/blocks/custom_block.rb | # frozen_string_literal: true
module Jekyll
class CustomBlock < Liquid::Block
alias render_block render
def initialize(tag_name, markup, options)
super
@markup = markup.strip
end
def render(context)
site = context.registers[:site]
converter = site.find_converter_instance(::J... | ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/tags/tabs/tabs.rb | app/_plugins/tags/tabs/tabs.rb | # frozen_string_literal: true
require 'erb'
require 'securerandom'
module Jekyll
module Tabs
class TabsBlock < Liquid::Block
def initialize(tag_name, markup, tokens)
super
@class = markup.strip.empty? ? '' : " #{markup.strip}"
end
def render(context)
tabs_id = SecureR... | ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/generators/redirects.rb | app/_plugins/generators/redirects.rb | # frozen_string_literal: true
module Jekyll
class Redirects < Jekyll::Generator
priority :low
def generate(site)
active_versions = site.data['versions'].filter { |v| !v.key?('label') || v['label'] != 'dev' }
# Generate redirects for the latest version
latest_release = site.data['latest_ve... | ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/generators/navigation_links.rb | app/_plugins/generators/navigation_links.rb | # frozen_string_literal: true
module Jekyll
class NavigationLinks < Jekyll::Generator
priority :low
def generate(site)
site.pages.each_with_index do |page, _index|
next unless page.relative_path.start_with? 'docs'
next if page.path == 'docs/index.md'
next unless page.data.key? ... | ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
kumahq/kuma-website | https://github.com/kumahq/kuma-website/blob/7b6c49c772192d2ecf31f70c006229013ad32a56/app/_plugins/generators/install_pages.rb | app/_plugins/generators/install_pages.rb | # frozen_string_literal: true
module Jekyll
class InstallPages < Jekyll::Generator
priority :low
def generate(site)
latest_page = site.pages.detect { |p| p.relative_path == 'install/latest.md' }
latest_page.data['release'] = site.data['latest_version']['release']
latest_page.data['has_vers... | ruby | Apache-2.0 | 7b6c49c772192d2ecf31f70c006229013ad32a56 | 2026-01-04T17:42:48.724969Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.