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
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/thread.rb
Ruby
apache-2.0
13,530
master
6,277
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/service_discovery/manager.rb
Ruby
apache-2.0
13,530
master
4,129
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/service_discovery/round_robin_balancer.rb
Ruby
apache-2.0
13,530
master
1,109
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/http_server/ssl_context_builder.rb
Ruby
apache-2.0
13,530
master
1,167
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/http_server/server.rb
Ruby
apache-2.0
13,530
master
3,852
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/http_server/app.rb
Ruby
apache-2.0
13,530
master
2,496
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/http_server/request.rb
Ruby
apache-2.0
13,530
master
1,412
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/http_server/methods.rb
Ruby
apache-2.0
13,530
master
1,057
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/plugin_helper/http_server/router.rb
Ruby
apache-2.0
13,530
master
1,654
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/mutex_hash.rb
Ruby
apache-2.0
13,530
master
4,023
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/store.rb
Ruby
apache-2.0
13,530
master
5,397
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/base_socket.rb
Ruby
apache-2.0
13,530
master
1,119
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/validator.rb
Ruby
apache-2.0
13,530
master
4,326
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/error.rb
Ruby
apache-2.0
13,530
master
1,985
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/client.rb
Ruby
apache-2.0
13,530
master
7,287
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/counter/server.rb
Ruby
apache-2.0
13,530
master
7,735
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/handle_tag_and_time_mixin.rb
Ruby
apache-2.0
13,530
master
1,925
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/parser.rb
Ruby
apache-2.0
13,530
master
9,637
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/formatter.rb
Ruby
apache-2.0
13,530
master
3,787
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/type_converter.rb
Ruby
apache-2.0
13,530
master
2,529
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/set_time_key_mixin.rb
Ruby
apache-2.0
13,530
master
1,952
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/call_super_mixin.rb
Ruby
apache-2.0
13,530
master
2,877
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/filter.rb
Ruby
apache-2.0
13,530
master
1,913
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/record_filter_mixin.rb
Ruby
apache-2.0
13,530
master
957
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/exec_util.rb
Ruby
apache-2.0
13,530
master
2,965
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/formatter_utils.rb
Ruby
apache-2.0
13,530
master
3,330
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/handle_tag_name_mixin.rb
Ruby
apache-2.0
13,530
master
1,827
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/string_util.rb
Ruby
apache-2.0
13,530
master
1,067
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/input.rb
Ruby
apache-2.0
13,530
master
1,290
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/socket_util.rb
Ruby
apache-2.0
13,530
master
4,551
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/propagate_default.rb
Ruby
apache-2.0
13,530
master
2,429
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/output_chain.rb
Ruby
apache-2.0
13,530
master
1,478
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/set_tag_key_mixin.rb
Ruby
apache-2.0
13,530
master
1,399
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/file_util.rb
Ruby
apache-2.0
13,530
master
1,705
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/output.rb
Ruby
apache-2.0
13,530
master
24,380
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/detach_process_mixin.rb
Ruby
apache-2.0
13,530
master
966
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/structured_format_mixin.rb
Ruby
apache-2.0
13,530
master
786
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/compat/parser_utils.rb
Ruby
apache-2.0
13,530
master
1,233
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/literal_parser.rb
Ruby
apache-2.0
13,530
master
7,499
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/yaml_parser.rb
Ruby
apache-2.0
13,530
master
1,711
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/basic_parser.rb
Ruby
apache-2.0
13,530
master
2,844
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/types.rb
Ruby
apache-2.0
13,530
master
7,172
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/parser.rb
Ruby
apache-2.0
13,530
master
3,952
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/section.rb
Ruby
apache-2.0
13,530
master
9,621
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/configure_proxy.rb
Ruby
apache-2.0
13,530
master
15,497
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/element.rb
Ruby
apache-2.0
13,530
master
7,862
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/dsl.rb
Ruby
apache-2.0
13,530
master
4,477
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/v1_parser.rb
Ruby
apache-2.0
13,530
master
7,089
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/error.rb
Ruby
apache-2.0
13,530
master
1,025
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/yaml_parser/parser.rb
Ruby
apache-2.0
13,530
master
5,691
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/yaml_parser/fluent_value.rb
Ruby
apache-2.0
13,530
master
1,178
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/yaml_parser/section_builder.rb
Ruby
apache-2.0
13,530
master
2,712
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
lib/fluent/config/yaml_parser/loader.rb
Ruby
apache-2.0
13,530
master
3,354
# # Fluentd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github
fluent/fluentd
https://github.com/fluent/fluentd
templates/new_gem/Rakefile
Ruby
apache-2.0
13,530
master
251
require "bundler" Bundler::GemHelper.install_tasks require "rake/testtask" Rake::TestTask.new(:test) do |t| t.libs.push("lib", "test") t.test_files = FileList["test/**/test_*.rb"] t.verbose = true t.warning = true end task default: [:test]
github
fluent/fluentd
https://github.com/fluent/fluentd
tasks/benchmark.rb
Ruby
apache-2.0
13,530
master
1,323
require "json" require "fileutils" BENCHMARK_FILE_SIZE = 1 * 1024 * 1024 * 1024 BENCHMARK_FILE_PATH = File.expand_path("./tmp/benchmark/data.log") namespace :benchmark do task :init do # Synchronize stdout because the output order is not as intended on Windows environment STDOUT.sync = true end task :p...
github
fluent/fluentd
https://github.com/fluent/fluentd
tasks/backport.rb
Ruby
apache-2.0
13,530
master
925
require_relative 'backport/backporter' =begin When you want to manually execute backporting, set the following environment variables: * GITHUB_REPOSITORY: fluent/fluentd * GITHUB_TOKEN: ${PERSONAL_ACCESS_TOKEN} Optional: * REPOSITORY_REMOTE: origin If you execute in forked repository, it might be 'upstream' =en...
github
fluent/fluentd
https://github.com/fluent/fluentd
tasks/benchmark/patch_in_tail.rb
Ruby
apache-2.0
13,530
master
479
require 'benchmark' require 'fluent/plugin/in_tail' class Fluent::Plugin::TailInput::TailWatcher::IOHandler alias_method :original_with_io, :with_io def with_io(&block) @benchmark_measured_in_tail ||= false # Measure the benchmark only once. return original_with_io(&block) if @benchmark_measured_in_ta...
github
fluent/fluentd
https://github.com/fluent/fluentd
tasks/backport/backporter.rb
Ruby
apache-2.0
13,530
master
6,204
require 'open-uri' require 'json' require 'optparse' require 'logger' class PullRequestBackporter def initialize @logger = Logger.new(STDOUT) @options = { upstream: "fluent/fluentd", branch: "v1.16", dry_run: false, log_level: Logger::Severity::INFO, remote: 'origin' } en...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
github-linguist.gemspec
Ruby
mit
13,437
main
1,581
require File.expand_path('../lib/linguist/version', __FILE__) Gem::Specification.new do |s| s.name = 'github-linguist' s.version = ENV['GEM_VERSION'] || Linguist::VERSION s.summary = "GitHub Language detection" s.description = 'We use this library at GitHub to detect blob languages, highlight code, ignore b...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
Rakefile
Ruby
mit
13,437
main
6,469
require 'bundler/setup' require 'rake/clean' require 'rake/testtask' require 'rake/extensiontask' require 'yaml' require 'yajl' require 'open-uri' require 'json' require 'open3' task :default => :test Rake::TestTask.new gem_spec = Gem::Specification.load('github-linguist.gemspec') Rake::ExtensionTask.new('linguist'...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist.rb
Ruby
mit
13,437
main
3,276
require 'linguist/blob_helper' require 'linguist/generated' require 'linguist/grammars' require 'linguist/heuristics' require 'linguist/language' require 'linguist/repository' require 'linguist/samples' require 'linguist/shebang' require 'linguist/version' require 'linguist/strategy/manpage' require 'linguist/strategy/...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/lazy_blob.rb
Ruby
mit
13,437
main
3,712
require 'linguist/blob_helper' require 'linguist/language' require 'linguist/source/repository' require 'linguist/source/rugged' module Linguist class LazyBlob GIT_ATTR = ['linguist-documentation', 'linguist-language', 'linguist-vendored', 'linguist-generated', ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/blob_helper.rb
Ruby
mit
13,437
main
9,972
require 'linguist/generated' require 'cgi' require 'charlock_holmes' require 'mini_mime' require 'yaml' module Linguist # DEPRECATED Avoid mixing into Blob classes. Prefer functional interfaces # like `Linguist.detect` over `Blob#language`. Functions are much easier to # cache and compose. # # Avoid adding a...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/language.rb
Ruby
mit
13,437
main
13,903
require 'cgi' require 'yaml' begin require 'yajl' rescue LoadError require 'json' end require 'linguist/classifier' require 'linguist/heuristics' require 'linguist/samples' require 'linguist/file_blob' require 'linguist/blob_helper' require 'linguist/strategy/filename' require 'linguist/strategy/extension' require...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/tokenizer.rb
Ruby
mit
13,437
main
484
require 'strscan' require 'linguist/linguist' module Linguist # Generic programming language tokenizer. # # Tokens are designed for use in the language bayes classifier. # It strips any data strings or comments and preserves significant # language symbols. class Tokenizer # Public: Extract tokens from ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/repository.rb
Ruby
mit
13,437
main
5,765
require 'linguist/lazy_blob' require 'linguist/source/repository' require 'linguist/source/rugged' module Linguist # A Repository is an abstraction of a Grit::Repo or a basic file # system tree. It holds a list of paths pointing to Blobish objects. # # Its primary purpose is for gathering language statistics a...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/classifier.rb
Ruby
mit
13,437
main
11,825
require 'linguist/tokenizer' require 'set' module Linguist # Language content classifier. class Classifier # Maximum number of bytes to consider for classification. # This is only used at evaluation time. During training, full content of # samples is used. CLASSIFIER_CONSIDER_BYTES = 50 * 1024 ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/samples.rb
Ruby
mit
13,437
main
3,437
begin require 'yajl' rescue LoadError require 'json' end require 'linguist/sha256' require 'linguist/classifier' require 'linguist/shebang' module Linguist # Model for accessing classifier training data. module Samples # Path to samples root directory ROOT = File.expand_path("../../../samples", __FILE...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/blob.rb
Ruby
mit
13,437
main
1,753
require 'linguist/blob_helper' module Linguist # A Blob is a wrapper around the content of a file to make it quack # like a Grit::Blob. It provides the basic interface: `name`, # `data`, `path` and `size`. class Blob include BlobHelper # Public: Initialize a new Blob. # # path - A path Stri...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/shebang.rb
Ruby
mit
13,437
main
2,311
# frozen_string_literal: true module Linguist class Shebang # Public: Use shebang to detect language of the blob. # # blob - An object that quacks like a blob. # candidates - A list of candidate languages. # # Examples # # Shebang.call(FileBlob.new("path/to/fil...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/file_blob.rb
Ruby
mit
13,437
main
1,182
require 'linguist/blob_helper' require 'linguist/blob' module Linguist # A FileBlob is a wrapper around a File object to make it quack # like a Grit::Blob. It provides the basic interface: `name`, # `data`, `path` and `size`. class FileBlob < Blob include BlobHelper # Public: Initialize a new FileBlob...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/generated.rb
Ruby
mit
13,437
main
29,986
module Linguist class Generated # Public: Is the blob a generated file? # # name - String filename # data - String blob data. A block also may be passed in for lazy # loading. This behavior is deprecated and you should always # pass in a String. # # Return true or false ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/sha256.rb
Ruby
mit
13,437
main
905
require 'digest/sha2' module Linguist module SHA256 # Public: Create deep nested digest of value object. # # Useful for object comparison. # # obj - Object to digest. # # Returns String hex digest def self.hexdigest(obj) digest = Digest::SHA256.new case obj when Str...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/heuristics.rb
Ruby
mit
13,437
main
4,295
require 'yaml' module Linguist # A collection of simple heuristics that can be used to better analyze languages. class Heuristics HEURISTICS_CONSIDER_BYTES = 50 * 1024 # Public: Use heuristics to detect language of the blob. # # blob - An object that quacks like a blob. # possibl...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/grammars.rb
Ruby
mit
13,437
main
234
module Linguist module Grammars # Get the path to the directory containing the language grammar JSON files. # # Returns a String. def self.path File.expand_path("../../../grammars", __FILE__) end end end
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/instrumenter.rb
Ruby
mit
13,437
main
443
module Linguist class BasicInstrumenter attr_reader :detected_info def initialize @detected_info = {} end def instrument(name, payload = {}) if name == "linguist.detected" && payload[:blob] @detected_info[payload[:blob].name] = { strategy: payload[:strategy].name.split(...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/strategy/modeline.rb
Ruby
mit
13,437
main
5,266
module Linguist module Strategy class Modeline EMACS_MODELINE = %r[ (?-m) # Opening delimiter -\*- (?: # Short form: `-*- ruby -*-` [ \t]* (?= [^:;\s]+ # Name of mode [ \t]* # Optional whitespace -\*- ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/strategy/extension.rb
Ruby
mit
13,437
main
1,319
require 'yaml' module Linguist module Strategy # Detects language based on extension class Extension # Public: Use the file extension to detect the blob's language. # # blob - An object that quacks like a blob. # candidates - A list of candidate languages. ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/strategy/filename.rb
Ruby
mit
13,437
main
804
module Linguist module Strategy # Detects language based on filename class Filename # Public: Use the filename to detect the blob's language. # # blob - An object that quacks like a blob. # candidates - A list of candidate languages. # # Examples ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/strategy/manpage.rb
Ruby
mit
13,437
main
1,314
module Linguist module Strategy # Detects man pages based on numeric file extensions with group suffixes. class Manpage # Public: RegExp for matching conventional manpage extensions # # This is the same expression as that used by `github/markup` MANPAGE_EXTS = /\.(?:[1-9](?![0-9])[a-z...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/strategy/xml.rb
Ruby
mit
13,437
main
984
module Linguist module Strategy # Detects XML files based on root tag. class XML # Scope of the search for the root tag # Number of lines to check at the beginning of the file SEARCH_SCOPE = 2 # Public: Use the root tag to detect the XML blobs, only if no other # candidates were...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/source/repository.rb
Ruby
mit
13,437
main
2,423
module Linguist module Source # Repository is an interface for providing direct access to functionality in # a repository of files whose contents can be scanned for language # information. class Repository # Public: get the number of entries in the root tree of the given commit, # with an ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/source/diff.rb
Ruby
mit
13,437
main
1,953
require 'linguist/generated' require 'cgi' require 'charlock_holmes' require 'mini_mime' require 'yaml' module Linguist module Source # Diff is an interface representing a diff between two trees. It is composed # of a collection of iterable deltas between before/after states of files. class Diff # ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
lib/linguist/source/rugged.rb
Ruby
mit
13,437
main
3,051
require 'rugged' require 'linguist/source/diff' module Linguist module Source # RuggedRepository is an implementation of the Source::Repository abstract # class. It represents a Git repository that is accessed using the libgit2 # wrapper Rugged. class RuggedRepository < Linguist::Source::Repository ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_file_blob.rb
Ruby
mit
13,437
main
30,757
require_relative "./helper" class TestFileBlob < Minitest::Test include Linguist def silence_warnings original_verbosity = $VERBOSE $VERBOSE = nil yield ensure $VERBOSE = original_verbosity end def script_blob(name) blob = sample_blob(name) blob.instance_variable_set(:@name, 'script...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_grammars.rb
Ruby
mit
13,437
main
2,621
require_relative "./helper" class TestGrammars < Minitest::Test ROOT = File.expand_path("../..", __FILE__) def setup @grammars = YAML.load(File.read(File.join(ROOT, "grammars.yml"))) end def test_no_duplicate_scopes scopes = @grammars.values.flatten duplicates = scopes.group_by { |s| s }.select {...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_instrumentation.rb
Ruby
mit
13,437
main
1,249
require_relative "./helper" class TestInstrumentation < Minitest::Test include Linguist class LocalInstrumenter Event = Struct.new(:name, :args) attr_reader :events def initialize @events = [] end def instrument(name, *args) @events << Event.new(name, args) yield if block_...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_blob.rb
Ruby
mit
13,437
main
15,457
require_relative "./helper" class TestBlob < Minitest::Test include Linguist def script_blob(name) blob = sample_blob_memory(name) blob.instance_variable_set(:@name, 'script') blob end def test_name assert_equal "foo.rb", sample_blob_memory("Ruby/foo.rb").name end def test_mime_type ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_generated.rb
Ruby
mit
13,437
main
10,534
require_relative "./helper" class TestGenerated < Minitest::Test include Linguist class DataLoadedError < StandardError; end def error_message(blob, negate = false) if negate "#{blob} was incorrectly recognised as a generated file" else "#{blob} was not recognised as a generated file" e...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_cli_integration.rb
Ruby
mit
13,437
main
5,268
require_relative "./helper" require 'tmpdir' require 'fileutils' require 'open3' class TestCLIIntegration < Minitest::Test def setup @temp_dir = Dir.mktmpdir('linguist_cli_test') @original_dir = Dir.pwd Dir.chdir(@temp_dir) # Initialize a git repository system("git init --quiet") system("git...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_pedantic.rb
Ruby
mit
13,437
main
3,086
require_relative "./helper" class TestPedantic < Minitest::Test filename = File.expand_path("../../lib/linguist/languages.yml", __FILE__) LANGUAGES = YAML.load(File.read(filename)) GRAMMARS = YAML.load(File.read(File.expand_path("../../grammars.yml", __FILE__))) GENERICS = YAML.load_file(File.expand_path("../....
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_heuristics.rb
Ruby
mit
13,437
main
35,109
require_relative "./helper" class TestHeuristics < Minitest::Test include Linguist def fixture(name) File.read(File.join(samples_path, name)) end def file_blob(name, alt_name=nil) path = File.exist?(name) ? name : File.join(samples_path, name) blob = FileBlob.new(path) if !alt_name.nil? ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_strategies.rb
Ruby
mit
13,437
main
10,362
require_relative "./helper" class TestStrategies < Minitest::Test include Linguist def assert_modeline(language, blob) if language.nil? assert_nil Linguist::Strategy::Modeline.call(blob).first else assert_equal language, Linguist::Strategy::Modeline.call(blob).first end end def assert...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_basic_instrumenter.rb
Ruby
mit
13,437
main
3,733
require_relative "./helper" class TestBasicInstrumenter < Minitest::Test include Linguist def setup @instrumenter = Linguist::BasicInstrumenter.new Linguist.instrumenter = @instrumenter end def teardown Linguist.instrumenter = nil end def test_tracks_extension_strategy # Ruby file detect...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/helper.rb
Ruby
mit
13,437
main
1,092
require "bundler/setup" require "minitest/autorun" require "mocha/minitest" require "linguist" require "linguist/blob" require "licensee" require "set" def fixtures_path File.expand_path("../fixtures", __FILE__) end def fixture_blob(name) filepath = (name =~ /^\//)? name : File.join(fixtures_path, name) Linguis...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_samples.rb
Ruby
mit
13,437
main
4,417
require_relative "./helper" require "tempfile" class TestSamples < Minitest::Test include Linguist def test_up_to_date assert serialized = Samples.cache assert latest = Samples.data # Just warn, it shouldn't scare people off by breaking the build. if serialized['sha256'] != latest['sha256'] ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_repository.rb
Ruby
mit
13,437
main
10,068
require_relative "./helper" class TestRuggedRepository < Minitest::Test def master_oid '7dbcffcf982e766fc711e633322de848f2b60ba5' end def linguist_repo(oid = master_oid) Linguist::Repository.new(source_repository, oid) end def source_repository @rugged ||= Rugged::Repository.new(File.expand_pat...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_classifier.rb
Ruby
mit
13,437
main
3,074
require_relative "./helper" class TestClassifier < Minitest::Test include Linguist def fixture(name) File.read(File.join(samples_path, name)) end def test_classify db = {} Classifier.train! db, "Ruby", fixture("Ruby/foo.rb") Classifier.train! db, "Objective-C", fixture("Objective-C/Foo.h") ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_tokenizer.rb
Ruby
mit
13,437
main
14,886
require_relative "./helper" class TestTokenizer < Minitest::Test include Linguist def tokenize(data) data = File.read(File.join(samples_path, data.to_s)) if data.is_a?(Symbol) Tokenizer.tokenize(data) end def test_skip_string_literals assert_equal %w(print), tokenize('print ""') assert_equal ...
github
github-linguist/linguist
https://github.com/github-linguist/linguist
test/test_sha256.rb
Ruby
mit
13,437
main
4,222
require_relative "./helper" class TestSHA256 < Minitest::Test include Linguist def test_hexdigest_string assert_equal "15020d93a6f635366cb20229cb3931c3651992dc6df85cddecc743fa11e48a66", SHA256.hexdigest("foo") assert_equal "3da77c2b08c7d29fe3d936b7918039941c0881065dde07d0af9d280d2d475d00", SHA256.hexdiges...