source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | jekyll/jekyll | https://github.com/jekyll/jekyll | Gemfile | Ruby | mit | 51,392 | master | 3,126 | # frozen_string_literal: true
source "https://rubygems.org"
gemspec :name => "jekyll"
gem "rake", "~> 13.0"
group :development do
gem "launchy", "~> 2.3"
gem "pry"
gem "pry-byebug" unless RUBY_ENGINE == "jruby"
end
#
group :test do
gem "activesupport", "< 7.1.0"
gem "cucumber", "~> 9.0"
gem "httpclien... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | Rakefile | Ruby | mit | 51,392 | master | 4,383 | # frozen_string_literal: true
require "rubygems"
require "rake"
require "rdoc"
require "date"
require "yaml"
$LOAD_PATH.unshift File.expand_path("lib", __dir__)
require "jekyll/version"
require "bundler/gem_tasks"
Dir.glob("rake/**.rake").each { |f| import f }
#######################################################... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | jekyll.gemspec | Ruby | mit | 51,392 | master | 2,465 | # frozen_string_literal: true
require "English"
require_relative "lib/jekyll/version"
Gem::Specification.new do |s|
s.name = "jekyll"
s.version = Jekyll::VERSION
s.license = "MIT"
s.authors = ["Tom Preston-Werner", "Parker Moore", "Matt Rogers"]
s.email = ["maintainers@jek... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_kramdown.rb | Ruby | mit | 51,392 | master | 6,443 | # frozen_string_literal: true
require "helper"
require "rouge"
class TestKramdown < JekyllUnitTest
def fixture_converter(config)
site = fixture_site(
Utils.deep_merge_hashes(
{
"markdown" => "kramdown",
},
config
)
)
Jekyll::Cache.clear
site.find_convert... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_publisher.rb | Ruby | mit | 51,392 | master | 1,217 | # frozen_string_literal: true
require "helper"
class TestPublisher < JekyllUnitTest
context "default configuration" do
setup do
site = fixture_site
collection = Jekyll::Collection.new(site, "methods")
@thing = Jekyll::Document.new(
source_dir("methods/method.md"),
:site =... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_excerpt_drop.rb | Ruby | mit | 51,392 | master | 1,203 | # frozen_string_literal: true
require "helper"
class TestExcerptDrop < JekyllUnitTest
context "an excerpt drop" do
setup do
@site = fixture_site
@site.read
@doc = @site.docs_to_write.find { |d| !d.data["layout"].nil? }
@doc_drop = @doc.to_liquid
@excerpt = @doc.data["excerpt"]
... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_layout_reader.rb | Ruby | mit | 51,392 | master | 2,598 | # frozen_string_literal: true
require "helper"
class TestLayoutReader < JekyllUnitTest
context "reading layouts" do
setup do
config = Jekyll::Configuration::DEFAULTS.merge("source" => source_dir,
"destination" => dest_dir)
@site = fixture_sit... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_site_drop.rb | Ruby | mit | 51,392 | master | 470 | # frozen_string_literal: true
require "helper"
class TestSiteDrop < JekyllUnitTest
context "a site drop" do
setup do
@site = fixture_site(
"collections" => ["thanksgiving"]
)
@site.process
@drop = @site.to_liquid.site
end
should "respond to `key?`" do
assert_respon... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_document.rb | Ruby | mit | 51,392 | master | 20,078 | # frozen_string_literal: true
require "helper"
class TestDocument < JekyllUnitTest
def assert_equal_value(key, one, other)
assert_equal(one[key], other[key])
end
def setup_encoded_document(filename)
site = fixture_site("collections" => ["encodings"])
site.process
Document.new(site.in_source_dir... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_path_manager.rb | Ruby | mit | 51,392 | master | 1,150 | # frozen_string_literal: true
require "helper"
class TestPathManager < JekyllUnitTest
context "PathManager" do
setup do
@source = Dir.pwd
end
should "return frozen copy of base if questionable path is nil" do
assert_equal @source, Jekyll::PathManager.sanitized_path(@source, nil)
asser... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_page_without_a_file.rb | Ruby | mit | 51,392 | master | 5,517 | # frozen_string_literal: true
require "helper"
class TestPageWithoutAFile < JekyllUnitTest
def setup_page(*args, base: source_dir, klass: PageWithoutAFile)
dir, file = args
if file.nil?
file = dir
dir = ""
end
klass.new(@site, base, dir, file)
end
def render_and_write
@site.rend... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_commands_serve.rb | Ruby | mit | 51,392 | master | 10,344 | # frozen_string_literal: true
require "webrick"
require "mercenary"
require "helper"
require "httpclient"
require "openssl"
require "tmpdir"
class TestCommandsServe < JekyllUnitTest
def custom_opts(what)
@cmd.send(
:webrick_opts, what
)
end
def start_server(opts)
@thread = Thread.new do
... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_tag_include_relative.rb | Ruby | mit | 51,392 | master | 3,719 | # frozen_string_literal: true
require "helper"
class TestTagIncludeRelative < TagUnitTest
context "include_relative tag with variable and liquid filters" do
setup do
site = fixture_site.tap do |s|
s.read
s.render
end
post = site.posts.docs.find do |p|
p.basename.eql? "... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_tag_include.rb | Ruby | mit | 51,392 | master | 8,408 | # frozen_string_literal: true
require "helper"
class TestTagInclude < TagUnitTest
context "include tag with parameters" do
context "with symlink'd include" do
should "not allow symlink includes" do
FileUtils.mkdir_p("tmp")
File.write("tmp/pages-test", "SYMLINK TEST")
assert_raises ... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_coffeescript.rb | Ruby | mit | 51,392 | master | 1,315 | # frozen_string_literal: true
require "helper"
class TestCoffeeScript < JekyllUnitTest
context "converting CoffeeScript" do
setup do
External.require_with_graceful_fail("jekyll-coffeescript")
@site = fixture_site
@site.process
@test_coffeescript_file = dest_dir("js/coffeescript.js")
... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_regenerator.rb | Ruby | mit | 51,392 | master | 9,843 | # frozen_string_literal: true
require "helper"
class TestRegenerator < JekyllUnitTest
context "The site regenerator" do
setup do
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
@site = fixture_site(
"collections" => {
"methods" => {
"output" => true,
},
... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_liquid_renderer.rb | Ruby | mit | 51,392 | master | 1,761 | # frozen_string_literal: true
require "helper"
class TestLiquidRenderer < JekyllUnitTest
context "profiler" do
setup do
@site = Site.new(site_configuration)
@renderer = @site.liquid_renderer
end
should "return a table with profiling results" do
@site.process
output = @renderer.... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_drop.rb | Ruby | mit | 51,392 | master | 4,468 | # frozen_string_literal: true
require "helper"
class DropFixture < Jekyll::Drops::Drop
mutable true
attr_accessor :lipsum
def foo
"bar"
end
def fallback_data
@fallback_data ||= { "baz" => "buzz" }
end
end
class TestDrop < JekyllUnitTest
context "Drops" do
setup do
@site = fixture_s... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_log_adapter.rb | Ruby | mit | 51,392 | master | 4,662 | # frozen_string_literal: true
require "helper"
class TestLogAdapter < JekyllUnitTest
class LoggerDouble
attr_accessor :level
def debug(*); end
def info(*); end
def warn(*); end
def error(*); end
end
context "#log_level=" do
should "set the writers logging level" do
subject = J... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_win_tz.rb | Ruby | mit | 51,392 | master | 1,011 | # frozen_string_literal: true
require "helper"
class TestWinTz < JekyllUnitTest
[["America/New_York", "WTZ+05:00"], ["Europe/Paris", "WTZ-01:00"]].each do |tz, expected|
should "use base offset in winter for #{tz}" do
result = Jekyll::Utils::WinTZ.calculate(tz, Time.utc(2021, 1, 1))
assert_equal exp... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_excerpt.rb | Ruby | mit | 51,392 | master | 10,194 | # frozen_string_literal: true
require "helper"
class TestExcerpt < JekyllUnitTest
def setup_post(file)
Document.new(@site.in_source_dir(File.join("_posts", file)),
:site => @site,
:collection => @site.posts).tap(&:read)
end
def do_render(document)
@site.layouts =... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_filters.rb | Ruby | mit | 51,392 | master | 53,556 | # frozen_string_literal: true
require "helper"
class TestFilters < JekyllUnitTest
class JekyllFilter
include Jekyll::Filters
attr_accessor :site, :context
def initialize(opts = {})
@site = Jekyll::Site.new(opts.merge("skip_config_files" => true))
@context = Liquid::Context.new(@site.site_pa... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_data_reader.rb | Ruby | mit | 51,392 | master | 1,574 | # frozen_string_literal: true
require "helper"
class TestDataReader < JekyllUnitTest
context "#sanitize_filename" do
setup do
@reader = DataReader.new(fixture_site)
end
should "remove evil characters" do
assert_equal "helpwhathaveIdone", @reader.sanitize_filename(
"help/what^&$^#*(!... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_collections.rb | Ruby | mit | 51,392 | master | 10,354 | # frozen_string_literal: true
require "helper"
class TestCollections < JekyllUnitTest
context "an evil collection" do
setup do
@collection = Jekyll::Collection.new(fixture_site, "../../etc/password")
end
should "sanitize the label name" do
assert_equal "....etcpassword", @collection.label
... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_generated_site.rb | Ruby | mit | 51,392 | master | 3,243 | # frozen_string_literal: true
require "helper"
class TestGeneratedSite < JekyllUnitTest
context "generated sites" do
setup do
clear_dest
@site = fixture_site
@site.process
@index = File.read(
dest_dir("index.html"),
**Utils.merged_file_read_opts(@site, {})
)
en... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_convertible.rb | Ruby | mit | 51,392 | master | 2,746 | # frozen_string_literal: true
require "helper"
require "ostruct"
class TestConvertible < JekyllUnitTest
context "YAML front matter" do
setup do
@convertible = OpenStruct.new(
"site" => Site.new(Jekyll.configuration(
"source" => File.expand_path("fixtures", __dir__)
... |
github | jekyll/jekyll | https://github.com/jekyll/jekyll | test/test_ansi.rb | Ruby | mit | 51,392 | master | 554 | # frozen_string_literal: true
require "helper"
class TestAnsi < JekyllUnitTest
context nil do
setup do
@subject = Jekyll::Utils::Ansi
end
Jekyll::Utils::Ansi::COLORS.each_key do |color|
should "respond_to? #{color}" do
assert_respond_to(@subject, color)
end
end
should... |
End of preview. Expand in Data Studio
Ruby Code Corpus
A large corpus of Ruby source code collected from public GitHub repositories.
Content
- 294,074 files from 3,920+ Ruby repositories on GitHub
- Sourced from repos ranked by star count (quality signal)
- Filtered: removed files under 200 bytes (trivial/empty files)
- Only permissive licenses: MIT, Apache-2.0, BSD, ISC, Ruby
Fields
| Field | Description |
|---|---|
source |
Always github |
repo |
owner/repo slug |
repo_url |
Full GitHub URL |
path |
File path within the repo |
language |
Always Ruby |
license |
SPDX license identifier |
stars |
GitHub star count at collection time |
ref |
Branch name |
size_bytes |
File size in bytes |
text |
Raw source content |
Composition
- ~95%
.rbfiles - ~37% test files (spec/test — kept intentionally, useful for training)
- ~58% production code
Usage
from datasets import load_dataset
ds = load_dataset("NickIBrody/ruby-code-corpus", split="train")
print(ds[0]["text"])
License
Individual files retain their original open-source licenses as specified in the license field.
- Downloads last month
- -