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
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/stylus-preview-app/config.rb
middleman-core/fixtures/stylus-preview-app/config.rb
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/cache-buster-app/config.rb
middleman-core/fixtures/cache-buster-app/config.rb
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/frontmatter-neighbor-app/config.rb
middleman-core/fixtures/frontmatter-neighbor-app/config.rb
ignore '*.frontmatter' # Reads neighbor for every file on every refresh. # TODO: Optimize class NeighborFrontmatter < ::Middleman::Extension self.resource_list_manipulator_priority = 81 def manipulate_resource_list(resources) resources.each do |resource| next unless resource.file_descriptor neigh...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/multiple-sources-app/config.rb
middleman-core/fixtures/multiple-sources-app/config.rb
files.watch :source, path: File.join(root, 'source0'), priority: 100 files.watch :source, path: File.join(root, 'source1') files.watch :source, path: File.join(root, 'source2')
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/chained-app/config.rb
middleman-core/fixtures/chained-app/config.rb
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/proxy-pages-app/config.rb
middleman-core/fixtures/proxy-pages-app/config.rb
# -*- coding: utf-8 -*- proxy "/fake.html", "/real.html", layout: false proxy "fake2.html", "/real.html", layout: false proxy "fake3.html", "real.html", layout: false proxy "/fake4.html", "real.html", layout: false proxy "/target_ignore.html", "/should_be_ignored3.html", ignore: true proxy "target_ignore2.html", "/sho...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/i18n-mixed-sources/config.rb
middleman-core/fixtures/i18n-mixed-sources/config.rb
activate :i18n, mount_at_root: :en, langs: [:en, :es]
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/wildcard-app/config.rb
middleman-core/fixtures/wildcard-app/config.rb
page "/admin/*", layout: :admin
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/markdown-app/config.rb
middleman-core/fixtures/markdown-app/config.rb
set :markdown, smartypants: true
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/page-helper-layout-block-app/config.rb
middleman-core/fixtures/page-helper-layout-block-app/config.rb
page "/path/*", layout: "alt" # Doesn't work, and shouldn't # page "/path/*" do # set :layout, "alt" # end
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/frontmatter-settings-neighbor-app/config.rb
middleman-core/fixtures/frontmatter-settings-neighbor-app/config.rb
# Proxy ignored.html, which should ignore itself through a frontmatter proxy 'proxied.html', 'ignored.html' proxy 'proxied_with_frontmatter.html', 'ignored.html' page 'override_layout.html', layout: :alternate page 'page_mentioned.html' ignore '*.frontmatter' # Reads neighbor for every file on every refresh. class Ne...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/more-traversal-app/config.rb
middleman-core/fixtures/more-traversal-app/config.rb
activate :directory_indexes proxy "/sub/fake.html", "/proxied.html", ignore: true proxy "/sub/fake2.html", "/proxied.html", ignore: true proxy "/directory-indexed/fake.html", "/proxied.html", ignore: true proxy "/directory-indexed/fake2.html", "/proxied.html", ignore: true
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/automatic-alt-tags-app/config.rb
middleman-core/fixtures/automatic-alt-tags-app/config.rb
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/i-8859-1-app/config.rb
middleman-core/fixtures/i-8859-1-app/config.rb
set :encoding, "ISO-8859-1"
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/data-with-aliases-app/config.rb
middleman-core/fixtures/data-with-aliases-app/config.rb
data.pages.each do |p| proxy p.from, p.to, locals: { content: p.content } end
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/empty-app/not-config.rb
middleman-core/fixtures/empty-app/not-config.rb
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/sinatra-app/config.rb
middleman-core/fixtures/sinatra-app/config.rb
require "sinatra" class MySinatra < Sinatra::Base set :host_authorization, { permitted_hosts: "www.example.com" } get "/" do "Hello World (Sinatra)" end get "/derp.html" do "De doo" end end map "/sinatra" do run MySinatra end
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/asset-host-app/config.rb
middleman-core/fixtures/asset-host-app/config.rb
activate :asset_host, host: "http://assets1.example.com"
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/build-with-errors-app/config.rb
middleman-core/fixtures/build-with-errors-app/config.rb
set :layout, false
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/fixtures/extension-hooks-app/config.rb
middleman-core/fixtures/extension-hooks-app/config.rb
set :layout, false class MyFeature < Middleman::Extension def initialize(app, options_hash = {}, &block) super app.before do puts '/// before ///' end app.ready do puts '/// ready ///' end app.before_render do |body, path, locs, template_class| puts "/// before_render ///...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/features/support/env.rb
middleman-core/features/support/env.rb
ENV["TEST"] = "true" require 'sassc' require 'simplecov' SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..')) SimpleCov.start require "rspec" RSpec.configure do |config| config.expect_with :rspec do |expectations| expectations.max_formatted_output_length = nil end end PROJECT_ROOT_PATH = Fi...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/features/support/preserve_mime_types.rb
middleman-core/features/support/preserve_mime_types.rb
Around('@preserve_mime_types') do |_scenario, block| mime_types = ::Rack::Mime::MIME_TYPES.clone block.call ::Rack::Mime::MIME_TYPES.replace mime_types end
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/spec_helper.rb
middleman-core/spec/spec_helper.rb
require 'simplecov' SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..')) SimpleCov.start require 'aruba/api' RSpec.configure do |config| config.include Aruba::Api end require_relative 'support/given' RSpec.configure do |config| config.filter_run :focus config.run_all_when_everything_filtered = true...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/support/given.rb
middleman-core/spec/support/given.rb
module Given ROOT = File.expand_path( '../..', File.dirname( File.realpath(__FILE__) ) ) TMP = File.join( ROOT, 'tmp' ) class << self def fixture name cleanup! `rsync -av #{File.join( ROOT, 'fixtures', name )}/ #{TMP}/` Dir.chdir TMP ENV['MM_ROOT'] = TMP end def no_file na...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/middleman-core/dns_resolver_spec.rb
middleman-core/spec/middleman-core/dns_resolver_spec.rb
require 'spec_helper' require 'middleman-core/dns_resolver' RSpec.describe Middleman::DnsResolver do subject(:resolver) do described_class.new( hosts_resolver: hosts_resolver, local_link_resolver: local_link_resolver, network_resolver: network_resolver ) end let(:hosts_resolver) { inst...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/middleman-core/callbacks_spec.rb
middleman-core/spec/middleman-core/callbacks_spec.rb
# require 'spec_helper' require 'middleman-core/callback_manager' describe ::Middleman::CallbackManager do it "adds a simple key" do counters = { test1: 0, test2: 0, test3: 0 } m = ::Middleman::CallbackManager.new m.add(:test3) { counters[:test3] += 1 } m.add(:test1) { counters...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/middleman-core/util_spec.rb
middleman-core/spec/middleman-core/util_spec.rb
require 'spec_helper' require 'middleman-core' describe Middleman::Util do describe "::path_match" do it "matches a literal string" do expect(Middleman::Util.path_match '/index.html', '/index.html').to be true end it "won't match a wrong string" do expect(Middleman::Util.path_match '/foo.ht...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/middleman-core/core_extensions/data_spec.rb
middleman-core/spec/middleman-core/core_extensions/data_spec.rb
require 'spec_helper' require 'middleman-core/core_extensions' require 'middleman-core/core_extensions/data' describe Middleman::CoreExtensions::Data do end describe Middleman::CoreExtensions::Data::DataStore do describe "#store" do before :each do @subject = described_class.new instance_double("Middlema...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/middleman-core/preview_server/server_ip_address_spec.rb
middleman-core/spec/middleman-core/preview_server/server_ip_address_spec.rb
require 'spec_helper' require 'middleman-core/preview_server/server_ip_address' RSpec.describe Middleman::PreviewServer::ServerIpAddress do subject(:ip_address) { described_class.new(string) } let(:string) { '127.0.0.1' } describe '#to_s' do context 'when ipv4' do let(:string) { '127.0.0.1' } it...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/spec/middleman-core/preview_server/server_hostname_spec.rb
middleman-core/spec/middleman-core/preview_server/server_hostname_spec.rb
require 'spec_helper' require 'middleman-core/preview_server/server_hostname' RSpec.describe Middleman::PreviewServer::ServerHostname do subject(:hostname) { described_class.new(string) } let(:string) { 'www.example.com' } describe '#to_s' do context 'when hostname' do it { expect(hostname.to_s).to eq...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core.rb
middleman-core/lib/middleman-core.rb
# Setup our load paths libdir = File.expand_path(File.dirname(__FILE__)) $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir) # Top-level Middleman namespace module Middleman autoload :Application, 'middleman-core/application' end require 'middleman-core/version' require 'middleman-core/util' require 'midd...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman/rack.rb
middleman-core/lib/middleman/rack.rb
require 'middleman-core/load_paths' ::Middleman.setup_load_paths require 'middleman-core' require 'middleman-core/rack' require 'middleman-core/application' module Middleman def self.server ::Middleman::Rack.new(::Middleman::Application.new) end end
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/template_context.rb
middleman-core/lib/middleman-core/template_context.rb
require 'pathname' require 'middleman-core/file_renderer' require 'middleman-core/template_renderer' require 'middleman-core/contracts' module Middleman # The TemplateContext Class # # A clean context, separate from Application, in which templates can be executed. # All helper methods and values available in a...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extension_manager.rb
middleman-core/lib/middleman-core/extension_manager.rb
module Middleman class ExtensionManager extend Forwardable def_delegator :@app, :logger def_delegators :@activated, :[], :each def initialize(app) @app = app @activated = {} ::Middleman::Extensions.load_settings(@app) manager = self { before_sitemap: :before_...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/version.rb
middleman-core/lib/middleman-core/version.rb
module Middleman # Current Version # @return [String] VERSION = '4.6.2'.freeze unless const_defined?(:VERSION) end
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/profiling.rb
middleman-core/lib/middleman-core/profiling.rb
module Middleman module Profiling class << self # The profiler instance. There can only be one! attr_writer :profiler def profiler @profiler ||= NullProfiler.new end # Start the profiler def start profiler.start end # Stop the profiler and generate...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/sources.rb
middleman-core/lib/middleman-core/sources.rb
require 'hamster' require 'middleman-core/contracts' module Middleman # The standard "record" that contains information about a file on disk. SourceFile = Struct.new(:relative_path, :full_path, :directory, :types, :version) do def read ::Middleman::Sources.file_cache[full_path] ||= {} ::Middleman::...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/meta_pages.rb
middleman-core/lib/middleman-core/meta_pages.rb
require 'rack/builder' require 'rack/static' require 'tilt' require 'middleman-core/meta_pages/sitemap_tree' require 'middleman-core/meta_pages/config_setting' module Middleman module MetaPages # Metadata pages to be served in preview, in order to present information about the Middleman # application and its...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions.rb
middleman-core/lib/middleman-core/extensions.rb
require 'middleman-core/extension' module Middleman # The Extensions module is used to handle global registration and loading of Middleman Extensions. # # The application-facing extension API ({Middleman::CoreExtensions::Extensions#activate activate}, etc) is in {Middleman::CoreExtensions::Extensions} in # `mi...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/application.rb
middleman-core/lib/middleman-core/application.rb
require 'active_support/core_ext/integer/inflections' require 'middleman-core/contracts' require 'middleman-core/callback_manager' require 'middleman-core/logger' require 'middleman-core/sitemap/store' require 'middleman-core/configuration' require 'middleman-core/extension_manager' require 'middleman-core/core_extens...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/load_paths.rb
middleman-core/lib/middleman-core/load_paths.rb
# Core Pathname library used for traversal require 'pathname' module Middleman class << self def setup_load_paths @_is_setup ||= begin # Only look for config.rb if MM_ROOT isn't set if !ENV['MM_ROOT'] && (found_path = findup('config.rb')) ENV['MM_ROOT'] = found_path end ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions.rb
middleman-core/lib/middleman-core/core_extensions.rb
require 'middleman-core/extensions' # File Change Notifier Middleman::Extensions.register :file_watcher, auto_activate: :before_sitemap do require 'middleman-core/core_extensions/file_watcher' Middleman::CoreExtensions::FileWatcher end # Parse YAML from templates Middleman::Extensions.register :front_matter, auto...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/preview_server.rb
middleman-core/lib/middleman-core/preview_server.rb
require 'webrick' require 'webrick/https' require 'openssl' require 'middleman-core/meta_pages' require 'middleman-core/logger' require 'middleman-core/rack' require 'middleman-core/preview_server/server_information' require 'middleman-core/preview_server/server_url' require 'middleman-core/preview_server/server_inform...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/logger.rb
middleman-core/lib/middleman-core/logger.rb
# Use the Ruby/Rails logger require 'active_support/notifications' require 'active_support/logger' require 'thread' module Middleman # The Middleman Logger class Logger < ActiveSupport::Logger def self.singleton(*args) if !@_logger || !args || !args.empty? if args.length == 1 && (args.first.is_a?...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/file_renderer.rb
middleman-core/lib/middleman-core/file_renderer.rb
require 'tilt' require 'active_support/core_ext/string/output_safety' require 'active_support/core_ext/module/delegation' require 'middleman-core/contracts' ::Tilt.default_mapping.lazy_map.delete('html') ::Tilt.default_mapping.lazy_map.delete('csv') module Middleman class FileRenderer extend Forwardable inc...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/callback_manager.rb
middleman-core/lib/middleman-core/callback_manager.rb
require 'hamster' require 'middleman-core/contracts' # Immutable Callback Management, complete with Contracts validation. module Middleman class CallbackManager include Contracts Contract Any def initialize @callbacks = ::Hamster::Hash.empty @subscribers = ::Hamster::Vector.empty end ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/rack.rb
middleman-core/lib/middleman-core/rack.rb
require 'rack' require 'rack/files' require 'rack/lint' require 'rack/head' require 'rack/utils' require 'addressable/uri' require 'middleman-core/util' require 'middleman-core/logger' require 'middleman-core/template_renderer' # CSSPIE HTC File ::Rack::Mime::MIME_TYPES['.htc'] = 'text/x-component' # Let's serve all...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/configuration.rb
middleman-core/lib/middleman-core/configuration.rb
module Middleman module Configuration # A class that manages a collection of documented settings. # Can be used by extensions as well as the main Middleman # application. Extensions should probably finalize their instance # after defining all the settings they want to expose. class ConfigurationMa...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/template_renderer.rb
middleman-core/lib/middleman-core/template_renderer.rb
require 'tilt' require 'active_support/core_ext/string/output_safety' require 'middleman-core/template_context' require 'middleman-core/file_renderer' require 'middleman-core/contracts' module Middleman class TemplateRenderer extend Forwardable include Contracts class Cache def initialize ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/dns_resolver.rb
middleman-core/lib/middleman-core/dns_resolver.rb
require 'resolv' require 'middleman-core/dns_resolver/network_resolver' require 'middleman-core/dns_resolver/hosts_resolver' module Middleman # This resolves IP address to names and vice versa class DnsResolver private attr_reader :resolvers public # Create resolver # # First the local r...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/contracts.rb
middleman-core/lib/middleman-core/contracts.rb
if ENV['CONTRACTS'] != 'false' require 'contracts' require 'hamster' module Contracts class IsA def self.[](val) @lookup ||= {} @lookup[val] ||= new(val) end def initialize(val) @val = val end def valid?(val) val.is_a? @val.constantize end...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/step_definitions.rb
middleman-core/lib/middleman-core/step_definitions.rb
require 'aruba/cucumber' require 'middleman-core/step_definitions/middleman_steps' require 'middleman-core/step_definitions/builder_steps' require 'middleman-core/step_definitions/server_steps' require 'middleman-core/step_definitions/commandline_steps' # Monkeypatch for windows support module ArubaMonkeypatch def d...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/builder.rb
middleman-core/lib/middleman-core/builder.rb
require 'addressable/uri' require 'pathname' require 'fileutils' require 'tempfile' require 'parallel' require 'middleman-core/rack' require 'middleman-core/callback_manager' require 'middleman-core/contracts' module Middleman class Builder extend Forwardable include Contracts # Make app & events availa...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extension.rb
middleman-core/lib/middleman-core/extension.rb
require 'forwardable' require 'memoist' require 'active_support/core_ext/class/attribute' require 'middleman-core/configuration' require 'middleman-core/contracts' module Middleman # Middleman's Extension API provides the ability to add functionality to Middleman # and to customize existing features. Internally, m...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/config_context.rb
middleman-core/lib/middleman-core/config_context.rb
require 'rack/mime' require 'middleman-core/callback_manager' module Middleman class ConfigContext extend Forwardable attr_reader :app # Whitelist methods that can reach out. def_delegators :@app, :config, :logger, :use, :map, :mime_type, :files, :root, :build?, :server?, :environment?, :extensions...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util.rb
middleman-core/lib/middleman-core/util.rb
if RUBY_VERSION < "3.2" require "active_support/version" require "logger" if ActiveSupport.version < Gem::Version.new("8.0.0") end require 'active_support/all' require 'middleman-core/application' require 'middleman-core/sources' require 'middleman-core/sitemap/resource' require 'middleman-core/util/binary' requ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util/data.rb
middleman-core/lib/middleman-core/util/data.rb
require 'yaml' require 'json' require 'toml' require 'pathname' require 'hashie' require 'memoist' require 'middleman-core/util/binary' require 'middleman-core/contracts' module Middleman module Util include Contracts module_function class EnhancedHash < ::Hashie::Mash # include ::Hashie::Extens...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util/files.rb
middleman-core/lib/middleman-core/util/files.rb
require 'set' module Middleman module Util include Contracts module_function # Get a recusive list of files inside a path. # Works with symlinks. # # @param path Some path string or Pathname # @param ignore A proc/block that returns true if a given path should be ignored - if a path ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util/binary.rb
middleman-core/lib/middleman-core/util/binary.rb
# Template and Mime detection require 'tilt' require 'rack/mime' require 'middleman-core/contracts' module Middleman module Util include Contracts module_function # Whether the source file is binary. # # @param [String] filename The file to check. # @return [Boolean] Contract Or[String...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util/uri_templates.rb
middleman-core/lib/middleman-core/util/uri_templates.rb
# For URI templating require 'addressable/uri' require 'addressable/template' require 'active_support/inflector' require 'active_support/inflector/transliterate' module Middleman module Util # Handy methods for dealing with URI templates. Mix into whatever class. module UriTemplates module_function ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util/rack.rb
middleman-core/lib/middleman-core/util/rack.rb
require 'middleman-core/contracts' module Middleman module Util include Contracts module_function # Extract the text of a Rack response as a string. # Useful for extensions implemented as Rack middleware. # @param response The response from #call # @return [String] The whole response as a s...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/util/paths.rb
middleman-core/lib/middleman-core/util/paths.rb
# Core Pathname library used for traversal require 'pathname' require 'uri' require 'addressable/uri' require 'memoist' require 'tilt' require 'middleman-core/contracts' module Middleman module Util extend Memoist include Contracts module_function Contract String => ::Addressable::URI def pars...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/sources/source_watcher.rb
middleman-core/lib/middleman-core/sources/source_watcher.rb
# Watcher Library require 'listen' require 'middleman-core/contracts' require 'digest' require 'set' # Monkey patch Listen silencer so `only` works on directories too module Listen class Silencer # TODO: switch type and path places - and verify def silenced?(relative_path, _type) path = relative_path.t...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/data.rb
middleman-core/lib/middleman-core/core_extensions/data.rb
require 'middleman-core/contracts' require 'middleman-core/util/data' module Middleman module CoreExtensions # The data extension parses YAML and JSON files in the `data/` directory # and makes them available to `config.rb`, templates and extensions class Data < Extension attr_reader :data_store ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/external_helpers.rb
middleman-core/lib/middleman-core/core_extensions/external_helpers.rb
module Middleman module CoreExtensions # Load helpers in `helpers/` class ExternalHelpers < Extension define_setting :helpers_dir, 'helpers', 'Directory to autoload helper modules from' define_setting :helpers_filename_glob, '**.rb', 'Glob pattern for matching helper ruby files' define_setti...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb
middleman-core/lib/middleman-core/core_extensions/front_matter.rb
# Core Pathname library used for traversal require 'pathname' # DbC require 'middleman-core/contracts' require 'active_support/core_ext/hash/keys' require 'middleman-core/util/data' # Extensions namespace module Middleman::CoreExtensions class FrontMatter < ::Middleman::Extension # Try to run after routing bu...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/routing.rb
middleman-core/lib/middleman-core/core_extensions/routing.rb
# Routing extension module Middleman module CoreExtensions class Routing < ConfigExtension # This should always run late, but not as late as :directory_indexes, # so it can add metadata to any pages generated by other extensions self.resource_list_manipulator_priority = [10, 130] # Expose...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/rendering.rb
middleman-core/lib/middleman-core/core_extensions/rendering.rb
require 'middleman-core/template_context' # ERb Support Middleman::Extensions.register :erb_renderer, auto_activate: :before_configuration do require 'middleman-core/renderers/erb' Middleman::Renderers::ERb end # CoffeeScript Support Middleman::Extensions.register :coffee_renderer, auto_activate: :before_configur...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/file_watcher.rb
middleman-core/lib/middleman-core/core_extensions/file_watcher.rb
require 'middleman-core/contracts' require 'middleman-core/sources' module Middleman module CoreExtensions # API for watching file change events class FileWatcher < Extension # All defined sources. Contract IsA['Middleman::Sources'] attr_reader :sources # Make the internal `sources` ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/i18n.rb
middleman-core/lib/middleman-core/core_extensions/i18n.rb
class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension option :no_fallbacks, false, 'Disable I18n fallbacks' option :locales, nil, 'List of locales, will autodiscover by default' option :langs, nil, 'Backwards compatibility if old option name. Use `locales` instead.' option :locale_map, ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/default_helpers.rb
middleman-core/lib/middleman-core/core_extensions/default_helpers.rb
require 'padrino-helpers' require 'padrino-helpers/output_helpers' require 'padrino-helpers/asset_tag_helpers' require 'padrino-helpers/form_helpers' require 'padrino-helpers/format_helpers' require 'padrino-helpers/number_helpers' require 'padrino-helpers/output_helpers' require 'padrino-helpers/render_helpers' requir...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/inline_url_rewriter.rb
middleman-core/lib/middleman-core/core_extensions/inline_url_rewriter.rb
require 'rack' require 'rack/response' require 'memoist' require 'middleman-core/util' require 'middleman-core/contracts' module Middleman module CoreExtensions class InlineURLRewriter < ::Middleman::Extension include Contracts expose_to_application rewrite_inline_urls: :add REWRITER_DESCRIPT...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb
middleman-core/lib/middleman-core/core_extensions/show_exceptions.rb
require 'rack/show_exceptions' # Support rack/showexceptions during development module Middleman::CoreExtensions class ShowExceptions < ::Middleman::Extension define_setting :show_exceptions, ENV['TEST'] ? false : true, 'Whether to catch and display exceptions' def ready app.use ::Rack::ShowExceptions...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/collections.rb
middleman-core/lib/middleman-core/core_extensions/collections.rb
require 'monitor' require 'middleman-core/core_extensions/collections/pagination' require 'middleman-core/core_extensions/collections/step_context' require 'middleman-core/core_extensions/collections/lazy_root' require 'middleman-core/core_extensions/collections/lazy_step' # Super "class-y" injection of array helpers ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/collections/lazy_root.rb
middleman-core/lib/middleman-core/core_extensions/collections/lazy_root.rb
require 'middleman-core/core_extensions/collections/lazy_step' module Middleman module CoreExtensions module Collections class LazyCollectorRoot def initialize(parent) @data = nil @parent = parent end def realize!(data) @data = data end ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/collections/step_context.rb
middleman-core/lib/middleman-core/core_extensions/collections/step_context.rb
module Middleman module CoreExtensions module Collections class StepContext class << self attr_accessor :current def add_to_context(name, &func) send(:define_method, :"_internal_#{name}", &func) end end attr_reader :descriptors def...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/collections/pagination.rb
middleman-core/lib/middleman-core/core_extensions/collections/pagination.rb
require 'active_support/core_ext/object/deep_dup' require 'middleman-core/util' module Middleman module Pagination module ArrayHelpers def per_page(per_page) return to_enum(__method__, per_page) unless block_given? parts = if per_page.respond_to? :call per_page.call(dup) ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/core_extensions/collections/lazy_step.rb
middleman-core/lib/middleman-core/core_extensions/collections/lazy_step.rb
module Middleman module CoreExtensions module Collections class LazyCollectorStep DELEGATE = [:hash, :eql?].freeze def initialize(name, args, block, parent=nil) @name = name @args = args @block = block @parent = parent @result = nil ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/asset_hash.rb
middleman-core/lib/middleman-core/extensions/asset_hash.rb
require 'addressable/uri' require 'middleman-core/util' require 'middleman-core/rack' class Middleman::Extensions::AssetHash < ::Middleman::Extension option :sources, %w(.css .htm .html .js .php .xhtml), 'List of extensions that are searched for hashable assets.' option :exts, nil, 'List of extensions that get ass...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/minify_css.rb
middleman-core/lib/middleman-core/extensions/minify_css.rb
require 'active_support/core_ext/object/try' require 'memoist' require 'middleman-core/contracts' require 'sassc' # Minify CSS Extension class Middleman::Extensions::MinifyCss < ::Middleman::Extension option :inline, false, 'Whether to minify CSS inline within HTML files' option :ignore, [], 'Patterns to avoid min...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/minify_javascript.rb
middleman-core/lib/middleman-core/extensions/minify_javascript.rb
require 'active_support/core_ext/object/try' require 'middleman-core/contracts' require 'memoist' # Minify Javascript Extension class Middleman::Extensions::MinifyJavascript < ::Middleman::Extension option :inline, false, 'Whether to minify JS inline within HTML files' option :ignore, [], 'Patterns to avoid minify...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/asset_host.rb
middleman-core/lib/middleman-core/extensions/asset_host.rb
require 'addressable/uri' class Middleman::Extensions::AssetHost < ::Middleman::Extension option :host, nil, 'The asset host to use or a Proc to determine asset host', required: true option :exts, nil, 'List of extensions that get cache busters strings appended to them.' option :sources, %w(.css .htm .html .js ....
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/cache_buster.rb
middleman-core/lib/middleman-core/extensions/cache_buster.rb
# The Cache Buster extension class Middleman::Extensions::CacheBuster < ::Middleman::Extension option :exts, nil, 'List of extensions that get cache busters strings appended to them.' option :sources, %w(.css .htm .html .js .php .xhtml), 'List of extensions that are searched for bustable assets.' option :ignore, ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/automatic_alt_tags.rb
middleman-core/lib/middleman-core/extensions/automatic_alt_tags.rb
# Automatic Image alt tags from image names extension class Middleman::Extensions::AutomaticAltTags < ::Middleman::Extension helpers do # Override default image_tag helper to automatically insert alt tag # containing image name. def image_tag(path, params={}) unless path.include?('://') par...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/relative_assets.rb
middleman-core/lib/middleman-core/extensions/relative_assets.rb
require 'addressable/uri' # Relative Assets extension class Middleman::Extensions::RelativeAssets < ::Middleman::Extension option :exts, nil, 'List of extensions that get converted to relative paths.' option :sources, %w(.css .htm .html .xhtml), 'List of extensions that are searched for relative assets.' option ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/automatic_image_sizes.rb
middleman-core/lib/middleman-core/extensions/automatic_image_sizes.rb
# Automatic Image Sizes extension class Middleman::Extensions::AutomaticImageSizes < ::Middleman::Extension def initialize(app, options_hash={}, &block) super # Include 3rd-party fastimage library require 'fastimage' end helpers do # Override default image_tag helper to automatically calculate a...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/gzip.rb
middleman-core/lib/middleman-core/extensions/gzip.rb
# This extension Gzips assets and pages when building. # Gzipped assets and pages can be served directly by Apache or # Nginx with the proper configuration, and pre-zipping means that we # can use a more agressive compression level at no CPU cost per request. # # Use Nginx's gzip_static directive, or AddEncoding and mo...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/directory_indexes.rb
middleman-core/lib/middleman-core/extensions/directory_indexes.rb
# Directory Indexes extension class Middleman::Extensions::DirectoryIndexes < ::Middleman::Extension # This should run after most other sitemap manipulators so that it # gets a chance to modify any new resources that get added. self.resource_list_manipulator_priority = 100 # Update the main sitemap resource li...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/external_pipeline.rb
middleman-core/lib/middleman-core/extensions/external_pipeline.rb
class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension self.supports_multiple_instances = true option :name, nil, 'The name of the pipeline', required: true option :command, nil, 'The command to initialize', required: true option :source, nil, 'Path to merge into sitemap', required: true opti...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/extensions/lorem.rb
middleman-core/lib/middleman-core/extensions/lorem.rb
class Middleman::Extensions::Lorem < ::Middleman::Extension helpers do # Access to the Lorem object # @return [Middleman::Extensions::Lorem::LoremObject] def lorem LoremObject end # Return a placeholder image using placekitten.com # # @param [String] size # @param [Hash] options...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/sass.rb
middleman-core/lib/middleman-core/renderers/sass.rb
require 'sassc' module Middleman module Renderers # Sass renderer class Sass < ::Middleman::Extension opts = { output_style: :nested } opts[:line_comments] = false if ENV['TEST'] define_setting :sass, opts, 'Sass engine options' define_setting :sass_assets_paths, [], 'Paths to extra S...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/kramdown.rb
middleman-core/lib/middleman-core/renderers/kramdown.rb
require 'kramdown' module Middleman module Renderers # Our own Kramdown Tilt template that simply uses our custom renderer. class KramdownTemplate < ::Tilt::KramdownTemplate private def _prepare_output @context = @options[:context] MiddlemanKramdownHTML.scope = @context ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/less.rb
middleman-core/lib/middleman-core/renderers/less.rb
module Middleman module Renderers # Sass renderer class Less < ::Middleman::Extension # A SassTemplate for Tilt which outputs debug messages class DummyLessTemplate < ::Tilt::Template def evaluate(scope, locals, &block) raise <<~ERROR The builtin less renderer has bee...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/liquid.rb
middleman-core/lib/middleman-core/renderers/liquid.rb
# Require Gem require 'liquid' module Middleman module Renderers # Liquid Renderer class Liquid < Middleman::Extension # After config, setup liquid partial paths def after_configuration ::Liquid::Template.file_system = self end # Called by Liquid to retrieve a template file ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/markdown.rb
middleman-core/lib/middleman-core/renderers/markdown.rb
module Middleman module Renderers # Markdown renderer class Markdown < ::Middleman::Extension define_setting :markdown_engine, :kramdown, 'Preferred markdown engine' define_setting :markdown_engine_prefix, ::Tilt, 'The parent module for markdown template engines' # Once configuration is par...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/coffee_script.rb
middleman-core/lib/middleman-core/renderers/coffee_script.rb
# Require gem require 'coffee_script' module Middleman module Renderers # CoffeeScript Renderer class CoffeeScript < ::Middleman::Extension # Setup extension def initialize(app, options={}, &block) super # Tell Tilt to use it as well (for inline scss blocks) ::Tilt.regist...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/redcarpet.rb
middleman-core/lib/middleman-core/renderers/redcarpet.rb
require 'redcarpet' require 'active_support/core_ext/module/attribute_accessors' module Middleman module Renderers class RedcarpetTemplate < ::Tilt::RedcarpetTemplate # because tilt has decided to convert these # in the wrong direction ALIASES = { escape_html: :filter_html }.freez...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/erb.rb
middleman-core/lib/middleman-core/renderers/erb.rb
# ERb renderer module Middleman module Renderers class ERb < ::Middleman::Extension def after_configuration ::Tilt.prefer(Template, :erb) end class Template < ::Tilt::ErubiTemplate def initialize(*args, &block) super @context = @options[:context] end...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/haml.rb
middleman-core/lib/middleman-core/renderers/haml.rb
# Require gem require 'haml' # Require padrino-helpers now so that we get a chance to replace their renderer with ours in Tilt. require 'padrino-helpers' module SafeTemplate def render(*) super.html_safe end end class Tilt::HamlTemplate include SafeTemplate end module Middleman module Renderers # Ha...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false
middleman/middleman
https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-core/lib/middleman-core/renderers/sass_functions.rb
middleman-core/lib/middleman-core/renderers/sass_functions.rb
module Middleman module Sass module Functions def asset_path(_source, _options) # current_resource end # Using Middleman::Util#asset_path, return the full path # for the given +source+ as a Sass String. This supports keyword # arguments that mirror the +options+. # ...
ruby
MIT
b497703afb715044bc5cfcd5616bd3825323505b
2026-01-04T15:39:40.166212Z
false