id int32 0 24.9k | repo stringlengths 5 58 | path stringlengths 9 168 | func_name stringlengths 9 130 | original_string stringlengths 66 10.5k | language stringclasses 1
value | code stringlengths 66 10.5k | code_tokens list | docstring stringlengths 8 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 94 266 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,600 | apiqcms/kms | app/services/kms/page_fetcher.rb | Kms.PageFetcher.fetch_templatable_page! | def fetch_templatable_page!
parent_page_path = File.dirname(@path)
parent_page_path = Kms::Page::INDEX_FULLPATH if parent_page_path == "."
parent_page = Kms::Page.published.find_by_fullpath!(parent_page_path)
templatable_pages = parent_page.children.where(templatable: true)
templatable_pag... | ruby | def fetch_templatable_page!
parent_page_path = File.dirname(@path)
parent_page_path = Kms::Page::INDEX_FULLPATH if parent_page_path == "."
parent_page = Kms::Page.published.find_by_fullpath!(parent_page_path)
templatable_pages = parent_page.children.where(templatable: true)
templatable_pag... | [
"def",
"fetch_templatable_page!",
"parent_page_path",
"=",
"File",
".",
"dirname",
"(",
"@path",
")",
"parent_page_path",
"=",
"Kms",
"::",
"Page",
"::",
"INDEX_FULLPATH",
"if",
"parent_page_path",
"==",
"\".\"",
"parent_page",
"=",
"Kms",
"::",
"Page",
".",
"pu... | finds templatable page that works for path | [
"finds",
"templatable",
"page",
"that",
"works",
"for",
"path"
] | a5590ca71c37dee9b45f6e1edf83cf95056932f5 | https://github.com/apiqcms/kms/blob/a5590ca71c37dee9b45f6e1edf83cf95056932f5/app/services/kms/page_fetcher.rb#L15-L23 |
19,601 | apiqcms/kms | app/models/concerns/kms/permalinkable.rb | Kms.Permalinkable.permalink | def permalink
templatable_page = Kms::Page.where(templatable_type: self.class.name).first
if templatable_page
Pathname.new(templatable_page.parent.fullpath).join(slug.to_s).to_s
end
end | ruby | def permalink
templatable_page = Kms::Page.where(templatable_type: self.class.name).first
if templatable_page
Pathname.new(templatable_page.parent.fullpath).join(slug.to_s).to_s
end
end | [
"def",
"permalink",
"templatable_page",
"=",
"Kms",
"::",
"Page",
".",
"where",
"(",
"templatable_type",
":",
"self",
".",
"class",
".",
"name",
")",
".",
"first",
"if",
"templatable_page",
"Pathname",
".",
"new",
"(",
"templatable_page",
".",
"parent",
".",... | Entity should respond to "slug" | [
"Entity",
"should",
"respond",
"to",
"slug"
] | a5590ca71c37dee9b45f6e1edf83cf95056932f5 | https://github.com/apiqcms/kms/blob/a5590ca71c37dee9b45f6e1edf83cf95056932f5/app/models/concerns/kms/permalinkable.rb#L6-L11 |
19,602 | rudionrails/yell | lib/yell/level.rb | Yell.Level.set | def set( *severities )
@severities = Yell::Severities.map { true }
severity = severities.length > 1 ? severities : severities.first
case severity
when Array then at(*severity)
when Range then gte(severity.first).lte(severity.last)
when String then interpret(severity)
when Inte... | ruby | def set( *severities )
@severities = Yell::Severities.map { true }
severity = severities.length > 1 ? severities : severities.first
case severity
when Array then at(*severity)
when Range then gte(severity.first).lte(severity.last)
when String then interpret(severity)
when Inte... | [
"def",
"set",
"(",
"*",
"severities",
")",
"@severities",
"=",
"Yell",
"::",
"Severities",
".",
"map",
"{",
"true",
"}",
"severity",
"=",
"severities",
".",
"length",
">",
"1",
"?",
"severities",
":",
"severities",
".",
"first",
"case",
"severity",
"when... | Create a new level instance.
@example Enable all severities
Yell::Level.new
@example Pass the minimum possible severity
Yell::Level.new :warn
@example Pass an array to exactly set the level at the given severities
Yell::Level.new [:info, :error]
@example Pass a range to set the level within the severit... | [
"Create",
"a",
"new",
"level",
"instance",
"."
] | 4fffff3a4f583ad75b37538d916d0939e498e5a6 | https://github.com/rudionrails/yell/blob/4fffff3a4f583ad75b37538d916d0939e498e5a6/lib/yell/level.rb#L48-L59 |
19,603 | plataformatec/show_for | lib/show_for/helper.rb | ShowFor.Helper.show_for | def show_for(object, html_options={}, &block)
html_options = html_options.dup
tag = html_options.delete(:show_for_tag) || ShowFor.show_for_tag
html_options[:id] ||= dom_id(object)
html_options[:class] = show_for_html_class(object, html_options)
builder = html_options.delete(:builder) |... | ruby | def show_for(object, html_options={}, &block)
html_options = html_options.dup
tag = html_options.delete(:show_for_tag) || ShowFor.show_for_tag
html_options[:id] ||= dom_id(object)
html_options[:class] = show_for_html_class(object, html_options)
builder = html_options.delete(:builder) |... | [
"def",
"show_for",
"(",
"object",
",",
"html_options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"html_options",
"=",
"html_options",
".",
"dup",
"tag",
"=",
"html_options",
".",
"delete",
"(",
":show_for_tag",
")",
"||",
"ShowFor",
".",
"show_for_tag",
"html... | Creates a div around the object and yields a builder.
Example:
show_for @user do |f|
f.attribute :name
f.attribute :email
end | [
"Creates",
"a",
"div",
"around",
"the",
"object",
"and",
"yields",
"a",
"builder",
"."
] | 28166bfd03dc7b9ad54ec2f9939b5b24c8aff76f | https://github.com/plataformatec/show_for/blob/28166bfd03dc7b9ad54ec2f9939b5b24c8aff76f/lib/show_for/helper.rb#L12-L24 |
19,604 | aeseducation/scorm-cloud | lib/scorm_cloud/connection.rb | ScormCloud.Base.execute_call_xml | def execute_call_xml(url)
doc = REXML::Document.new(execute_call_plain(url))
raise create_error(doc) unless doc.elements["rsp"].attributes["stat"] == "ok"
doc
end | ruby | def execute_call_xml(url)
doc = REXML::Document.new(execute_call_plain(url))
raise create_error(doc) unless doc.elements["rsp"].attributes["stat"] == "ok"
doc
end | [
"def",
"execute_call_xml",
"(",
"url",
")",
"doc",
"=",
"REXML",
"::",
"Document",
".",
"new",
"(",
"execute_call_plain",
"(",
"url",
")",
")",
"raise",
"create_error",
"(",
"doc",
")",
"unless",
"doc",
".",
"elements",
"[",
"\"rsp\"",
"]",
".",
"attribu... | Get plain response body and parse the XML doc | [
"Get",
"plain",
"response",
"body",
"and",
"parse",
"the",
"XML",
"doc"
] | 0b822e0a2c2adc9a3308df7d23375fb64b0aff60 | https://github.com/aeseducation/scorm-cloud/blob/0b822e0a2c2adc9a3308df7d23375fb64b0aff60/lib/scorm_cloud/connection.rb#L20-L24 |
19,605 | aeseducation/scorm-cloud | lib/scorm_cloud/connection.rb | ScormCloud.Base.execute_call_plain | def execute_call_plain(url)
res = Net::HTTP.get_response(URI.parse(url))
case res
when Net::HTTPRedirection
# Return the new URL
res['location']
when Net::HTTPSuccess
res.body
else
raise "HTTP Error connecting to scorm cloud: #{res.inspect}"
end
end | ruby | def execute_call_plain(url)
res = Net::HTTP.get_response(URI.parse(url))
case res
when Net::HTTPRedirection
# Return the new URL
res['location']
when Net::HTTPSuccess
res.body
else
raise "HTTP Error connecting to scorm cloud: #{res.inspect}"
end
end | [
"def",
"execute_call_plain",
"(",
"url",
")",
"res",
"=",
"Net",
"::",
"HTTP",
".",
"get_response",
"(",
"URI",
".",
"parse",
"(",
"url",
")",
")",
"case",
"res",
"when",
"Net",
"::",
"HTTPRedirection",
"# Return the new URL",
"res",
"[",
"'location'",
"]"... | Execute the call - returns response body or redirect url | [
"Execute",
"the",
"call",
"-",
"returns",
"response",
"body",
"or",
"redirect",
"url"
] | 0b822e0a2c2adc9a3308df7d23375fb64b0aff60 | https://github.com/aeseducation/scorm-cloud/blob/0b822e0a2c2adc9a3308df7d23375fb64b0aff60/lib/scorm_cloud/connection.rb#L27-L38 |
19,606 | aeseducation/scorm-cloud | lib/scorm_cloud/connection.rb | ScormCloud.Base.prepare_url | def prepare_url(method, params = {})
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
params[:method] = method
params[:appid] = @appid
params[:ts] = timestamp
html_params = params.map { |k,v| "#{k.to_s}=#{v}" }.join("&")
raw = @secret + params.keys.
sort{ |a,b| a.to_s.downcase <=> b.to_s.downca... | ruby | def prepare_url(method, params = {})
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
params[:method] = method
params[:appid] = @appid
params[:ts] = timestamp
html_params = params.map { |k,v| "#{k.to_s}=#{v}" }.join("&")
raw = @secret + params.keys.
sort{ |a,b| a.to_s.downcase <=> b.to_s.downca... | [
"def",
"prepare_url",
"(",
"method",
",",
"params",
"=",
"{",
"}",
")",
"timestamp",
"=",
"Time",
".",
"now",
".",
"utc",
".",
"strftime",
"(",
"'%Y%m%d%H%M%S'",
")",
"params",
"[",
":method",
"]",
"=",
"method",
"params",
"[",
":appid",
"]",
"=",
"@... | Get the URL for the call | [
"Get",
"the",
"URL",
"for",
"the",
"call"
] | 0b822e0a2c2adc9a3308df7d23375fb64b0aff60 | https://github.com/aeseducation/scorm-cloud/blob/0b822e0a2c2adc9a3308df7d23375fb64b0aff60/lib/scorm_cloud/connection.rb#L41-L55 |
19,607 | aeseducation/scorm-cloud | lib/scorm_cloud/base.rb | ScormCloud.Base.create_error | def create_error(doc, url)
err = doc.elements["rsp"].elements["err"]
code = err.attributes["code"]
msg = err.attributes["msg"]
"Error In Scorm Cloud: Error=#{code} Message=#{msg} URL=#{url}"
end | ruby | def create_error(doc, url)
err = doc.elements["rsp"].elements["err"]
code = err.attributes["code"]
msg = err.attributes["msg"]
"Error In Scorm Cloud: Error=#{code} Message=#{msg} URL=#{url}"
end | [
"def",
"create_error",
"(",
"doc",
",",
"url",
")",
"err",
"=",
"doc",
".",
"elements",
"[",
"\"rsp\"",
"]",
".",
"elements",
"[",
"\"err\"",
"]",
"code",
"=",
"err",
".",
"attributes",
"[",
"\"code\"",
"]",
"msg",
"=",
"err",
".",
"attributes",
"[",... | Create an exception with code & message | [
"Create",
"an",
"exception",
"with",
"code",
"&",
"message"
] | 0b822e0a2c2adc9a3308df7d23375fb64b0aff60 | https://github.com/aeseducation/scorm-cloud/blob/0b822e0a2c2adc9a3308df7d23375fb64b0aff60/lib/scorm_cloud/base.rb#L87-L92 |
19,608 | Dan-Q/twee2 | lib/twee2/story_format.rb | Twee2.StoryFormat.compile | def compile
@source.gsub('{{STORY_NAME}}', Twee2::build_config.story_name).gsub('{{STORY_DATA}}', Twee2::build_config.story_file.xmldata).gsub('{{STORY_FORMAT}}', @name)
end | ruby | def compile
@source.gsub('{{STORY_NAME}}', Twee2::build_config.story_name).gsub('{{STORY_DATA}}', Twee2::build_config.story_file.xmldata).gsub('{{STORY_FORMAT}}', @name)
end | [
"def",
"compile",
"@source",
".",
"gsub",
"(",
"'{{STORY_NAME}}'",
",",
"Twee2",
"::",
"build_config",
".",
"story_name",
")",
".",
"gsub",
"(",
"'{{STORY_DATA}}'",
",",
"Twee2",
"::",
"build_config",
".",
"story_file",
".",
"xmldata",
")",
".",
"gsub",
"(",... | Loads the StoryFormat with the specified name
Given a story file, injects it into the StoryFormat and returns the HTML results | [
"Loads",
"the",
"StoryFormat",
"with",
"the",
"specified",
"name",
"Given",
"a",
"story",
"file",
"injects",
"it",
"into",
"the",
"StoryFormat",
"and",
"returns",
"the",
"HTML",
"results"
] | d7659d84b5415d594dcc868628d74c3c9b48f496 | https://github.com/Dan-Q/twee2/blob/d7659d84b5415d594dcc868628d74c3c9b48f496/lib/twee2/story_format.rb#L18-L20 |
19,609 | Dan-Q/twee2 | lib/twee2/story_file.rb | Twee2.StoryFile.run_preprocessors | def run_preprocessors
@passages.each_key do |k|
# HAML
if @passages[k][:tags].include? 'haml'
@passages[k][:content] = Haml::Engine.new(@passages[k][:content], HAML_OPTIONS).render
@passages[k][:tags].delete 'haml'
end
# Coffeescript
if @passages... | ruby | def run_preprocessors
@passages.each_key do |k|
# HAML
if @passages[k][:tags].include? 'haml'
@passages[k][:content] = Haml::Engine.new(@passages[k][:content], HAML_OPTIONS).render
@passages[k][:tags].delete 'haml'
end
# Coffeescript
if @passages... | [
"def",
"run_preprocessors",
"@passages",
".",
"each_key",
"do",
"|",
"k",
"|",
"# HAML\r",
"if",
"@passages",
"[",
"k",
"]",
"[",
":tags",
"]",
".",
"include?",
"'haml'",
"@passages",
"[",
"k",
"]",
"[",
":content",
"]",
"=",
"Haml",
"::",
"Engine",
".... | Runs HAML, Coffeescript etc. preprocessors across each applicable passage | [
"Runs",
"HAML",
"Coffeescript",
"etc",
".",
"preprocessors",
"across",
"each",
"applicable",
"passage"
] | d7659d84b5415d594dcc868628d74c3c9b48f496 | https://github.com/Dan-Q/twee2/blob/d7659d84b5415d594dcc868628d74c3c9b48f496/lib/twee2/story_file.rb#L121-L141 |
19,610 | Katello/hammer-cli-katello | lib/hammer_cli_katello/id_name_options_validator.rb | HammerCLIKatello.IdNameOptionsValidator.validate_id_or_name | def validate_id_or_name(record_name = nil)
child_options = IdNameOptionsValidator.build_child_options(record_name)
validate_options do
any(*child_options).required
end
end | ruby | def validate_id_or_name(record_name = nil)
child_options = IdNameOptionsValidator.build_child_options(record_name)
validate_options do
any(*child_options).required
end
end | [
"def",
"validate_id_or_name",
"(",
"record_name",
"=",
"nil",
")",
"child_options",
"=",
"IdNameOptionsValidator",
".",
"build_child_options",
"(",
"record_name",
")",
"validate_options",
"do",
"any",
"(",
"child_options",
")",
".",
"required",
"end",
"end"
] | This method simply checks that either id or name is supplied
Some examples:
# checks for a --id or --name option
validate_id_or_name
# checks for --content-view-id or --content-view-name
validate_id_or_name :content_view | [
"This",
"method",
"simply",
"checks",
"that",
"either",
"id",
"or",
"name",
"is",
"supplied"
] | 3dfc3237631d2241cbd0bb43049fdc3ce5555b16 | https://github.com/Katello/hammer-cli-katello/blob/3dfc3237631d2241cbd0bb43049fdc3ce5555b16/lib/hammer_cli_katello/id_name_options_validator.rb#L39-L45 |
19,611 | maccman/bowline | lib/bowline/watcher.rb | Bowline.Watcher.call | def call(event, *args)
return unless @listeners[event]
@listeners[event].each do |callback|
callback.call(*args)
end
end | ruby | def call(event, *args)
return unless @listeners[event]
@listeners[event].each do |callback|
callback.call(*args)
end
end | [
"def",
"call",
"(",
"event",
",",
"*",
"args",
")",
"return",
"unless",
"@listeners",
"[",
"event",
"]",
"@listeners",
"[",
"event",
"]",
".",
"each",
"do",
"|",
"callback",
"|",
"callback",
".",
"call",
"(",
"args",
")",
"end",
"end"
] | Call an event's callbacks with provided arguments. | [
"Call",
"an",
"event",
"s",
"callbacks",
"with",
"provided",
"arguments",
"."
] | 33acc83f68fdd2b46e1f217c3b7948047811f492 | https://github.com/maccman/bowline/blob/33acc83f68fdd2b46e1f217c3b7948047811f492/lib/bowline/watcher.rb#L102-L107 |
19,612 | maccman/bowline | lib/bowline/watcher.rb | Bowline.Watcher.remove | def remove(event, value=nil)
return unless @listeners[event]
if value
@listeners[event].delete(value)
if @listeners[event].empty?
@listeners.delete(event)
end
else
@listeners.delete(event)
end
end | ruby | def remove(event, value=nil)
return unless @listeners[event]
if value
@listeners[event].delete(value)
if @listeners[event].empty?
@listeners.delete(event)
end
else
@listeners.delete(event)
end
end | [
"def",
"remove",
"(",
"event",
",",
"value",
"=",
"nil",
")",
"return",
"unless",
"@listeners",
"[",
"event",
"]",
"if",
"value",
"@listeners",
"[",
"event",
"]",
".",
"delete",
"(",
"value",
")",
"if",
"@listeners",
"[",
"event",
"]",
".",
"empty?",
... | Remove an specific callback on an event,
or all an event's callbacks. | [
"Remove",
"an",
"specific",
"callback",
"on",
"an",
"event",
"or",
"all",
"an",
"event",
"s",
"callbacks",
"."
] | 33acc83f68fdd2b46e1f217c3b7948047811f492 | https://github.com/maccman/bowline/blob/33acc83f68fdd2b46e1f217c3b7948047811f492/lib/bowline/watcher.rb#L111-L121 |
19,613 | maccman/bowline | lib/bowline/initializer.rb | Bowline.Initializer.set_autoload_paths | def set_autoload_paths
# Rails 3 master support
if ActiveSupport::Dependencies.respond_to?(:autoload_paths)
ActiveSupport::Dependencies.autoload_paths = configuration.autoload_paths.uniq
ActiveSupport::Dependencies.autoload_once_paths = configuration.autoload_once_paths.uniq
else
... | ruby | def set_autoload_paths
# Rails 3 master support
if ActiveSupport::Dependencies.respond_to?(:autoload_paths)
ActiveSupport::Dependencies.autoload_paths = configuration.autoload_paths.uniq
ActiveSupport::Dependencies.autoload_once_paths = configuration.autoload_once_paths.uniq
else
... | [
"def",
"set_autoload_paths",
"# Rails 3 master support",
"if",
"ActiveSupport",
"::",
"Dependencies",
".",
"respond_to?",
"(",
":autoload_paths",
")",
"ActiveSupport",
"::",
"Dependencies",
".",
"autoload_paths",
"=",
"configuration",
".",
"autoload_paths",
".",
"uniq",
... | Set the paths from which Bowline will automatically load source files, and
the load_once paths. | [
"Set",
"the",
"paths",
"from",
"which",
"Bowline",
"will",
"automatically",
"load",
"source",
"files",
"and",
"the",
"load_once",
"paths",
"."
] | 33acc83f68fdd2b46e1f217c3b7948047811f492 | https://github.com/maccman/bowline/blob/33acc83f68fdd2b46e1f217c3b7948047811f492/lib/bowline/initializer.rb#L112-L121 |
19,614 | maccman/bowline | lib/bowline/initializer.rb | Bowline.Configuration.set_root_path! | def set_root_path!
raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)
raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)
@root_path =
# Pathname is incompatible with Windows, but Windows doesn't have
# real symlinks so File.expand_path is safe.
i... | ruby | def set_root_path!
raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)
raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)
@root_path =
# Pathname is incompatible with Windows, but Windows doesn't have
# real symlinks so File.expand_path is safe.
i... | [
"def",
"set_root_path!",
"raise",
"'APP_ROOT is not set'",
"unless",
"defined?",
"(",
"::",
"APP_ROOT",
")",
"raise",
"'APP_ROOT is not a directory'",
"unless",
"File",
".",
"directory?",
"(",
"::",
"APP_ROOT",
")",
"@root_path",
"=",
"# Pathname is incompatible with Wind... | Create a new Configuration instance, initialized with the default values.
Set the root_path to APP_ROOT and canonicalize it. | [
"Create",
"a",
"new",
"Configuration",
"instance",
"initialized",
"with",
"the",
"default",
"values",
".",
"Set",
"the",
"root_path",
"to",
"APP_ROOT",
"and",
"canonicalize",
"it",
"."
] | 33acc83f68fdd2b46e1f217c3b7948047811f492 | https://github.com/maccman/bowline/blob/33acc83f68fdd2b46e1f217c3b7948047811f492/lib/bowline/initializer.rb#L521-L538 |
19,615 | CocoaPods/cocoapods-stats | lib/cocoapods_stats/target_mapper.rb | CocoaPodsStats.TargetMapper.pods_from_project | def pods_from_project(context, master_pods)
context.umbrella_targets.flat_map do |target|
root_specs = target.specs.map(&:root).uniq
# As it's hard to look up the source of a pod, we
# can check if the pod exists in the master specs repo though
pods = root_specs.
s... | ruby | def pods_from_project(context, master_pods)
context.umbrella_targets.flat_map do |target|
root_specs = target.specs.map(&:root).uniq
# As it's hard to look up the source of a pod, we
# can check if the pod exists in the master specs repo though
pods = root_specs.
s... | [
"def",
"pods_from_project",
"(",
"context",
",",
"master_pods",
")",
"context",
".",
"umbrella_targets",
".",
"flat_map",
"do",
"|",
"target",
"|",
"root_specs",
"=",
"target",
".",
"specs",
".",
"map",
"(",
":root",
")",
".",
"uniq",
"# As it's hard to look u... | Loop though all targets in the pod
generate a collection of hashes | [
"Loop",
"though",
"all",
"targets",
"in",
"the",
"pod",
"generate",
"a",
"collection",
"of",
"hashes"
] | ad869b620a46c6ba5048b54d5772e1956d2d9d83 | https://github.com/CocoaPods/cocoapods-stats/blob/ad869b620a46c6ba5048b54d5772e1956d2d9d83/lib/cocoapods_stats/target_mapper.rb#L8-L31 |
19,616 | matthodan/jekyll-asset-pipeline | lib/jekyll_asset_pipeline/pipeline.rb | JekyllAssetPipeline.Pipeline.collect | def collect
@assets = YAML.safe_load(@manifest).map! do |path|
full_path = File.join(@source, path)
File.open(File.join(@source, path)) do |file|
::JekyllAssetPipeline::Asset.new(file.read, File.basename(path),
File.dirname(full_path))
e... | ruby | def collect
@assets = YAML.safe_load(@manifest).map! do |path|
full_path = File.join(@source, path)
File.open(File.join(@source, path)) do |file|
::JekyllAssetPipeline::Asset.new(file.read, File.basename(path),
File.dirname(full_path))
e... | [
"def",
"collect",
"@assets",
"=",
"YAML",
".",
"safe_load",
"(",
"@manifest",
")",
".",
"map!",
"do",
"|",
"path",
"|",
"full_path",
"=",
"File",
".",
"join",
"(",
"@source",
",",
"path",
")",
"File",
".",
"open",
"(",
"File",
".",
"join",
"(",
"@s... | Collect assets based on manifest | [
"Collect",
"assets",
"based",
"on",
"manifest"
] | fa0be3aa2beae83ab0e46663c433d48750717a46 | https://github.com/matthodan/jekyll-asset-pipeline/blob/fa0be3aa2beae83ab0e46663c433d48750717a46/lib/jekyll_asset_pipeline/pipeline.rb#L114-L126 |
19,617 | matthodan/jekyll-asset-pipeline | lib/jekyll_asset_pipeline/pipeline.rb | JekyllAssetPipeline.Pipeline.convert_asset | def convert_asset(klass, asset)
# Convert asset content
converter = klass.new(asset)
# Replace asset content and filename
asset.content = converter.converted
asset.filename = File.basename(asset.filename, '.*')
# Add back the output extension if no extension left
if File.extn... | ruby | def convert_asset(klass, asset)
# Convert asset content
converter = klass.new(asset)
# Replace asset content and filename
asset.content = converter.converted
asset.filename = File.basename(asset.filename, '.*')
# Add back the output extension if no extension left
if File.extn... | [
"def",
"convert_asset",
"(",
"klass",
",",
"asset",
")",
"# Convert asset content",
"converter",
"=",
"klass",
".",
"new",
"(",
"asset",
")",
"# Replace asset content and filename",
"asset",
".",
"content",
"=",
"converter",
".",
"converted",
"asset",
".",
"filena... | Convert an asset with a given converter class | [
"Convert",
"an",
"asset",
"with",
"a",
"given",
"converter",
"class"
] | fa0be3aa2beae83ab0e46663c433d48750717a46 | https://github.com/matthodan/jekyll-asset-pipeline/blob/fa0be3aa2beae83ab0e46663c433d48750717a46/lib/jekyll_asset_pipeline/pipeline.rb#L148-L164 |
19,618 | matthodan/jekyll-asset-pipeline | lib/jekyll_asset_pipeline/pipeline.rb | JekyllAssetPipeline.Pipeline.compress | def compress
@assets.each do |asset|
# Find a compressor to use
klass = ::JekyllAssetPipeline::Compressor.subclasses.select do |c|
c.filetype == @type
end.last
break unless klass
begin
asset.content = klass.new(asset.content).compressed
rescue ... | ruby | def compress
@assets.each do |asset|
# Find a compressor to use
klass = ::JekyllAssetPipeline::Compressor.subclasses.select do |c|
c.filetype == @type
end.last
break unless klass
begin
asset.content = klass.new(asset.content).compressed
rescue ... | [
"def",
"compress",
"@assets",
".",
"each",
"do",
"|",
"asset",
"|",
"# Find a compressor to use",
"klass",
"=",
"::",
"JekyllAssetPipeline",
"::",
"Compressor",
".",
"subclasses",
".",
"select",
"do",
"|",
"c",
"|",
"c",
".",
"filetype",
"==",
"@type",
"end"... | Compress assets if compressor is defined | [
"Compress",
"assets",
"if",
"compressor",
"is",
"defined"
] | fa0be3aa2beae83ab0e46663c433d48750717a46 | https://github.com/matthodan/jekyll-asset-pipeline/blob/fa0be3aa2beae83ab0e46663c433d48750717a46/lib/jekyll_asset_pipeline/pipeline.rb#L177-L194 |
19,619 | matthodan/jekyll-asset-pipeline | lib/jekyll_asset_pipeline/pipeline.rb | JekyllAssetPipeline.Pipeline.gzip | def gzip
@assets.map! do |asset|
gzip_content = Zlib::Deflate.deflate(asset.content)
[
asset,
::JekyllAssetPipeline::Asset
.new(gzip_content, "#{asset.filename}.gz", asset.dirname)
]
end.flatten!
end | ruby | def gzip
@assets.map! do |asset|
gzip_content = Zlib::Deflate.deflate(asset.content)
[
asset,
::JekyllAssetPipeline::Asset
.new(gzip_content, "#{asset.filename}.gz", asset.dirname)
]
end.flatten!
end | [
"def",
"gzip",
"@assets",
".",
"map!",
"do",
"|",
"asset",
"|",
"gzip_content",
"=",
"Zlib",
"::",
"Deflate",
".",
"deflate",
"(",
"asset",
".",
"content",
")",
"[",
"asset",
",",
"::",
"JekyllAssetPipeline",
"::",
"Asset",
".",
"new",
"(",
"gzip_content... | Create Gzip versions of assets | [
"Create",
"Gzip",
"versions",
"of",
"assets"
] | fa0be3aa2beae83ab0e46663c433d48750717a46 | https://github.com/matthodan/jekyll-asset-pipeline/blob/fa0be3aa2beae83ab0e46663c433d48750717a46/lib/jekyll_asset_pipeline/pipeline.rb#L197-L206 |
19,620 | matthodan/jekyll-asset-pipeline | lib/jekyll_asset_pipeline/pipeline.rb | JekyllAssetPipeline.Pipeline.save | def save
output_path = @options['output_path']
staging_path = @options['staging_path']
@assets.each do |asset|
directory = File.join(@source, staging_path, output_path)
write_asset_file(directory, asset)
# Store output path of saved file
asset.output_path = output_pat... | ruby | def save
output_path = @options['output_path']
staging_path = @options['staging_path']
@assets.each do |asset|
directory = File.join(@source, staging_path, output_path)
write_asset_file(directory, asset)
# Store output path of saved file
asset.output_path = output_pat... | [
"def",
"save",
"output_path",
"=",
"@options",
"[",
"'output_path'",
"]",
"staging_path",
"=",
"@options",
"[",
"'staging_path'",
"]",
"@assets",
".",
"each",
"do",
"|",
"asset",
"|",
"directory",
"=",
"File",
".",
"join",
"(",
"@source",
",",
"staging_path"... | Save assets to file | [
"Save",
"assets",
"to",
"file"
] | fa0be3aa2beae83ab0e46663c433d48750717a46 | https://github.com/matthodan/jekyll-asset-pipeline/blob/fa0be3aa2beae83ab0e46663c433d48750717a46/lib/jekyll_asset_pipeline/pipeline.rb#L209-L220 |
19,621 | starling/starling | lib/starling/queue_collection.rb | StarlingServer.QueueCollection.put | def put(key, data)
queue = queues(key)
return nil unless queue
@stats[:current_bytes] += data.size
@stats[:total_items] += 1
queue.push(data)
return true
end | ruby | def put(key, data)
queue = queues(key)
return nil unless queue
@stats[:current_bytes] += data.size
@stats[:total_items] += 1
queue.push(data)
return true
end | [
"def",
"put",
"(",
"key",
",",
"data",
")",
"queue",
"=",
"queues",
"(",
"key",
")",
"return",
"nil",
"unless",
"queue",
"@stats",
"[",
":current_bytes",
"]",
"+=",
"data",
".",
"size",
"@stats",
"[",
":total_items",
"]",
"+=",
"1",
"queue",
".",
"pu... | Create a new QueueCollection at +path+
Puts +data+ onto the queue named +key+ | [
"Create",
"a",
"new",
"QueueCollection",
"at",
"+",
"path",
"+"
] | 058512e66dec325f6c469e279d5c57a9ce015a89 | https://github.com/starling/starling/blob/058512e66dec325f6c469e279d5c57a9ce015a89/lib/starling/queue_collection.rb#L35-L45 |
19,622 | starling/starling | lib/starling/queue_collection.rb | StarlingServer.QueueCollection.take | def take(key)
queue = queues(key)
if queue.nil? || queue.length == 0
@stats[:get_misses] += 1
return nil
else
@stats[:get_hits] += 1
end
result = queue.pop
@stats[:current_bytes] -= result.size
result
end | ruby | def take(key)
queue = queues(key)
if queue.nil? || queue.length == 0
@stats[:get_misses] += 1
return nil
else
@stats[:get_hits] += 1
end
result = queue.pop
@stats[:current_bytes] -= result.size
result
end | [
"def",
"take",
"(",
"key",
")",
"queue",
"=",
"queues",
"(",
"key",
")",
"if",
"queue",
".",
"nil?",
"||",
"queue",
".",
"length",
"==",
"0",
"@stats",
"[",
":get_misses",
"]",
"+=",
"1",
"return",
"nil",
"else",
"@stats",
"[",
":get_hits",
"]",
"+... | Retrieves data from the queue named +key+ | [
"Retrieves",
"data",
"from",
"the",
"queue",
"named",
"+",
"key",
"+"
] | 058512e66dec325f6c469e279d5c57a9ce015a89 | https://github.com/starling/starling/blob/058512e66dec325f6c469e279d5c57a9ce015a89/lib/starling/queue_collection.rb#L50-L61 |
19,623 | starling/starling | lib/starling/queue_collection.rb | StarlingServer.QueueCollection.queues | def queues(key=nil)
return nil if @shutdown_mutex.locked?
return @queues if key.nil?
# First try to return the queue named 'key' if it's available.
return @queues[key] if @queues[key]
# If the queue wasn't available, create or get the mutex that will
# wrap creation of the Queue.
... | ruby | def queues(key=nil)
return nil if @shutdown_mutex.locked?
return @queues if key.nil?
# First try to return the queue named 'key' if it's available.
return @queues[key] if @queues[key]
# If the queue wasn't available, create or get the mutex that will
# wrap creation of the Queue.
... | [
"def",
"queues",
"(",
"key",
"=",
"nil",
")",
"return",
"nil",
"if",
"@shutdown_mutex",
".",
"locked?",
"return",
"@queues",
"if",
"key",
".",
"nil?",
"# First try to return the queue named 'key' if it's available.",
"return",
"@queues",
"[",
"key",
"]",
"if",
"@q... | Returns all active queues. | [
"Returns",
"all",
"active",
"queues",
"."
] | 058512e66dec325f6c469e279d5c57a9ce015a89 | https://github.com/starling/starling/blob/058512e66dec325f6c469e279d5c57a9ce015a89/lib/starling/queue_collection.rb#L72-L109 |
19,624 | starling/starling | lib/starling/persistent_queue.rb | StarlingServer.PersistentQueue.pop | def pop(log_trx = true)
raise NoTransactionLog if log_trx && !@trx
begin
rv = super(!log_trx)
rescue ThreadError
puts "WARNING: The queue was empty when trying to pop(). Technically this shouldn't ever happen. Probably a bug in the transactional underpinnings. Or maybe shutdown didn't... | ruby | def pop(log_trx = true)
raise NoTransactionLog if log_trx && !@trx
begin
rv = super(!log_trx)
rescue ThreadError
puts "WARNING: The queue was empty when trying to pop(). Technically this shouldn't ever happen. Probably a bug in the transactional underpinnings. Or maybe shutdown didn't... | [
"def",
"pop",
"(",
"log_trx",
"=",
"true",
")",
"raise",
"NoTransactionLog",
"if",
"log_trx",
"&&",
"!",
"@trx",
"begin",
"rv",
"=",
"super",
"(",
"!",
"log_trx",
")",
"rescue",
"ThreadError",
"puts",
"\"WARNING: The queue was empty when trying to pop(). Technically... | Retrieves data from the queue. | [
"Retrieves",
"data",
"from",
"the",
"queue",
"."
] | 058512e66dec325f6c469e279d5c57a9ce015a89 | https://github.com/starling/starling/blob/058512e66dec325f6c469e279d5c57a9ce015a89/lib/starling/persistent_queue.rb#L59-L71 |
19,625 | starling/starling | lib/starling/server.rb | StarlingServer.Base.run | def run
@stats[:start_time] = Time.now
if @opts[:syslog_channel]
begin
require 'syslog_logger'
@@logger = SyslogLogger.new(@opts[:syslog_channel])
rescue LoadError
# SyslogLogger isn't available, so we're just going to use Logger
end
end
@@... | ruby | def run
@stats[:start_time] = Time.now
if @opts[:syslog_channel]
begin
require 'syslog_logger'
@@logger = SyslogLogger.new(@opts[:syslog_channel])
rescue LoadError
# SyslogLogger isn't available, so we're just going to use Logger
end
end
@@... | [
"def",
"run",
"@stats",
"[",
":start_time",
"]",
"=",
"Time",
".",
"now",
"if",
"@opts",
"[",
":syslog_channel",
"]",
"begin",
"require",
"'syslog_logger'",
"@@logger",
"=",
"SyslogLogger",
".",
"new",
"(",
"@opts",
"[",
":syslog_channel",
"]",
")",
"rescue"... | Initialize a new Starling server, but do not accept connections or
process requests.
+opts+ is as for +start+
Start listening and processing requests. | [
"Initialize",
"a",
"new",
"Starling",
"server",
"but",
"do",
"not",
"accept",
"connections",
"or",
"process",
"requests",
"."
] | 058512e66dec325f6c469e279d5c57a9ce015a89 | https://github.com/starling/starling/blob/058512e66dec325f6c469e279d5c57a9ce015a89/lib/starling/server.rb#L67-L103 |
19,626 | starling/starling | lib/starling/handler.rb | StarlingServer.Handler.post_init | def post_init
@stash = []
@data = ""
@data_buf = ""
@server = @opts[:server]
@logger = StarlingServer::Base.logger
@expiry_stats = Hash.new(0)
@expected_length = nil
@server.stats[:total_connections] += 1
set_comm_inactivity_timeout @opts[:timeout]
@queue_coll... | ruby | def post_init
@stash = []
@data = ""
@data_buf = ""
@server = @opts[:server]
@logger = StarlingServer::Base.logger
@expiry_stats = Hash.new(0)
@expected_length = nil
@server.stats[:total_connections] += 1
set_comm_inactivity_timeout @opts[:timeout]
@queue_coll... | [
"def",
"post_init",
"@stash",
"=",
"[",
"]",
"@data",
"=",
"\"\"",
"@data_buf",
"=",
"\"\"",
"@server",
"=",
"@opts",
"[",
":server",
"]",
"@logger",
"=",
"StarlingServer",
"::",
"Base",
".",
"logger",
"@expiry_stats",
"=",
"Hash",
".",
"new",
"(",
"0",
... | Creates a new handler for the MemCache protocol that communicates with a
given client.
Process incoming commands from the attached client. | [
"Creates",
"a",
"new",
"handler",
"for",
"the",
"MemCache",
"protocol",
"that",
"communicates",
"with",
"a",
"given",
"client",
"."
] | 058512e66dec325f6c469e279d5c57a9ce015a89 | https://github.com/starling/starling/blob/058512e66dec325f6c469e279d5c57a9ce015a89/lib/starling/handler.rb#L78-L95 |
19,627 | adamcooke/attach | lib/attach/attachment.rb | Attach.Attachment.child | def child(role)
@cached_children ||= {}
@cached_children[role.to_sym] ||= self.children.where(:role => role).first || :nil
@cached_children[role.to_sym] == :nil ? nil : @cached_children[role.to_sym]
end | ruby | def child(role)
@cached_children ||= {}
@cached_children[role.to_sym] ||= self.children.where(:role => role).first || :nil
@cached_children[role.to_sym] == :nil ? nil : @cached_children[role.to_sym]
end | [
"def",
"child",
"(",
"role",
")",
"@cached_children",
"||=",
"{",
"}",
"@cached_children",
"[",
"role",
".",
"to_sym",
"]",
"||=",
"self",
".",
"children",
".",
"where",
"(",
":role",
"=>",
"role",
")",
".",
"first",
"||",
":nil",
"@cached_children",
"["... | Return a child process | [
"Return",
"a",
"child",
"process"
] | 09aa63f38fa28b215d0a4274851203af56534f07 | https://github.com/adamcooke/attach/blob/09aa63f38fa28b215d0a4274851203af56534f07/lib/attach/attachment.rb#L89-L93 |
19,628 | adamcooke/attach | lib/attach/attachment.rb | Attach.Attachment.add_child | def add_child(role, &block)
attachment = self.children.build
attachment.role = role
attachment.owner = self.owner
attachment.file_name = self.file_name
attachment.file_type = self.file_type
attachment.disposition = self.disposition
attachment.cache_type = self.cache_type
... | ruby | def add_child(role, &block)
attachment = self.children.build
attachment.role = role
attachment.owner = self.owner
attachment.file_name = self.file_name
attachment.file_type = self.file_type
attachment.disposition = self.disposition
attachment.cache_type = self.cache_type
... | [
"def",
"add_child",
"(",
"role",
",",
"&",
"block",
")",
"attachment",
"=",
"self",
".",
"children",
".",
"build",
"attachment",
".",
"role",
"=",
"role",
"attachment",
".",
"owner",
"=",
"self",
".",
"owner",
"attachment",
".",
"file_name",
"=",
"self",... | Add a child attachment | [
"Add",
"a",
"child",
"attachment"
] | 09aa63f38fa28b215d0a4274851203af56534f07 | https://github.com/adamcooke/attach/blob/09aa63f38fa28b215d0a4274851203af56534f07/lib/attach/attachment.rb#L101-L113 |
19,629 | ManageIQ/linux_admin | lib/linux_admin/network_interface.rb | LinuxAdmin.NetworkInterface.netmask6 | def netmask6(scope = :global)
if [:global, :link].include?(scope)
@network_conf["mask6_#{scope}".to_sym] ||= IPAddr.new('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff').mask(prefix6(scope)).to_s if prefix6(scope)
else
raise ArgumentError, "Unrecognized address scope #{scope}"
end
end | ruby | def netmask6(scope = :global)
if [:global, :link].include?(scope)
@network_conf["mask6_#{scope}".to_sym] ||= IPAddr.new('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff').mask(prefix6(scope)).to_s if prefix6(scope)
else
raise ArgumentError, "Unrecognized address scope #{scope}"
end
end | [
"def",
"netmask6",
"(",
"scope",
"=",
":global",
")",
"if",
"[",
":global",
",",
":link",
"]",
".",
"include?",
"(",
"scope",
")",
"@network_conf",
"[",
"\"mask6_#{scope}\"",
".",
"to_sym",
"]",
"||=",
"IPAddr",
".",
"new",
"(",
"'ffff:ffff:ffff:ffff:ffff:ff... | Retrieve the IPv6 sub-net mask assigned to the interface
@return [String] IPv6 netmask
@raise [ArgumentError] if the given scope is not `:global` or `:link` | [
"Retrieve",
"the",
"IPv6",
"sub",
"-",
"net",
"mask",
"assigned",
"to",
"the",
"interface"
] | 6c91b6ea7ccfcbcae617d24618c6df0543dfee28 | https://github.com/ManageIQ/linux_admin/blob/6c91b6ea7ccfcbcae617d24618c6df0543dfee28/lib/linux_admin/network_interface.rb#L100-L106 |
19,630 | ManageIQ/linux_admin | lib/linux_admin/network_interface/network_interface_rh.rb | LinuxAdmin.NetworkInterfaceRH.apply_static | def apply_static(ip, mask, gw, dns, search = nil)
self.address = ip
self.netmask = mask
self.gateway = gw
self.dns = dns
self.search_order = search if search
save
end | ruby | def apply_static(ip, mask, gw, dns, search = nil)
self.address = ip
self.netmask = mask
self.gateway = gw
self.dns = dns
self.search_order = search if search
save
end | [
"def",
"apply_static",
"(",
"ip",
",",
"mask",
",",
"gw",
",",
"dns",
",",
"search",
"=",
"nil",
")",
"self",
".",
"address",
"=",
"ip",
"self",
".",
"netmask",
"=",
"mask",
"self",
".",
"gateway",
"=",
"gw",
"self",
".",
"dns",
"=",
"dns",
"self... | Applies the given static network configuration to the interface
@param ip [String] IPv4 address
@param mask [String] subnet mask
@param gw [String] gateway address
@param dns [Array<String>] list of dns servers
@param search [Array<String>] list of search domains
@return [Boolean] true on success, false otherwis... | [
"Applies",
"the",
"given",
"static",
"network",
"configuration",
"to",
"the",
"interface"
] | 6c91b6ea7ccfcbcae617d24618c6df0543dfee28 | https://github.com/ManageIQ/linux_admin/blob/6c91b6ea7ccfcbcae617d24618c6df0543dfee28/lib/linux_admin/network_interface/network_interface_rh.rb#L132-L139 |
19,631 | ManageIQ/linux_admin | lib/linux_admin/network_interface/network_interface_rh.rb | LinuxAdmin.NetworkInterfaceRH.apply_static6 | def apply_static6(ip, prefix, gw, dns, search = nil)
self.address6 = "#{ip}/#{prefix}"
self.gateway6 = gw
self.dns = dns
self.search_order = search if search
save
end | ruby | def apply_static6(ip, prefix, gw, dns, search = nil)
self.address6 = "#{ip}/#{prefix}"
self.gateway6 = gw
self.dns = dns
self.search_order = search if search
save
end | [
"def",
"apply_static6",
"(",
"ip",
",",
"prefix",
",",
"gw",
",",
"dns",
",",
"search",
"=",
"nil",
")",
"self",
".",
"address6",
"=",
"\"#{ip}/#{prefix}\"",
"self",
".",
"gateway6",
"=",
"gw",
"self",
".",
"dns",
"=",
"dns",
"self",
".",
"search_order... | Applies the given static IPv6 network configuration to the interface
@param ip [String] IPv6 address
@param prefix [Number] prefix length for IPv6 address
@param gw [String] gateway address
@param dns [Array<String>] list of dns servers
@param search [Array<String>] list of search domains
@return [Boolean] true ... | [
"Applies",
"the",
"given",
"static",
"IPv6",
"network",
"configuration",
"to",
"the",
"interface"
] | 6c91b6ea7ccfcbcae617d24618c6df0543dfee28 | https://github.com/ManageIQ/linux_admin/blob/6c91b6ea7ccfcbcae617d24618c6df0543dfee28/lib/linux_admin/network_interface/network_interface_rh.rb#L150-L156 |
19,632 | locomotivecms/custom_fields | lib/custom_fields/source.rb | CustomFields.Source.klass_with_custom_fields | def klass_with_custom_fields(name)
# Rails.logger.debug "[CustomFields] klass_with_custom_fields #{self.send(name).metadata.klass} / #{self.send(name).metadata[:old_klass]}" if defined?(Rails) # DEBUG
recipe = self.custom_fields_recipe_for(name)
_metadata = self.send(name).relation_metadata
t... | ruby | def klass_with_custom_fields(name)
# Rails.logger.debug "[CustomFields] klass_with_custom_fields #{self.send(name).metadata.klass} / #{self.send(name).metadata[:old_klass]}" if defined?(Rails) # DEBUG
recipe = self.custom_fields_recipe_for(name)
_metadata = self.send(name).relation_metadata
t... | [
"def",
"klass_with_custom_fields",
"(",
"name",
")",
"# Rails.logger.debug \"[CustomFields] klass_with_custom_fields #{self.send(name).metadata.klass} / #{self.send(name).metadata[:old_klass]}\" if defined?(Rails) # DEBUG",
"recipe",
"=",
"self",
".",
"custom_fields_recipe_for",
"(",
"name",... | Returns the class enhanced by the custom fields.
Be careful, call this method only if the source class
has been saved with success.
@param [ String, Symbol ] name The name of the relation.
@return [ Class ] The modified class. | [
"Returns",
"the",
"class",
"enhanced",
"by",
"the",
"custom",
"fields",
".",
"Be",
"careful",
"call",
"this",
"method",
"only",
"if",
"the",
"source",
"class",
"has",
"been",
"saved",
"with",
"success",
"."
] | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/source.rb#L36-L42 |
19,633 | locomotivecms/custom_fields | lib/custom_fields/source.rb | CustomFields.Source.collect_custom_fields_diff | def collect_custom_fields_diff(name, fields)
# puts "==> collect_custom_fields_diff for #{name}, #{fields.size}" # DEBUG
memo = self.initialize_custom_fields_diff(name)
fields.map do |field|
field.collect_diff(memo)
end
# collect fields with a modified localized field
fiel... | ruby | def collect_custom_fields_diff(name, fields)
# puts "==> collect_custom_fields_diff for #{name}, #{fields.size}" # DEBUG
memo = self.initialize_custom_fields_diff(name)
fields.map do |field|
field.collect_diff(memo)
end
# collect fields with a modified localized field
fiel... | [
"def",
"collect_custom_fields_diff",
"(",
"name",
",",
"fields",
")",
"# puts \"==> collect_custom_fields_diff for #{name}, #{fields.size}\" # DEBUG",
"memo",
"=",
"self",
".",
"initialize_custom_fields_diff",
"(",
"name",
")",
"fields",
".",
"map",
"do",
"|",
"field",
"|... | Collects all the modifications of the custom fields
@param [ String, Symbol ] name The name of the relation.
@return [ Array ] An array of hashes storing the modifications | [
"Collects",
"all",
"the",
"modifications",
"of",
"the",
"custom",
"fields"
] | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/source.rb#L145-L160 |
19,634 | locomotivecms/custom_fields | lib/custom_fields/source.rb | CustomFields.Source.apply_custom_fields_diff | def apply_custom_fields_diff(name)
# puts "==> apply_custom_fields_recipes for #{name}, #{self._custom_fields_diff[name].inspect}" # DEBUG
operations = self._custom_fields_diff[name]
operations['$set'].merge!({ 'custom_fields_recipe.version' => self.custom_fields_version(name) })
collection, se... | ruby | def apply_custom_fields_diff(name)
# puts "==> apply_custom_fields_recipes for #{name}, #{self._custom_fields_diff[name].inspect}" # DEBUG
operations = self._custom_fields_diff[name]
operations['$set'].merge!({ 'custom_fields_recipe.version' => self.custom_fields_version(name) })
collection, se... | [
"def",
"apply_custom_fields_diff",
"(",
"name",
")",
"# puts \"==> apply_custom_fields_recipes for #{name}, #{self._custom_fields_diff[name].inspect}\" # DEBUG",
"operations",
"=",
"self",
".",
"_custom_fields_diff",
"[",
"name",
"]",
"operations",
"[",
"'$set'",
"]",
".",
"mer... | Apply the modifications collected from the custom fields by
updating all the documents of the relation.
The update uses the power of mongodb to make it fully optimized.
@param [ String, Symbol ] name The name of the relation. | [
"Apply",
"the",
"modifications",
"collected",
"from",
"the",
"custom",
"fields",
"by",
"updating",
"all",
"the",
"documents",
"of",
"the",
"relation",
".",
"The",
"update",
"uses",
"the",
"power",
"of",
"mongodb",
"to",
"make",
"it",
"fully",
"optimized",
".... | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/source.rb#L168-L185 |
19,635 | locomotivecms/custom_fields | lib/custom_fields/source.rb | CustomFields.Source.apply_custom_fields_localize_diff | def apply_custom_fields_localize_diff(name)
return if self._custom_field_localize_diff[name].empty?
self.send(name).all.each do |record|
updates = {}
# puts "[apply_custom_fields_localize_diff] processing: record #{record._id} / #{self._custom_field_localize_diff[name].inspect}" # DEBUG
... | ruby | def apply_custom_fields_localize_diff(name)
return if self._custom_field_localize_diff[name].empty?
self.send(name).all.each do |record|
updates = {}
# puts "[apply_custom_fields_localize_diff] processing: record #{record._id} / #{self._custom_field_localize_diff[name].inspect}" # DEBUG
... | [
"def",
"apply_custom_fields_localize_diff",
"(",
"name",
")",
"return",
"if",
"self",
".",
"_custom_field_localize_diff",
"[",
"name",
"]",
".",
"empty?",
"self",
".",
"send",
"(",
"name",
")",
".",
"all",
".",
"each",
"do",
"|",
"record",
"|",
"updates",
... | If the localized attribute has been changed in at least one of the custom fields,
we have to upgrade all the records enhanced by custom_fields in order to make
the values consistent with the mongoid localize option.
Ex: post.attributes[:name] = 'Hello world' => post.attributes[:name] = { en: 'Hello world' }
@para... | [
"If",
"the",
"localized",
"attribute",
"has",
"been",
"changed",
"in",
"at",
"least",
"one",
"of",
"the",
"custom",
"fields",
"we",
"have",
"to",
"upgrade",
"all",
"the",
"records",
"enhanced",
"by",
"custom_fields",
"in",
"order",
"to",
"make",
"the",
"va... | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/source.rb#L195-L219 |
19,636 | locomotivecms/custom_fields | lib/custom_fields/target_helpers.rb | CustomFields.TargetHelpers.custom_fields_methods | def custom_fields_methods(&filter)
self.custom_fields_recipe['rules'].map do |rule|
method = self.custom_fields_getters_for rule['name'], rule['type']
if block_given?
filter.call(rule) ? method : nil
else
method
end
end.compact.flatten
end | ruby | def custom_fields_methods(&filter)
self.custom_fields_recipe['rules'].map do |rule|
method = self.custom_fields_getters_for rule['name'], rule['type']
if block_given?
filter.call(rule) ? method : nil
else
method
end
end.compact.flatten
end | [
"def",
"custom_fields_methods",
"(",
"&",
"filter",
")",
"self",
".",
"custom_fields_recipe",
"[",
"'rules'",
"]",
".",
"map",
"do",
"|",
"rule",
"|",
"method",
"=",
"self",
".",
"custom_fields_getters_for",
"rule",
"[",
"'name'",
"]",
",",
"rule",
"[",
"'... | Return the list of the getters dynamically based on the
custom_fields recipe in order to get the formatted values
of the custom fields.
If a block is passed, then the list will be filtered accordingly with
the following logic. If the block is evaluated as true, then the method
will be kept in the list, otherwise i... | [
"Return",
"the",
"list",
"of",
"the",
"getters",
"dynamically",
"based",
"on",
"the",
"custom_fields",
"recipe",
"in",
"order",
"to",
"get",
"the",
"formatted",
"values",
"of",
"the",
"custom",
"fields",
".",
"If",
"a",
"block",
"is",
"passed",
"then",
"th... | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/target_helpers.rb#L20-L29 |
19,637 | locomotivecms/custom_fields | lib/custom_fields/target_helpers.rb | CustomFields.TargetHelpers.custom_fields_safe_setters | def custom_fields_safe_setters
self.custom_fields_recipe['rules'].map do |rule|
case rule['type'].to_sym
when :date, :date_time, :money then "formatted_#{rule['name']}"
when :file then [rule['name'], "remove_#{rule['name']}", "remote_#{rule['name']}_url"]
when... | ruby | def custom_fields_safe_setters
self.custom_fields_recipe['rules'].map do |rule|
case rule['type'].to_sym
when :date, :date_time, :money then "formatted_#{rule['name']}"
when :file then [rule['name'], "remove_#{rule['name']}", "remote_#{rule['name']}_url"]
when... | [
"def",
"custom_fields_safe_setters",
"self",
".",
"custom_fields_recipe",
"[",
"'rules'",
"]",
".",
"map",
"do",
"|",
"rule",
"|",
"case",
"rule",
"[",
"'type'",
"]",
".",
"to_sym",
"when",
":date",
",",
":date_time",
",",
":money",
"then",
"\"formatted_#{rule... | List all the setters that are used by the custom_fields
in order to get updated thru a html form for instance.
@return [ List ] a list of method names (string) | [
"List",
"all",
"the",
"setters",
"that",
"are",
"used",
"by",
"the",
"custom_fields",
"in",
"order",
"to",
"get",
"updated",
"thru",
"a",
"html",
"form",
"for",
"instance",
"."
] | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/target_helpers.rb#L36-L47 |
19,638 | locomotivecms/custom_fields | lib/custom_fields/target_helpers.rb | CustomFields.TargetHelpers.custom_fields_basic_attributes | def custom_fields_basic_attributes
{}.tap do |hash|
self.non_relationship_custom_fields.each do |rule|
name, type = rule['name'], rule['type'].to_sym
# method of the custom getter
method_name = "#{type}_attribute_get"
hash.merge!(self.class.send(method_name, self,... | ruby | def custom_fields_basic_attributes
{}.tap do |hash|
self.non_relationship_custom_fields.each do |rule|
name, type = rule['name'], rule['type'].to_sym
# method of the custom getter
method_name = "#{type}_attribute_get"
hash.merge!(self.class.send(method_name, self,... | [
"def",
"custom_fields_basic_attributes",
"{",
"}",
".",
"tap",
"do",
"|",
"hash",
"|",
"self",
".",
"non_relationship_custom_fields",
".",
"each",
"do",
"|",
"rule",
"|",
"name",
",",
"type",
"=",
"rule",
"[",
"'name'",
"]",
",",
"rule",
"[",
"'type'",
"... | Build a hash for all the non-relationship fields
meaning string, text, date, boolean, select, file types.
This hash stores their name and their value.
@return [ Hash ] Field name / formatted value | [
"Build",
"a",
"hash",
"for",
"all",
"the",
"non",
"-",
"relationship",
"fields",
"meaning",
"string",
"text",
"date",
"boolean",
"select",
"file",
"types",
".",
"This",
"hash",
"stores",
"their",
"name",
"and",
"their",
"value",
"."
] | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/target_helpers.rb#L55-L66 |
19,639 | locomotivecms/custom_fields | lib/custom_fields/target_helpers.rb | CustomFields.TargetHelpers.is_a_custom_field_many_relationship? | def is_a_custom_field_many_relationship?(name)
rule = self.custom_fields_recipe['rules'].detect do |rule|
rule['name'] == name && _custom_field_many_relationship?(rule['type'])
end
end | ruby | def is_a_custom_field_many_relationship?(name)
rule = self.custom_fields_recipe['rules'].detect do |rule|
rule['name'] == name && _custom_field_many_relationship?(rule['type'])
end
end | [
"def",
"is_a_custom_field_many_relationship?",
"(",
"name",
")",
"rule",
"=",
"self",
".",
"custom_fields_recipe",
"[",
"'rules'",
"]",
".",
"detect",
"do",
"|",
"rule",
"|",
"rule",
"[",
"'name'",
"]",
"==",
"name",
"&&",
"_custom_field_many_relationship?",
"("... | Check if the rule defined by the name is a "many" relationship kind.
A "many" relationship includes "has_many" and "many_to_many"
@param [ String ] name The name of the rule
@return [ Boolean ] True if the rule is a "many" relationship kind. | [
"Check",
"if",
"the",
"rule",
"defined",
"by",
"the",
"name",
"is",
"a",
"many",
"relationship",
"kind",
".",
"A",
"many",
"relationship",
"includes",
"has_many",
"and",
"many_to_many"
] | 251b1b93472506f5eb255d60d92f65bcfc354095 | https://github.com/locomotivecms/custom_fields/blob/251b1b93472506f5eb255d60d92f65bcfc354095/lib/custom_fields/target_helpers.rb#L91-L95 |
19,640 | Instrumental/instrumental_agent-ruby | lib/instrumental/agent.rb | Instrumental.Agent.gauge | def gauge(metric, value, time = Time.now, count = 1)
if valid?(metric, value, time, count) &&
send_command("gauge", metric, value, time.to_i, count.to_i)
value
else
nil
end
rescue Exception => e
report_exception(e)
nil
end | ruby | def gauge(metric, value, time = Time.now, count = 1)
if valid?(metric, value, time, count) &&
send_command("gauge", metric, value, time.to_i, count.to_i)
value
else
nil
end
rescue Exception => e
report_exception(e)
nil
end | [
"def",
"gauge",
"(",
"metric",
",",
"value",
",",
"time",
"=",
"Time",
".",
"now",
",",
"count",
"=",
"1",
")",
"if",
"valid?",
"(",
"metric",
",",
"value",
",",
"time",
",",
"count",
")",
"&&",
"send_command",
"(",
"\"gauge\"",
",",
"metric",
",",... | Sets up a connection to the collector.
Instrumental::Agent.new(API_KEY)
Instrumental::Agent.new(API_KEY, :collector => 'hostname:port')
Store a gauge for a metric, optionally at a specific time.
agent.gauge('load', 1.23) | [
"Sets",
"up",
"a",
"connection",
"to",
"the",
"collector",
"."
] | 24c518299217b24fccfa6b01e7a659519554c7a1 | https://github.com/Instrumental/instrumental_agent-ruby/blob/24c518299217b24fccfa6b01e7a659519554c7a1/lib/instrumental/agent.rb#L94-L104 |
19,641 | Instrumental/instrumental_agent-ruby | lib/instrumental/agent.rb | Instrumental.Agent.time | def time(metric, multiplier = 1)
start = Time.now
begin
result = yield
ensure
finish = Time.now
duration = finish - start
gauge(metric, duration * multiplier, start)
end
result
end | ruby | def time(metric, multiplier = 1)
start = Time.now
begin
result = yield
ensure
finish = Time.now
duration = finish - start
gauge(metric, duration * multiplier, start)
end
result
end | [
"def",
"time",
"(",
"metric",
",",
"multiplier",
"=",
"1",
")",
"start",
"=",
"Time",
".",
"now",
"begin",
"result",
"=",
"yield",
"ensure",
"finish",
"=",
"Time",
".",
"now",
"duration",
"=",
"finish",
"-",
"start",
"gauge",
"(",
"metric",
",",
"dur... | Store the duration of a block in a metric. multiplier can be used
to scale the duration to desired unit or change the duration in
some meaningful way.
agent.time('response_time') do
# potentially slow stuff
end
agent.time('response_time_in_ms', 1000) do
# potentially slow stuff
end
ids = [1, 2, 3... | [
"Store",
"the",
"duration",
"of",
"a",
"block",
"in",
"a",
"metric",
".",
"multiplier",
"can",
"be",
"used",
"to",
"scale",
"the",
"duration",
"to",
"desired",
"unit",
"or",
"change",
"the",
"duration",
"in",
"some",
"meaningful",
"way",
"."
] | 24c518299217b24fccfa6b01e7a659519554c7a1 | https://github.com/Instrumental/instrumental_agent-ruby/blob/24c518299217b24fccfa6b01e7a659519554c7a1/lib/instrumental/agent.rb#L122-L132 |
19,642 | Instrumental/instrumental_agent-ruby | lib/instrumental/agent.rb | Instrumental.Agent.cleanup | def cleanup
if running?
logger.info "Cleaning up agent, queue size: #{@queue.size}, thread running: #{@thread.alive?}"
@allow_reconnect = false
if @queue.size > 0
queue_message('exit')
begin
with_timeout(EXIT_FLUSH_TIMEOUT) { @thread.join }
rescue ... | ruby | def cleanup
if running?
logger.info "Cleaning up agent, queue size: #{@queue.size}, thread running: #{@thread.alive?}"
@allow_reconnect = false
if @queue.size > 0
queue_message('exit')
begin
with_timeout(EXIT_FLUSH_TIMEOUT) { @thread.join }
rescue ... | [
"def",
"cleanup",
"if",
"running?",
"logger",
".",
"info",
"\"Cleaning up agent, queue size: #{@queue.size}, thread running: #{@thread.alive?}\"",
"@allow_reconnect",
"=",
"false",
"if",
"@queue",
".",
"size",
">",
"0",
"queue_message",
"(",
"'exit'",
")",
"begin",
"with_... | Called when a process is exiting to give it some extra time to
push events to the service. An at_exit handler is automatically
registered for this method, but can be called manually in cases
where at_exit is bypassed like Resque workers. | [
"Called",
"when",
"a",
"process",
"is",
"exiting",
"to",
"give",
"it",
"some",
"extra",
"time",
"to",
"push",
"events",
"to",
"the",
"service",
".",
"An",
"at_exit",
"handler",
"is",
"automatically",
"registered",
"for",
"this",
"method",
"but",
"can",
"be... | 24c518299217b24fccfa6b01e7a659519554c7a1 | https://github.com/Instrumental/instrumental_agent-ruby/blob/24c518299217b24fccfa6b01e7a659519554c7a1/lib/instrumental/agent.rb#L222-L239 |
19,643 | cryptape/ruby-bitcoin-secp256k1 | lib/secp256k1/ecdsa.rb | Secp256k1.ECDSA.ecdsa_signature_normalize | def ecdsa_signature_normalize(raw_sig, check_only: false)
sigout = check_only ? nil : C::ECDSASignature.new.pointer
res = C.secp256k1_ecdsa_signature_normalize(@ctx, sigout, raw_sig)
[res == 1, sigout]
end | ruby | def ecdsa_signature_normalize(raw_sig, check_only: false)
sigout = check_only ? nil : C::ECDSASignature.new.pointer
res = C.secp256k1_ecdsa_signature_normalize(@ctx, sigout, raw_sig)
[res == 1, sigout]
end | [
"def",
"ecdsa_signature_normalize",
"(",
"raw_sig",
",",
"check_only",
":",
"false",
")",
"sigout",
"=",
"check_only",
"?",
"nil",
":",
"C",
"::",
"ECDSASignature",
".",
"new",
".",
"pointer",
"res",
"=",
"C",
".",
"secp256k1_ecdsa_signature_normalize",
"(",
"... | Check and optionally convert a signature to a normalized lower-S form. If
check_only is `true` then the normalized signature is not returned.
This function always return a tuple containing a boolean (`true` if not
previously normalized or `false` if signature was already normalized),
and the normalized signature. ... | [
"Check",
"and",
"optionally",
"convert",
"a",
"signature",
"to",
"a",
"normalized",
"lower",
"-",
"S",
"form",
".",
"If",
"check_only",
"is",
"true",
"then",
"the",
"normalized",
"signature",
"is",
"not",
"returned",
"."
] | ae975c29648246aa0662cc9d7c6f2fc7a83a0bed | https://github.com/cryptape/ruby-bitcoin-secp256k1/blob/ae975c29648246aa0662cc9d7c6f2fc7a83a0bed/lib/secp256k1/ecdsa.rb#L56-L60 |
19,644 | cryptape/ruby-bitcoin-secp256k1 | lib/secp256k1/key.rb | Secp256k1.PublicKey.combine | def combine(pubkeys)
raise ArgumentError, 'must give at least 1 pubkey' if pubkeys.empty?
outpub = FFI::Pubkey.new.pointer
#pubkeys.each {|item| }
res = C.secp256k1_ec_pubkey_combine(@ctx, outpub, pubkeys, pubkeys.size)
raise AssertError, 'failed to combine public keys' unless res == 1
... | ruby | def combine(pubkeys)
raise ArgumentError, 'must give at least 1 pubkey' if pubkeys.empty?
outpub = FFI::Pubkey.new.pointer
#pubkeys.each {|item| }
res = C.secp256k1_ec_pubkey_combine(@ctx, outpub, pubkeys, pubkeys.size)
raise AssertError, 'failed to combine public keys' unless res == 1
... | [
"def",
"combine",
"(",
"pubkeys",
")",
"raise",
"ArgumentError",
",",
"'must give at least 1 pubkey'",
"if",
"pubkeys",
".",
"empty?",
"outpub",
"=",
"FFI",
"::",
"Pubkey",
".",
"new",
".",
"pointer",
"#pubkeys.each {|item| }",
"res",
"=",
"C",
".",
"secp256k1_e... | Add a number of public keys together. | [
"Add",
"a",
"number",
"of",
"public",
"keys",
"together",
"."
] | ae975c29648246aa0662cc9d7c6f2fc7a83a0bed | https://github.com/cryptape/ruby-bitcoin-secp256k1/blob/ae975c29648246aa0662cc9d7c6f2fc7a83a0bed/lib/secp256k1/key.rb#L72-L83 |
19,645 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.get_room | def get_room
response = self.class.get(@api.get_room_config[:url],
:query => {:auth_token => @token }.merge(@api.get_room_config[:query_params]),
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :room, room_id, response
response.parsed_response
end | ruby | def get_room
response = self.class.get(@api.get_room_config[:url],
:query => {:auth_token => @token }.merge(@api.get_room_config[:query_params]),
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :room, room_id, response
response.parsed_response
end | [
"def",
"get_room",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
".",
"get_room_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
".",
"merge",
"(",
"@api",
".",
"get_room_config",
"[",
":query_par... | Retrieve data for this room | [
"Retrieve",
"data",
"for",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L20-L28 |
19,646 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.update_room | def update_room(options = {})
merged_options = {
:privacy => 'public',
:is_archived => false,
:is_guest_accessible => false
}.merge symbolize(options)
response = self.class.send(@api.topic_config[:method], @api.update_room_config[:url],
:query => { :auth_token => @toke... | ruby | def update_room(options = {})
merged_options = {
:privacy => 'public',
:is_archived => false,
:is_guest_accessible => false
}.merge symbolize(options)
response = self.class.send(@api.topic_config[:method], @api.update_room_config[:url],
:query => { :auth_token => @toke... | [
"def",
"update_room",
"(",
"options",
"=",
"{",
"}",
")",
"merged_options",
"=",
"{",
":privacy",
"=>",
"'public'",
",",
":is_archived",
"=>",
"false",
",",
":is_guest_accessible",
"=>",
"false",
"}",
".",
"merge",
"symbolize",
"(",
"options",
")",
"response... | Update a room | [
"Update",
"a",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L31-L52 |
19,647 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.delete_room | def delete_room
response = self.class.send(@api.delete_room_config[:method], @api.delete_room_config[:url],
:query => {:auth_token => @token }.merge(@api.get_room_config[:query_params]),
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
true... | ruby | def delete_room
response = self.class.send(@api.delete_room_config[:method], @api.delete_room_config[:url],
:query => {:auth_token => @token }.merge(@api.get_room_config[:query_params]),
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
true... | [
"def",
"delete_room",
"response",
"=",
"self",
".",
"class",
".",
"send",
"(",
"@api",
".",
"delete_room_config",
"[",
":method",
"]",
",",
"@api",
".",
"delete_room_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
... | Delete a room | [
"Delete",
"a",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L55-L61 |
19,648 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.invite | def invite(user, reason='')
response = self.class.post(@api.invite_config[:url]+"/#{user}",
:query => { :auth_token => @token },
:body => {
:reason => reason
}.to_json,
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
... | ruby | def invite(user, reason='')
response = self.class.post(@api.invite_config[:url]+"/#{user}",
:query => { :auth_token => @token },
:body => {
:reason => reason
}.to_json,
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
... | [
"def",
"invite",
"(",
"user",
",",
"reason",
"=",
"''",
")",
"response",
"=",
"self",
".",
"class",
".",
"post",
"(",
"@api",
".",
"invite_config",
"[",
":url",
"]",
"+",
"\"/#{user}\"",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
"... | Invite user to this room | [
"Invite",
"user",
"to",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L64-L74 |
19,649 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.add_member | def add_member(user, room_roles=['room_member'])
response = self.class.put(@api.member_config[:url]+"/#{user}",
:query => { :auth_token => @token },
:body => {
:room_roles => room_roles
}.to_json,
:headers => @api.headers)
ErrorHandler.response_code_to_exception_fo... | ruby | def add_member(user, room_roles=['room_member'])
response = self.class.put(@api.member_config[:url]+"/#{user}",
:query => { :auth_token => @token },
:body => {
:room_roles => room_roles
}.to_json,
:headers => @api.headers)
ErrorHandler.response_code_to_exception_fo... | [
"def",
"add_member",
"(",
"user",
",",
"room_roles",
"=",
"[",
"'room_member'",
"]",
")",
"response",
"=",
"self",
".",
"class",
".",
"put",
"(",
"@api",
".",
"member_config",
"[",
":url",
"]",
"+",
"\"/#{user}\"",
",",
":query",
"=>",
"{",
":auth_token"... | Add member to this room | [
"Add",
"member",
"to",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L77-L87 |
19,650 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.members | def members(options = {})
response = self.class.get(@api.member_config[:url],
:query => { :auth_token => @token }.merge(options),
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
wrap_users(response)
end | ruby | def members(options = {})
response = self.class.get(@api.member_config[:url],
:query => { :auth_token => @token }.merge(options),
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
wrap_users(response)
end | [
"def",
"members",
"(",
"options",
"=",
"{",
"}",
")",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
".",
"member_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
".",
"merge",
"(",
"options",
... | Get a list of members in this room
This is all people who have been added a to a private room | [
"Get",
"a",
"list",
"of",
"members",
"in",
"this",
"room",
"This",
"is",
"all",
"people",
"who",
"have",
"been",
"added",
"a",
"to",
"a",
"private",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L91-L98 |
19,651 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.participants | def participants(options = {})
response = self.class.get(@api.participant_config[:url],
:query => { :auth_token => @token }.merge(options),
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
wrap_users(response)
end | ruby | def participants(options = {})
response = self.class.get(@api.participant_config[:url],
:query => { :auth_token => @token }.merge(options),
:headers => @api.headers)
ErrorHandler.response_code_to_exception_for :room, room_id, response
wrap_users(response)
end | [
"def",
"participants",
"(",
"options",
"=",
"{",
"}",
")",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
".",
"participant_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
".",
"merge",
"(",
"... | Get a list of participants in this room
This is all people currently in the room | [
"Get",
"a",
"list",
"of",
"participants",
"in",
"this",
"room",
"This",
"is",
"all",
"people",
"currently",
"in",
"the",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L102-L109 |
19,652 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.send_message | def send_message(message)
response = self.class.post(@api.send_message_config[:url],
:query => { :auth_token => @token },
:body => {
:room_id => room_id,
:message => message,
}.send(@api.send_config[:body_format]),
:headers => @api.headers
)
ErrorH... | ruby | def send_message(message)
response = self.class.post(@api.send_message_config[:url],
:query => { :auth_token => @token },
:body => {
:room_id => room_id,
:message => message,
}.send(@api.send_config[:body_format]),
:headers => @api.headers
)
ErrorH... | [
"def",
"send_message",
"(",
"message",
")",
"response",
"=",
"self",
".",
"class",
".",
"post",
"(",
"@api",
".",
"send_message_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
",",
":body",
"=>",
"{",
":room_id",
... | Send a message to this room.
Usage:
# Default
send 'some message' | [
"Send",
"a",
"message",
"to",
"this",
"room",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L118-L130 |
19,653 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.send | def send(from, message, options_or_notify = {})
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end
if options_or_notify == true or options_or_notify == false
warn 'DEPRECATED: Specify notify flag as an option (e.g., :notif... | ruby | def send(from, message, options_or_notify = {})
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end
if options_or_notify == true or options_or_notify == false
warn 'DEPRECATED: Specify notify flag as an option (e.g., :notif... | [
"def",
"send",
"(",
"from",
",",
"message",
",",
"options_or_notify",
"=",
"{",
"}",
")",
"if",
"from",
".",
"length",
">",
"20",
"raise",
"UsernameTooLong",
",",
"\"Username #{from} is `#{from.length} characters long. Limit is 20'\"",
"end",
"if",
"options_or_notify"... | Send a notification message to this room.
Usage:
# Default
send 'nickname', 'some message'
# Notify users and color the message red
send 'nickname', 'some message', :notify => true, :color => 'red'
# Notify users (deprecated)
send 'nickname', 'some message', true
Options:
+color+:: "yellow",... | [
"Send",
"a",
"notification",
"message",
"to",
"this",
"room",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L152-L183 |
19,654 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.send_file | def send_file(from, message, file)
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end
response = self.class.post(@api.send_file_config[:url],
:query => { :auth_token => @token },
:body => file_body(
{
... | ruby | def send_file(from, message, file)
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end
response = self.class.post(@api.send_file_config[:url],
:query => { :auth_token => @token },
:body => file_body(
{
... | [
"def",
"send_file",
"(",
"from",
",",
"message",
",",
"file",
")",
"if",
"from",
".",
"length",
">",
"20",
"raise",
"UsernameTooLong",
",",
"\"Username #{from} is `#{from.length} characters long. Limit is 20'\"",
"end",
"response",
"=",
"self",
".",
"class",
".",
... | Send a file to this room.
Usage:
# Default
send_file 'nickname', 'some message', File.open("/path/to/file") | [
"Send",
"a",
"file",
"to",
"this",
"room",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L221-L240 |
19,655 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.topic | def topic(new_topic, options = {})
merged_options = { :from => 'API' }.merge options
response = self.class.send(@api.topic_config[:method], @api.topic_config[:url],
:query => { :auth_token => @token },
:body => {
:room_id => room_id,
:from => merged_op... | ruby | def topic(new_topic, options = {})
merged_options = { :from => 'API' }.merge options
response = self.class.send(@api.topic_config[:method], @api.topic_config[:url],
:query => { :auth_token => @token },
:body => {
:room_id => room_id,
:from => merged_op... | [
"def",
"topic",
"(",
"new_topic",
",",
"options",
"=",
"{",
"}",
")",
"merged_options",
"=",
"{",
":from",
"=>",
"'API'",
"}",
".",
"merge",
"options",
"response",
"=",
"self",
".",
"class",
".",
"send",
"(",
"@api",
".",
"topic_config",
"[",
":method"... | Change this room's topic
Usage:
# Default
topic 'my awesome topic'
Options:
+from+:: the name of the person changing the topic
(default "API") | [
"Change",
"this",
"room",
"s",
"topic"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L253-L269 |
19,656 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.history | def history(options = {})
merged_options = {
:date => 'recent',
:timezone => 'UTC',
:format => 'JSON',
:'max-results' => 100,
:'start-index' => 0,
:'end-date' => nil
}.merge options
response = self.class.get(@api.history_config[:url],
:query =>... | ruby | def history(options = {})
merged_options = {
:date => 'recent',
:timezone => 'UTC',
:format => 'JSON',
:'max-results' => 100,
:'start-index' => 0,
:'end-date' => nil
}.merge options
response = self.class.get(@api.history_config[:url],
:query =>... | [
"def",
"history",
"(",
"options",
"=",
"{",
"}",
")",
"merged_options",
"=",
"{",
":date",
"=>",
"'recent'",
",",
":timezone",
"=>",
"'UTC'",
",",
":format",
"=>",
"'JSON'",
",",
":'",
"'",
"=>",
"100",
",",
":'",
"'",
"=>",
"0",
",",
":'",
"'",
... | Pull this room's history
Usage
# Default
Options
+date+:: Whether to return a specific day (YYYY-MM-DD format) or recent
(default "recent")
+timezone+:: Your timezone. Supported timezones are at: https://www.hipchat.com/docs/api/timezones
(default "UTC")
+format+:: Fo... | [
"Pull",
"this",
"room",
"s",
"history"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L286-L313 |
19,657 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.statistics | def statistics(options = {})
response = self.class.get(@api.statistics_config[:url],
:query => {
:room_id => room_id,
:date => options[:date],
:timezone => options[:timezone],
:format => options[:format],
:auth_token => @token,
}.re... | ruby | def statistics(options = {})
response = self.class.get(@api.statistics_config[:url],
:query => {
:room_id => room_id,
:date => options[:date],
:timezone => options[:timezone],
:format => options[:format],
:auth_token => @token,
}.re... | [
"def",
"statistics",
"(",
"options",
"=",
"{",
"}",
")",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
".",
"statistics_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":room_id",
"=>",
"room_id",
",",
":date",
"=>",
"options",
... | Pull this room's statistics | [
"Pull",
"this",
"room",
"s",
"statistics"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L316-L331 |
19,658 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.create_webhook | def create_webhook(url, event, options = {})
raise InvalidEvent.new("Invalid event: #{event}") unless %w(room_message room_notification room_exit room_enter room_topic_change room_archived room_deleted room_unarchived).include? event
begin
u = URI::parse(url)
raise InvalidUrl.new("Invalid S... | ruby | def create_webhook(url, event, options = {})
raise InvalidEvent.new("Invalid event: #{event}") unless %w(room_message room_notification room_exit room_enter room_topic_change room_archived room_deleted room_unarchived).include? event
begin
u = URI::parse(url)
raise InvalidUrl.new("Invalid S... | [
"def",
"create_webhook",
"(",
"url",
",",
"event",
",",
"options",
"=",
"{",
"}",
")",
"raise",
"InvalidEvent",
".",
"new",
"(",
"\"Invalid event: #{event}\"",
")",
"unless",
"%w(",
"room_message",
"room_notification",
"room_exit",
"room_enter",
"room_topic_change",... | Create a webhook for this room
Usage:
# Default
create_webhook 'http://example.org/path/to/my/webhook', 'room_event'
Options:
+pattern+:: The regular expression pattern to match against messages. Only applicable for message events.
(default "")
+name+:: The label for this webhook
... | [
"Create",
"a",
"webhook",
"for",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L346-L371 |
19,659 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.delete_webhook | def delete_webhook(webhook_id)
response = self.class.delete("#{@api.webhook_config[:url]}/#{URI::escape(webhook_id)}",
:query => {
:auth_token => @token
},
:headers => @api.headers... | ruby | def delete_webhook(webhook_id)
response = self.class.delete("#{@api.webhook_config[:url]}/#{URI::escape(webhook_id)}",
:query => {
:auth_token => @token
},
:headers => @api.headers... | [
"def",
"delete_webhook",
"(",
"webhook_id",
")",
"response",
"=",
"self",
".",
"class",
".",
"delete",
"(",
"\"#{@api.webhook_config[:url]}/#{URI::escape(webhook_id)}\"",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
",",
":headers",
"=>",
"@api",
... | Delete a webhook for this room
Usage:
# Default
delete_webhook 'webhook_id' | [
"Delete",
"a",
"webhook",
"for",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L379-L389 |
19,660 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.get_all_webhooks | def get_all_webhooks(options = {})
merged_options = {:'start-index' => 0, :'max-results' => 100}.merge(options)
response = self.class.get(@api.webhook_config[:url],
:query => {
:auth_token => @token,
... | ruby | def get_all_webhooks(options = {})
merged_options = {:'start-index' => 0, :'max-results' => 100}.merge(options)
response = self.class.get(@api.webhook_config[:url],
:query => {
:auth_token => @token,
... | [
"def",
"get_all_webhooks",
"(",
"options",
"=",
"{",
"}",
")",
"merged_options",
"=",
"{",
":'",
"'",
"=>",
"0",
",",
":'",
"'",
"=>",
"100",
"}",
".",
"merge",
"(",
"options",
")",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
... | Gets all webhooks for this room
Usage:
# Default
get_all_webhooks
Options:
+start-index+:: The regular expression pattern to match against messages. Only applicable for message events.
(default "")
+max-results+:: The label for this webhook
(default "") | [
"Gets",
"all",
"webhooks",
"for",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L404-L418 |
19,661 | hipchat/hipchat-rb | lib/hipchat/room.rb | HipChat.Room.get_webhook | def get_webhook(webhook_id)
response = self.class.get("#{@api.webhook_config[:url]}/#{URI::escape(webhook_id)}",
:query => {
:auth_token => @token
},
:headers => @api.headers
)
... | ruby | def get_webhook(webhook_id)
response = self.class.get("#{@api.webhook_config[:url]}/#{URI::escape(webhook_id)}",
:query => {
:auth_token => @token
},
:headers => @api.headers
)
... | [
"def",
"get_webhook",
"(",
"webhook_id",
")",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"\"#{@api.webhook_config[:url]}/#{URI::escape(webhook_id)}\"",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
",",
":headers",
"=>",
"@api",
".",
... | Get a webhook for this room
Usage:
# Default
get_webhook 'webhook_id' | [
"Get",
"a",
"webhook",
"for",
"this",
"room"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/room.rb#L426-L436 |
19,662 | seatgeek/soulmate | lib/soulmate/loader.rb | Soulmate.Loader.add | def add(item, opts = {})
opts = { :skip_duplicate_check => false }.merge(opts)
raise ArgumentError, "Items must specify both an id and a term" unless item["id"] && item["term"]
# kill any old items with this id
remove("id" => item["id"]) unless opts[:skip_duplicate_check]
Sou... | ruby | def add(item, opts = {})
opts = { :skip_duplicate_check => false }.merge(opts)
raise ArgumentError, "Items must specify both an id and a term" unless item["id"] && item["term"]
# kill any old items with this id
remove("id" => item["id"]) unless opts[:skip_duplicate_check]
Sou... | [
"def",
"add",
"(",
"item",
",",
"opts",
"=",
"{",
"}",
")",
"opts",
"=",
"{",
":skip_duplicate_check",
"=>",
"false",
"}",
".",
"merge",
"(",
"opts",
")",
"raise",
"ArgumentError",
",",
"\"Items must specify both an id and a term\"",
"unless",
"item",
"[",
"... | "id", "term", "score", "aliases", "data" | [
"id",
"term",
"score",
"aliases",
"data"
] | 0f5a62122e07ac672fcb7e8854f586b61539057b | https://github.com/seatgeek/soulmate/blob/0f5a62122e07ac672fcb7e8854f586b61539057b/lib/soulmate/loader.rb#L29-L45 |
19,663 | seatgeek/soulmate | lib/soulmate/loader.rb | Soulmate.Loader.remove | def remove(item)
prev_item = Soulmate.redis.hget(database, item["id"])
if prev_item
prev_item = MultiJson.decode(prev_item)
# undo the operations done in add
Soulmate.redis.pipelined do
Soulmate.redis.hdel(database, prev_item["id"])
phrase = ([prev_item["term"]] +... | ruby | def remove(item)
prev_item = Soulmate.redis.hget(database, item["id"])
if prev_item
prev_item = MultiJson.decode(prev_item)
# undo the operations done in add
Soulmate.redis.pipelined do
Soulmate.redis.hdel(database, prev_item["id"])
phrase = ([prev_item["term"]] +... | [
"def",
"remove",
"(",
"item",
")",
"prev_item",
"=",
"Soulmate",
".",
"redis",
".",
"hget",
"(",
"database",
",",
"item",
"[",
"\"id\"",
"]",
")",
"if",
"prev_item",
"prev_item",
"=",
"MultiJson",
".",
"decode",
"(",
"prev_item",
")",
"# undo the operation... | remove only cares about an item's id, but for consistency takes an object | [
"remove",
"only",
"cares",
"about",
"an",
"item",
"s",
"id",
"but",
"for",
"consistency",
"takes",
"an",
"object"
] | 0f5a62122e07ac672fcb7e8854f586b61539057b | https://github.com/seatgeek/soulmate/blob/0f5a62122e07ac672fcb7e8854f586b61539057b/lib/soulmate/loader.rb#L48-L62 |
19,664 | hipchat/hipchat-rb | lib/hipchat/user.rb | HipChat.User.send | def send(message, options = {})
message_format = options[:message_format] ? options[:message_format] : 'text'
notify = options[:notify] ? options[:notify] : false
response = self.class.post(@api.send_config[:url],
:query => { :auth_token => @to... | ruby | def send(message, options = {})
message_format = options[:message_format] ? options[:message_format] : 'text'
notify = options[:notify] ? options[:notify] : false
response = self.class.post(@api.send_config[:url],
:query => { :auth_token => @to... | [
"def",
"send",
"(",
"message",
",",
"options",
"=",
"{",
"}",
")",
"message_format",
"=",
"options",
"[",
":message_format",
"]",
"?",
"options",
"[",
":message_format",
"]",
":",
"'text'",
"notify",
"=",
"options",
"[",
":notify",
"]",
"?",
"options",
"... | Send a private message to user. | [
"Send",
"a",
"private",
"message",
"to",
"user",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/user.rb#L22-L37 |
19,665 | hipchat/hipchat-rb | lib/hipchat/user.rb | HipChat.User.send_file | def send_file(message, file)
response = self.class.post(@api.send_file_config[:url],
:query => { :auth_token => @token },
:body => file_body({ :message => message }.send(@api.send_config[:body_format]), file),
:headers => file_body_headers(@api.headers)
)
ErrorHandler.response... | ruby | def send_file(message, file)
response = self.class.post(@api.send_file_config[:url],
:query => { :auth_token => @token },
:body => file_body({ :message => message }.send(@api.send_config[:body_format]), file),
:headers => file_body_headers(@api.headers)
)
ErrorHandler.response... | [
"def",
"send_file",
"(",
"message",
",",
"file",
")",
"response",
"=",
"self",
".",
"class",
".",
"post",
"(",
"@api",
".",
"send_file_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
",",
":body",
"=>",
"file_bo... | Send a private file to user. | [
"Send",
"a",
"private",
"file",
"to",
"user",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/user.rb#L42-L51 |
19,666 | hipchat/hipchat-rb | lib/hipchat/user.rb | HipChat.User.view | def view
response = self.class.get(@api.view_config[:url],
:query => { :auth_token => @token }.merge(@api.view_config[:query_params]),
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :user, user_id, response
... | ruby | def view
response = self.class.get(@api.view_config[:url],
:query => { :auth_token => @token }.merge(@api.view_config[:query_params]),
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :user, user_id, response
... | [
"def",
"view",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
".",
"view_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
".",
"merge",
"(",
"@api",
".",
"view_config",
"[",
":query_params",
"]",... | Get a user's details. | [
"Get",
"a",
"user",
"s",
"details",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/user.rb#L56-L64 |
19,667 | hipchat/hipchat-rb | lib/hipchat/user.rb | HipChat.User.rooms | def rooms
response = self.class.get(@api.user_joined_rooms_config[:url],
:query => { :auth_token => @token }.merge(@api.user_joined_rooms_config[:query_params]),
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :user... | ruby | def rooms
response = self.class.get(@api.user_joined_rooms_config[:url],
:query => { :auth_token => @token }.merge(@api.user_joined_rooms_config[:query_params]),
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :user... | [
"def",
"rooms",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"@api",
".",
"user_joined_rooms_config",
"[",
":url",
"]",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
".",
"merge",
"(",
"@api",
".",
"user_joined_rooms_config",
"["... | Getting all rooms details in which user is present | [
"Getting",
"all",
"rooms",
"details",
"in",
"which",
"user",
"is",
"present"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/user.rb#L157-L164 |
19,668 | hipchat/hipchat-rb | lib/hipchat/file_helper.rb | HipChat.FileHelper.file_body | def file_body(message, file)
file_name = File.basename(file.path)
mime_type = MimeMagic.by_path(file_name)
file_content = Base64.encode64(file.read)
body = ["--#{BOUNDARY}"]
body << 'Content-Type: application/json; charset=UTF-8'
body << 'Content-Disposition: attachment; name="meta... | ruby | def file_body(message, file)
file_name = File.basename(file.path)
mime_type = MimeMagic.by_path(file_name)
file_content = Base64.encode64(file.read)
body = ["--#{BOUNDARY}"]
body << 'Content-Type: application/json; charset=UTF-8'
body << 'Content-Disposition: attachment; name="meta... | [
"def",
"file_body",
"(",
"message",
",",
"file",
")",
"file_name",
"=",
"File",
".",
"basename",
"(",
"file",
".",
"path",
")",
"mime_type",
"=",
"MimeMagic",
".",
"by_path",
"(",
"file_name",
")",
"file_content",
"=",
"Base64",
".",
"encode64",
"(",
"fi... | Builds a multipart file body for the api.
message - a message to attach
file - a File instance | [
"Builds",
"a",
"multipart",
"file",
"body",
"for",
"the",
"api",
"."
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/file_helper.rb#L14-L32 |
19,669 | hipchat/hipchat-rb | lib/hipchat/client.rb | HipChat.Client.scopes | def scopes(room: nil)
path = "#{@api.scopes_config[:url]}/#{URI::escape(@token)}"
response = self.class.get(path,
:query => { :auth_token => @token },
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :room, 'scopes', response
return response['scopes'] ... | ruby | def scopes(room: nil)
path = "#{@api.scopes_config[:url]}/#{URI::escape(@token)}"
response = self.class.get(path,
:query => { :auth_token => @token },
:headers => @api.headers
)
ErrorHandler.response_code_to_exception_for :room, 'scopes', response
return response['scopes'] ... | [
"def",
"scopes",
"(",
"room",
":",
"nil",
")",
"path",
"=",
"\"#{@api.scopes_config[:url]}/#{URI::escape(@token)}\"",
"response",
"=",
"self",
".",
"class",
".",
"get",
"(",
"path",
",",
":query",
"=>",
"{",
":auth_token",
"=>",
"@token",
"}",
",",
":headers",... | Returns the scopes for the Auth token
Calls the endpoint:
https://api.hipchat.com/v2/oauth/token/#{token}
The response is a JSON object containing a client key. The client
object contains a list of allowed scopes.
There are two possible response types, for a global API token, the
room object will be... | [
"Returns",
"the",
"scopes",
"for",
"the",
"Auth",
"token"
] | 523578ecb7fe68cde347225c210dfd3bc1a64c48 | https://github.com/hipchat/hipchat-rb/blob/523578ecb7fe68cde347225c210dfd3bc1a64c48/lib/hipchat/client.rb#L52-L63 |
19,670 | instana/ruby-sensor | lib/instana/tracing/span.rb | Instana.Span.add_stack | def add_stack(limit: nil, stack: Kernel.caller)
frame_count = 0
@data[:stack] = []
stack.each do |i|
# If the stack has the full instana gem version in it's path
# then don't include that frame. Also don't exclude the Rack module.
if !i.match(/instana\/instrumentation\/rack.rb... | ruby | def add_stack(limit: nil, stack: Kernel.caller)
frame_count = 0
@data[:stack] = []
stack.each do |i|
# If the stack has the full instana gem version in it's path
# then don't include that frame. Also don't exclude the Rack module.
if !i.match(/instana\/instrumentation\/rack.rb... | [
"def",
"add_stack",
"(",
"limit",
":",
"nil",
",",
"stack",
":",
"Kernel",
".",
"caller",
")",
"frame_count",
"=",
"0",
"@data",
"[",
":stack",
"]",
"=",
"[",
"]",
"stack",
".",
"each",
"do",
"|",
"i",
"|",
"# If the stack has the full instana gem version ... | Adds a backtrace to this span
@param limit [Integer] Limit the backtrace to the top <limit> frames | [
"Adds",
"a",
"backtrace",
"to",
"this",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/span.rb#L55-L77 |
19,671 | instana/ruby-sensor | lib/instana/tracing/span.rb | Instana.Span.add_error | def add_error(e)
@data[:error] = true
if @data.key?(:ec)
@data[:ec] = @data[:ec] + 1
else
@data[:ec] = 1
end
# If a valid exception has been passed in, log the information about it
# In case of just logging an error for things such as HTTP client 5xx
# respons... | ruby | def add_error(e)
@data[:error] = true
if @data.key?(:ec)
@data[:ec] = @data[:ec] + 1
else
@data[:ec] = 1
end
# If a valid exception has been passed in, log the information about it
# In case of just logging an error for things such as HTTP client 5xx
# respons... | [
"def",
"add_error",
"(",
"e",
")",
"@data",
"[",
":error",
"]",
"=",
"true",
"if",
"@data",
".",
"key?",
"(",
":ec",
")",
"@data",
"[",
":ec",
"]",
"=",
"@data",
"[",
":ec",
"]",
"+",
"1",
"else",
"@data",
"[",
":ec",
"]",
"=",
"1",
"end",
"#... | Log an error into the span
@param e [Exception] The exception to be logged | [
"Log",
"an",
"error",
"into",
"the",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/span.rb#L83-L108 |
19,672 | instana/ruby-sensor | lib/instana/tracing/span.rb | Instana.Span.set_tags | def set_tags(tags)
return unless tags.is_a?(Hash)
tags.each do |k,v|
set_tag(k, v)
end
self
end | ruby | def set_tags(tags)
return unless tags.is_a?(Hash)
tags.each do |k,v|
set_tag(k, v)
end
self
end | [
"def",
"set_tags",
"(",
"tags",
")",
"return",
"unless",
"tags",
".",
"is_a?",
"(",
"Hash",
")",
"tags",
".",
"each",
"do",
"|",
"k",
",",
"v",
"|",
"set_tag",
"(",
"k",
",",
"v",
")",
"end",
"self",
"end"
] | Helper method to add multiple tags to this span
@params tags [Hash]
@return [Span] | [
"Helper",
"method",
"to",
"add",
"multiple",
"tags",
"to",
"this",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/span.rb#L304-L310 |
19,673 | instana/ruby-sensor | lib/instana/tracing/span.rb | Instana.Span.tags | def tags(key = nil)
if custom?
tags = @data[:data][:sdk][:custom][:tags]
else
tags = @data[:data][key]
end
key ? tags[key] : tags
end | ruby | def tags(key = nil)
if custom?
tags = @data[:data][:sdk][:custom][:tags]
else
tags = @data[:data][key]
end
key ? tags[key] : tags
end | [
"def",
"tags",
"(",
"key",
"=",
"nil",
")",
"if",
"custom?",
"tags",
"=",
"@data",
"[",
":data",
"]",
"[",
":sdk",
"]",
"[",
":custom",
"]",
"[",
":tags",
"]",
"else",
"tags",
"=",
"@data",
"[",
":data",
"]",
"[",
"key",
"]",
"end",
"key",
"?",... | Retrieve the hash of tags for this span | [
"Retrieve",
"the",
"hash",
"of",
"tags",
"for",
"this",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/span.rb#L342-L349 |
19,674 | curationexperts/riiif | app/services/riiif/resize.rb | Riiif.Resize.reduce? | def reduce?
case size
when IIIF::Image::Size::Full, IIIF::Image::Size::Max
false
when IIIF::Image::Size::Absolute
aspect_ratio = width.to_f / height
in_delta?(image_info.aspect, aspect_ratio, 0.001)
else
true
end
end | ruby | def reduce?
case size
when IIIF::Image::Size::Full, IIIF::Image::Size::Max
false
when IIIF::Image::Size::Absolute
aspect_ratio = width.to_f / height
in_delta?(image_info.aspect, aspect_ratio, 0.001)
else
true
end
end | [
"def",
"reduce?",
"case",
"size",
"when",
"IIIF",
"::",
"Image",
"::",
"Size",
"::",
"Full",
",",
"IIIF",
"::",
"Image",
"::",
"Size",
"::",
"Max",
"false",
"when",
"IIIF",
"::",
"Image",
"::",
"Size",
"::",
"Absolute",
"aspect_ratio",
"=",
"width",
".... | Should we reduce this image with KDU? | [
"Should",
"we",
"reduce",
"this",
"image",
"with",
"KDU?"
] | e55e2632d21b19080c23054cc6d94e74efba568f | https://github.com/curationexperts/riiif/blob/e55e2632d21b19080c23054cc6d94e74efba568f/app/services/riiif/resize.rb#L62-L72 |
19,675 | curationexperts/riiif | app/transformers/riiif/kakadu_transformer.rb | Riiif.KakaduTransformer.post_process | def post_process(intermediate_file, reduction_factor)
# Calculate a new set of transforms with respect to reduction_factor
transformation = if reduction_factor
reduce(without_crop, reduction_factor)
else
without_crop
... | ruby | def post_process(intermediate_file, reduction_factor)
# Calculate a new set of transforms with respect to reduction_factor
transformation = if reduction_factor
reduce(without_crop, reduction_factor)
else
without_crop
... | [
"def",
"post_process",
"(",
"intermediate_file",
",",
"reduction_factor",
")",
"# Calculate a new set of transforms with respect to reduction_factor",
"transformation",
"=",
"if",
"reduction_factor",
"reduce",
"(",
"without_crop",
",",
"reduction_factor",
")",
"else",
"without_... | The data we get back from kdu_expand is a bmp and we need to change it
to the requested format by calling Imagemagick. | [
"The",
"data",
"we",
"get",
"back",
"from",
"kdu_expand",
"is",
"a",
"bmp",
"and",
"we",
"need",
"to",
"change",
"it",
"to",
"the",
"requested",
"format",
"by",
"calling",
"Imagemagick",
"."
] | e55e2632d21b19080c23054cc6d94e74efba568f | https://github.com/curationexperts/riiif/blob/e55e2632d21b19080c23054cc6d94e74efba568f/app/transformers/riiif/kakadu_transformer.rb#L23-L31 |
19,676 | curationexperts/riiif | app/transformers/riiif/kakadu_transformer.rb | Riiif.KakaduTransformer.without_crop | def without_crop
IIIF::Image::Transformation.new(region: IIIF::Image::Region::Full.new,
size: transformation.size.dup,
quality: transformation.quality,
rotation: transformation.rotation,
... | ruby | def without_crop
IIIF::Image::Transformation.new(region: IIIF::Image::Region::Full.new,
size: transformation.size.dup,
quality: transformation.quality,
rotation: transformation.rotation,
... | [
"def",
"without_crop",
"IIIF",
"::",
"Image",
"::",
"Transformation",
".",
"new",
"(",
"region",
":",
"IIIF",
"::",
"Image",
"::",
"Region",
"::",
"Full",
".",
"new",
",",
"size",
":",
"transformation",
".",
"size",
".",
"dup",
",",
"quality",
":",
"tr... | Create a clone of the Transformation, without the crop
@return [IIIF::Image::Transformation] a new transformation | [
"Create",
"a",
"clone",
"of",
"the",
"Transformation",
"without",
"the",
"crop"
] | e55e2632d21b19080c23054cc6d94e74efba568f | https://github.com/curationexperts/riiif/blob/e55e2632d21b19080c23054cc6d94e74efba568f/app/transformers/riiif/kakadu_transformer.rb#L37-L43 |
19,677 | curationexperts/riiif | app/transformers/riiif/kakadu_transformer.rb | Riiif.KakaduTransformer.reduce | def reduce(transformation, factor)
resize = Resize.new(transformation.size, image_info)
IIIF::Image::Transformation.new(region: transformation.region.dup,
size: resize.reduce(factor),
quality: transformation.quality,
... | ruby | def reduce(transformation, factor)
resize = Resize.new(transformation.size, image_info)
IIIF::Image::Transformation.new(region: transformation.region.dup,
size: resize.reduce(factor),
quality: transformation.quality,
... | [
"def",
"reduce",
"(",
"transformation",
",",
"factor",
")",
"resize",
"=",
"Resize",
".",
"new",
"(",
"transformation",
".",
"size",
",",
"image_info",
")",
"IIIF",
"::",
"Image",
"::",
"Transformation",
".",
"new",
"(",
"region",
":",
"transformation",
".... | Create a clone of this Transformation, scaled by the factor
@param [IIIF::Image::Transformation] transformation the transformation to clone
@param [Integer] factor the scale for the new transformation
@return [Transformation] a new transformation, scaled by factor | [
"Create",
"a",
"clone",
"of",
"this",
"Transformation",
"scaled",
"by",
"the",
"factor"
] | e55e2632d21b19080c23054cc6d94e74efba568f | https://github.com/curationexperts/riiif/blob/e55e2632d21b19080c23054cc6d94e74efba568f/app/transformers/riiif/kakadu_transformer.rb#L49-L56 |
19,678 | instana/ruby-sensor | lib/instana/agent.rb | Instana.Agent.setup | def setup
# The announce timer
# We attempt to announce this ruby sensor to the host agent.
# In case of failure, we try again in 30 seconds.
@announce_timer = @timers.every(30) do
if @state == :unannounced
if host_agent_available? && announce_sensor
transition_to(:... | ruby | def setup
# The announce timer
# We attempt to announce this ruby sensor to the host agent.
# In case of failure, we try again in 30 seconds.
@announce_timer = @timers.every(30) do
if @state == :unannounced
if host_agent_available? && announce_sensor
transition_to(:... | [
"def",
"setup",
"# The announce timer",
"# We attempt to announce this ruby sensor to the host agent.",
"# In case of failure, we try again in 30 seconds.",
"@announce_timer",
"=",
"@timers",
".",
"every",
"(",
"30",
")",
"do",
"if",
"@state",
"==",
":unannounced",
"if",
"host_... | Sets up periodic timers and starts the agent in a background thread. | [
"Sets",
"up",
"periodic",
"timers",
"and",
"starts",
"the",
"agent",
"in",
"a",
"background",
"thread",
"."
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/agent.rb#L111-L146 |
19,679 | instana/ruby-sensor | lib/instana/agent.rb | Instana.Agent.start | def start
if !host_agent_available?
if !ENV.key?("INSTANA_QUIET")
::Instana.logger.warn "Host agent not available. Will retry periodically. (Set env INSTANA_QUIET=1 to shut these messages off)"
end
end
loop do
if @state == :unannounced
@collect_timer.pause... | ruby | def start
if !host_agent_available?
if !ENV.key?("INSTANA_QUIET")
::Instana.logger.warn "Host agent not available. Will retry periodically. (Set env INSTANA_QUIET=1 to shut these messages off)"
end
end
loop do
if @state == :unannounced
@collect_timer.pause... | [
"def",
"start",
"if",
"!",
"host_agent_available?",
"if",
"!",
"ENV",
".",
"key?",
"(",
"\"INSTANA_QUIET\"",
")",
"::",
"Instana",
".",
"logger",
".",
"warn",
"\"Host agent not available. Will retry periodically. (Set env INSTANA_QUIET=1 to shut these messages off)\"",
"end"... | Starts the timer loop for the timers that were initialized
in the setup method. This is blocking and should only be
called from an already initialized background thread. | [
"Starts",
"the",
"timer",
"loop",
"for",
"the",
"timers",
"that",
"were",
"initialized",
"in",
"the",
"setup",
"method",
".",
"This",
"is",
"blocking",
"and",
"should",
"only",
"be",
"called",
"from",
"an",
"already",
"initialized",
"background",
"thread",
"... | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/agent.rb#L152-L182 |
19,680 | instana/ruby-sensor | lib/instana/agent.rb | Instana.Agent.announce_sensor | def announce_sensor
unless @discovered
::Instana.logger.debug("#{__method__} called but discovery hasn't run yet!")
return false
end
# Always re-collect process info before announce in case the process name has been
# re-written (looking at you puma!)
@process = ::Instana:... | ruby | def announce_sensor
unless @discovered
::Instana.logger.debug("#{__method__} called but discovery hasn't run yet!")
return false
end
# Always re-collect process info before announce in case the process name has been
# re-written (looking at you puma!)
@process = ::Instana:... | [
"def",
"announce_sensor",
"unless",
"@discovered",
"::",
"Instana",
".",
"logger",
".",
"debug",
"(",
"\"#{__method__} called but discovery hasn't run yet!\"",
")",
"return",
"false",
"end",
"# Always re-collect process info before announce in case the process name has been",
"# re... | Collect process ID, name and arguments to notify
the host agent. | [
"Collect",
"process",
"ID",
"name",
"and",
"arguments",
"to",
"notify",
"the",
"host",
"agent",
"."
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/agent.rb#L187-L236 |
19,681 | instana/ruby-sensor | lib/instana/agent.rb | Instana.Agent.report_metrics | def report_metrics(payload)
unless @discovered
::Instana.logger.debug("#{__method__} called but discovery hasn't run yet!")
return false
end
path = "com.instana.plugin.ruby.#{@process[:report_pid]}"
uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/... | ruby | def report_metrics(payload)
unless @discovered
::Instana.logger.debug("#{__method__} called but discovery hasn't run yet!")
return false
end
path = "com.instana.plugin.ruby.#{@process[:report_pid]}"
uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/... | [
"def",
"report_metrics",
"(",
"payload",
")",
"unless",
"@discovered",
"::",
"Instana",
".",
"logger",
".",
"debug",
"(",
"\"#{__method__} called but discovery hasn't run yet!\"",
")",
"return",
"false",
"end",
"path",
"=",
"\"com.instana.plugin.ruby.#{@process[:report_pid]... | Method to report metrics data to the host agent.
@param paylod [Hash] The collection of metrics to report.
@return [Boolean] true on success, false otherwise | [
"Method",
"to",
"report",
"metrics",
"data",
"to",
"the",
"host",
"agent",
"."
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/agent.rb#L244-L274 |
19,682 | instana/ruby-sensor | lib/instana/agent.rb | Instana.Agent.report_spans | def report_spans(spans)
return unless @state == :announced
unless @discovered
::Instana.logger.debug("#{__method__} called but discovery hasn't run yet!")
return false
end
path = "com.instana.plugin.ruby/traces.#{@process[:report_pid]}"
uri = URI.parse("http://#{@discover... | ruby | def report_spans(spans)
return unless @state == :announced
unless @discovered
::Instana.logger.debug("#{__method__} called but discovery hasn't run yet!")
return false
end
path = "com.instana.plugin.ruby/traces.#{@process[:report_pid]}"
uri = URI.parse("http://#{@discover... | [
"def",
"report_spans",
"(",
"spans",
")",
"return",
"unless",
"@state",
"==",
":announced",
"unless",
"@discovered",
"::",
"Instana",
".",
"logger",
".",
"debug",
"(",
"\"#{__method__} called but discovery hasn't run yet!\"",
")",
"return",
"false",
"end",
"path",
"... | Accept and report spans to the host agent.
@param traces [Array] An array of [Span]
@return [Boolean] | [
"Accept",
"and",
"report",
"spans",
"to",
"the",
"host",
"agent",
"."
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/agent.rb#L281-L309 |
19,683 | instana/ruby-sensor | lib/instana/agent.rb | Instana.Agent.host_agent_available? | def host_agent_available?
@discovered ||= run_discovery
if @discovered
# Try default location or manually configured (if so)
uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/")
req = Net::HTTP::Get.new(uri)
response = make_host_agent_request(r... | ruby | def host_agent_available?
@discovered ||= run_discovery
if @discovered
# Try default location or manually configured (if so)
uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/")
req = Net::HTTP::Get.new(uri)
response = make_host_agent_request(r... | [
"def",
"host_agent_available?",
"@discovered",
"||=",
"run_discovery",
"if",
"@discovered",
"# Try default location or manually configured (if so)",
"uri",
"=",
"URI",
".",
"parse",
"(",
"\"http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/\"",
")",
"req",
"=",
"Net"... | Check that the host agent is available and can be contacted. This will
first check localhost and if not, then attempt on the default gateway
for docker in bridged mode. | [
"Check",
"that",
"the",
"host",
"agent",
"is",
"available",
"and",
"can",
"be",
"contacted",
".",
"This",
"will",
"first",
"check",
"localhost",
"and",
"if",
"not",
"then",
"attempt",
"on",
"the",
"default",
"gateway",
"for",
"docker",
"in",
"bridged",
"mo... | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/agent.rb#L315-L334 |
19,684 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.start_or_continue_trace | def start_or_continue_trace(name, kvs = {}, incoming_context = {}, &block)
log_start_or_continue(name, kvs, incoming_context)
block.call
rescue Exception => e
log_error(e)
raise
ensure
log_end(name)
end | ruby | def start_or_continue_trace(name, kvs = {}, incoming_context = {}, &block)
log_start_or_continue(name, kvs, incoming_context)
block.call
rescue Exception => e
log_error(e)
raise
ensure
log_end(name)
end | [
"def",
"start_or_continue_trace",
"(",
"name",
",",
"kvs",
"=",
"{",
"}",
",",
"incoming_context",
"=",
"{",
"}",
",",
"&",
"block",
")",
"log_start_or_continue",
"(",
"name",
",",
"kvs",
",",
"incoming_context",
")",
"block",
".",
"call",
"rescue",
"Excep... | Tracing blocks API methods
Will start a new trace or continue an on-going one (such as
from incoming remote requests with context headers).
@param name [String] the name of the span to start
@param kvs [Hash] list of key values to be reported in the span
@param incoming_context [Hash] specifies the incoming cont... | [
"Tracing",
"blocks",
"API",
"methods"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L38-L46 |
19,685 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.trace | def trace(name, kvs = {}, &block)
log_entry(name, kvs)
result = block.call
result
rescue Exception => e
log_error(e)
raise
ensure
log_exit(name)
end | ruby | def trace(name, kvs = {}, &block)
log_entry(name, kvs)
result = block.call
result
rescue Exception => e
log_error(e)
raise
ensure
log_exit(name)
end | [
"def",
"trace",
"(",
"name",
",",
"kvs",
"=",
"{",
"}",
",",
"&",
"block",
")",
"log_entry",
"(",
"name",
",",
"kvs",
")",
"result",
"=",
"block",
".",
"call",
"result",
"rescue",
"Exception",
"=>",
"e",
"log_error",
"(",
"e",
")",
"raise",
"ensure... | Trace a block of code within the context of the exiting trace
Example usage:
::Instana.tracer.trace(:dbwork, { :db_name => @db.name }) do
@db.select(1)
end
@param name [String] the name of the span to start
@param kvs [Hash] list of key values to be reported in this new span | [
"Trace",
"a",
"block",
"of",
"code",
"within",
"the",
"context",
"of",
"the",
"exiting",
"trace"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L59-L68 |
19,686 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.log_start_or_continue | def log_start_or_continue(name, kvs = {}, incoming_context = {})
return if !::Instana.agent.ready? || !::Instana.config[:tracing][:enabled]
::Instana.logger.debug "#{__method__} passed a block. Use `start_or_continue` instead!" if block_given?
self.current_trace = ::Instana::Trace.new(name, kvs, inco... | ruby | def log_start_or_continue(name, kvs = {}, incoming_context = {})
return if !::Instana.agent.ready? || !::Instana.config[:tracing][:enabled]
::Instana.logger.debug "#{__method__} passed a block. Use `start_or_continue` instead!" if block_given?
self.current_trace = ::Instana::Trace.new(name, kvs, inco... | [
"def",
"log_start_or_continue",
"(",
"name",
",",
"kvs",
"=",
"{",
"}",
",",
"incoming_context",
"=",
"{",
"}",
")",
"return",
"if",
"!",
"::",
"Instana",
".",
"agent",
".",
"ready?",
"||",
"!",
"::",
"Instana",
".",
"config",
"[",
":tracing",
"]",
"... | Lower level tracing API methods
Will start a new trace or continue an on-going one (such as
from incoming remote requests with context headers).
@param name [String] the name of the span to start
@param kvs [Hash] list of key values to be reported in the span
@param incoming_context [Hash] specifies the incoming... | [
"Lower",
"level",
"tracing",
"API",
"methods"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L85-L89 |
19,687 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.log_exit | def log_exit(name, kvs = {})
return unless tracing?
if ::Instana.debug? || ::Instana.test?
unless current_span_name?(name)
::Instana.logger.debug "Span mismatch: Attempt to exit #{name} span but #{current_span.name} is active."
end
end
self.current_trace.end_span(kvs)... | ruby | def log_exit(name, kvs = {})
return unless tracing?
if ::Instana.debug? || ::Instana.test?
unless current_span_name?(name)
::Instana.logger.debug "Span mismatch: Attempt to exit #{name} span but #{current_span.name} is active."
end
end
self.current_trace.end_span(kvs)... | [
"def",
"log_exit",
"(",
"name",
",",
"kvs",
"=",
"{",
"}",
")",
"return",
"unless",
"tracing?",
"if",
"::",
"Instana",
".",
"debug?",
"||",
"::",
"Instana",
".",
"test?",
"unless",
"current_span_name?",
"(",
"name",
")",
"::",
"Instana",
".",
"logger",
... | Closes out the current span
@note `name` isn't really required but helps keep sanity that
we're closing out the span that we really want to close out.
@param name [String] the name of the span to exit (close out)
@param kvs [Hash] list of key values to be reported in the span | [
"Closes",
"out",
"the",
"current",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L128-L138 |
19,688 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.log_end | def log_end(name, kvs = {}, end_time = ::Instana::Util.now_in_ms)
return unless tracing?
if ::Instana.debug? || ::Instana.test?
unless current_span_name?(name)
::Instana.logger.debug "Span mismatch: Attempt to end #{name} span but #{current_span.name} is active."
end
end
... | ruby | def log_end(name, kvs = {}, end_time = ::Instana::Util.now_in_ms)
return unless tracing?
if ::Instana.debug? || ::Instana.test?
unless current_span_name?(name)
::Instana.logger.debug "Span mismatch: Attempt to end #{name} span but #{current_span.name} is active."
end
end
... | [
"def",
"log_end",
"(",
"name",
",",
"kvs",
"=",
"{",
"}",
",",
"end_time",
"=",
"::",
"Instana",
"::",
"Util",
".",
"now_in_ms",
")",
"return",
"unless",
"tracing?",
"if",
"::",
"Instana",
".",
"debug?",
"||",
"::",
"Instana",
".",
"test?",
"unless",
... | Closes out the current span in the current trace
and queues the trace for reporting
@note `name` isn't really required but helps keep sanity that
we're ending the span that we really want to close out.
@param name [String] the name of the span to end
@param kvs [Hash] list of key values to be reported in the spa... | [
"Closes",
"out",
"the",
"current",
"span",
"in",
"the",
"current",
"trace",
"and",
"queues",
"the",
"trace",
"for",
"reporting"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L149-L172 |
19,689 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.log_async_info | def log_async_info(kvs, span)
# Asynchronous spans can persist longer than the parent
# trace. With the trace ID, we check the current trace
# but otherwise, we search staged traces.
if tracing? && self.current_trace.id == span.context.trace_id
self.current_trace.add_async_info(kvs, sp... | ruby | def log_async_info(kvs, span)
# Asynchronous spans can persist longer than the parent
# trace. With the trace ID, we check the current trace
# but otherwise, we search staged traces.
if tracing? && self.current_trace.id == span.context.trace_id
self.current_trace.add_async_info(kvs, sp... | [
"def",
"log_async_info",
"(",
"kvs",
",",
"span",
")",
"# Asynchronous spans can persist longer than the parent",
"# trace. With the trace ID, we check the current trace",
"# but otherwise, we search staged traces.",
"if",
"tracing?",
"&&",
"self",
".",
"current_trace",
".",
"id",... | Add info to an asynchronous span
@param kvs [Hash] list of key values to be reported in the span
@param span [Span] the span for this Async op (previously returned
from `log_async_entry`) | [
"Add",
"info",
"to",
"an",
"asynchronous",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L198-L213 |
19,690 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.log_async_error | def log_async_error(e, span)
# Asynchronous spans can persist longer than the parent
# trace. With the trace ID, we check the current trace
# but otherwise, we search staged traces.
if tracing? && self.current_trace.id == span.context.trace_id
self.current_trace.add_async_error(e, span... | ruby | def log_async_error(e, span)
# Asynchronous spans can persist longer than the parent
# trace. With the trace ID, we check the current trace
# but otherwise, we search staged traces.
if tracing? && self.current_trace.id == span.context.trace_id
self.current_trace.add_async_error(e, span... | [
"def",
"log_async_error",
"(",
"e",
",",
"span",
")",
"# Asynchronous spans can persist longer than the parent",
"# trace. With the trace ID, we check the current trace",
"# but otherwise, we search staged traces.",
"if",
"tracing?",
"&&",
"self",
".",
"current_trace",
".",
"id",
... | Add an error to an asynchronous span
@param e [Exception] Add exception to the current span
@param span [Span] the span for this Async op (previously returned
from `log_async_entry`) | [
"Add",
"an",
"error",
"to",
"an",
"asynchronous",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L221-L236 |
19,691 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.log_async_exit | def log_async_exit(_name, kvs, span)
# An asynchronous span can end after the current trace has
# already completed so we make sure that we end the span
# on the right trace.
if tracing? && self.current_trace.id == span.context.trace_id
self.current_trace.end_async_span(kvs, span)
... | ruby | def log_async_exit(_name, kvs, span)
# An asynchronous span can end after the current trace has
# already completed so we make sure that we end the span
# on the right trace.
if tracing? && self.current_trace.id == span.context.trace_id
self.current_trace.end_async_span(kvs, span)
... | [
"def",
"log_async_exit",
"(",
"_name",
",",
"kvs",
",",
"span",
")",
"# An asynchronous span can end after the current trace has",
"# already completed so we make sure that we end the span",
"# on the right trace.",
"if",
"tracing?",
"&&",
"self",
".",
"current_trace",
".",
"id... | Closes out an asynchronous span
@param name [String] the name of the async span to exit (close out)
@param kvs [Hash] list of key values to be reported in the span
@param span [Span] the span for this Async op (previously returned
from `log_async_entry`) | [
"Closes",
"out",
"an",
"asynchronous",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L245-L262 |
19,692 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.inject | def inject(span_context, format, carrier)
case format
when OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_BINARY
::Instana.logger.debug 'Unsupported inject format'
when OpenTracing::FORMAT_RACK
carrier['X-Instana-T'] = ::Instana::Util.id_to_header(span_context.trace_id)
carr... | ruby | def inject(span_context, format, carrier)
case format
when OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_BINARY
::Instana.logger.debug 'Unsupported inject format'
when OpenTracing::FORMAT_RACK
carrier['X-Instana-T'] = ::Instana::Util.id_to_header(span_context.trace_id)
carr... | [
"def",
"inject",
"(",
"span_context",
",",
"format",
",",
"carrier",
")",
"case",
"format",
"when",
"OpenTracing",
"::",
"FORMAT_TEXT_MAP",
",",
"OpenTracing",
"::",
"FORMAT_BINARY",
"::",
"Instana",
".",
"logger",
".",
"debug",
"'Unsupported inject format'",
"whe... | Inject a span into the given carrier
@param span_context [SpanContext]
@param format [OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_BINARY, OpenTracing::FORMAT_RACK]
@param carrier [Carrier] | [
"Inject",
"a",
"span",
"into",
"the",
"given",
"carrier"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L296-L306 |
19,693 | instana/ruby-sensor | lib/instana/tracer.rb | Instana.Tracer.extract | def extract(format, carrier)
case format
when OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_BINARY
::Instana.logger.debug 'Unsupported extract format'
when OpenTracing::FORMAT_RACK
::Instana::SpanContext.new(::Instana::Util.header_to_id(carrier['HTTP_X_INSTANA_T']),
... | ruby | def extract(format, carrier)
case format
when OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_BINARY
::Instana.logger.debug 'Unsupported extract format'
when OpenTracing::FORMAT_RACK
::Instana::SpanContext.new(::Instana::Util.header_to_id(carrier['HTTP_X_INSTANA_T']),
... | [
"def",
"extract",
"(",
"format",
",",
"carrier",
")",
"case",
"format",
"when",
"OpenTracing",
"::",
"FORMAT_TEXT_MAP",
",",
"OpenTracing",
"::",
"FORMAT_BINARY",
"::",
"Instana",
".",
"logger",
".",
"debug",
"'Unsupported extract format'",
"when",
"OpenTracing",
... | Extract a span from a carrier
@param format [OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_BINARY, OpenTracing::FORMAT_RACK]
@param carrier [Carrier]
@return [SpanContext] | [
"Extract",
"a",
"span",
"from",
"a",
"carrier"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracer.rb#L315-L326 |
19,694 | instana/ruby-sensor | lib/instana/tracing/processor.rb | Instana.Processor.add | def add(trace)
# Do a quick checkup on our background thread.
if ::Instana.agent.collect_thread.nil? || !::Instana.agent.collect_thread.alive?
::Instana.agent.spawn_background_thread
end
# ::Instana.logger.debug("Queuing completed trace id: #{trace.id}")
@queue.push(trace)
end | ruby | def add(trace)
# Do a quick checkup on our background thread.
if ::Instana.agent.collect_thread.nil? || !::Instana.agent.collect_thread.alive?
::Instana.agent.spawn_background_thread
end
# ::Instana.logger.debug("Queuing completed trace id: #{trace.id}")
@queue.push(trace)
end | [
"def",
"add",
"(",
"trace",
")",
"# Do a quick checkup on our background thread.",
"if",
"::",
"Instana",
".",
"agent",
".",
"collect_thread",
".",
"nil?",
"||",
"!",
"::",
"Instana",
".",
"agent",
".",
"collect_thread",
".",
"alive?",
"::",
"Instana",
".",
"a... | Adds a trace to the queue to be processed and
sent to the host agent
@param [Trace] the trace to be added to the queue | [
"Adds",
"a",
"trace",
"to",
"the",
"queue",
"to",
"be",
"processed",
"and",
"sent",
"to",
"the",
"host",
"agent"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/processor.rb#L31-L39 |
19,695 | instana/ruby-sensor | lib/instana/tracing/processor.rb | Instana.Processor.staged_trace | def staged_trace(trace_id)
candidate = nil
@staging_lock.synchronize {
@staging_queue.each do |trace|
if trace.id == trace_id
candidate = trace
break
end
end
}
unless candidate
::Instana.logger.debug("Couldn't find staged trace ... | ruby | def staged_trace(trace_id)
candidate = nil
@staging_lock.synchronize {
@staging_queue.each do |trace|
if trace.id == trace_id
candidate = trace
break
end
end
}
unless candidate
::Instana.logger.debug("Couldn't find staged trace ... | [
"def",
"staged_trace",
"(",
"trace_id",
")",
"candidate",
"=",
"nil",
"@staging_lock",
".",
"synchronize",
"{",
"@staging_queue",
".",
"each",
"do",
"|",
"trace",
"|",
"if",
"trace",
".",
"id",
"==",
"trace_id",
"candidate",
"=",
"trace",
"break",
"end",
"... | Retrieves a single staged trace from the staging queue. Staged traces
are traces that have completed but may have outstanding
asynchronous spans.
@param trace_id [Integer] the Trace ID to be searched for | [
"Retrieves",
"a",
"single",
"staged",
"trace",
"from",
"the",
"staging",
"queue",
".",
"Staged",
"traces",
"are",
"traces",
"that",
"have",
"completed",
"but",
"may",
"have",
"outstanding",
"asynchronous",
"spans",
"."
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/processor.rb#L166-L180 |
19,696 | instana/ruby-sensor | lib/instana/tracing/trace.rb | Instana.Trace.new_span | def new_span(name, kvs = nil, start_time = ::Instana::Util.now_in_ms, child_of = nil)
return unless @current_span
if child_of && child_of.is_a?(::Instana::Span)
new_span = Span.new(name, @id, parent_id: child_of.id, start_time: start_time)
new_span.parent = child_of
new_span.baggage... | ruby | def new_span(name, kvs = nil, start_time = ::Instana::Util.now_in_ms, child_of = nil)
return unless @current_span
if child_of && child_of.is_a?(::Instana::Span)
new_span = Span.new(name, @id, parent_id: child_of.id, start_time: start_time)
new_span.parent = child_of
new_span.baggage... | [
"def",
"new_span",
"(",
"name",
",",
"kvs",
"=",
"nil",
",",
"start_time",
"=",
"::",
"Instana",
"::",
"Util",
".",
"now_in_ms",
",",
"child_of",
"=",
"nil",
")",
"return",
"unless",
"@current_span",
"if",
"child_of",
"&&",
"child_of",
".",
"is_a?",
"(",... | Initializes a new instance of Trace
@param name [String] the name of the span to start
@param kvs [Hash] list of key values to be reported in the span
@param incoming_context [Hash] specifies the incoming context. At a
minimum, it should specify :trace_id and :span_id from the following:
:trace_id the trac... | [
"Initializes",
"a",
"new",
"instance",
"of",
"Trace"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/trace.rb#L59-L75 |
19,697 | instana/ruby-sensor | lib/instana/tracing/trace.rb | Instana.Trace.add_error | def add_error(e, span = nil)
# Return if we've already logged this exception and it
# is just propogating up the spans.
return if e && e.instance_variable_get(:@instana_logged) || @current_span.nil?
span ||= @current_span
span.add_error(e)
end | ruby | def add_error(e, span = nil)
# Return if we've already logged this exception and it
# is just propogating up the spans.
return if e && e.instance_variable_get(:@instana_logged) || @current_span.nil?
span ||= @current_span
span.add_error(e)
end | [
"def",
"add_error",
"(",
"e",
",",
"span",
"=",
"nil",
")",
"# Return if we've already logged this exception and it",
"# is just propogating up the spans.",
"return",
"if",
"e",
"&&",
"e",
".",
"instance_variable_get",
"(",
":@instana_logged",
")",
"||",
"@current_span",
... | Log an error into the current span
@param e [Exception] Add exception to the current span | [
"Log",
"an",
"error",
"into",
"the",
"current",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/trace.rb#L95-L101 |
19,698 | instana/ruby-sensor | lib/instana/tracing/trace.rb | Instana.Trace.end_span | def end_span(kvs = {}, end_time = ::Instana::Util.now_in_ms)
return unless @current_span
@current_span.close(end_time)
add_info(kvs) if kvs && !kvs.empty?
@current_span = @current_span.parent unless @current_span.is_root?
end | ruby | def end_span(kvs = {}, end_time = ::Instana::Util.now_in_ms)
return unless @current_span
@current_span.close(end_time)
add_info(kvs) if kvs && !kvs.empty?
@current_span = @current_span.parent unless @current_span.is_root?
end | [
"def",
"end_span",
"(",
"kvs",
"=",
"{",
"}",
",",
"end_time",
"=",
"::",
"Instana",
"::",
"Util",
".",
"now_in_ms",
")",
"return",
"unless",
"@current_span",
"@current_span",
".",
"close",
"(",
"end_time",
")",
"add_info",
"(",
"kvs",
")",
"if",
"kvs",
... | Close out the current span and set the parent as
the current span
@param kvs [Hash] list of key values to be reported in the span | [
"Close",
"out",
"the",
"current",
"span",
"and",
"set",
"the",
"parent",
"as",
"the",
"current",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/trace.rb#L108-L114 |
19,699 | instana/ruby-sensor | lib/instana/tracing/trace.rb | Instana.Trace.end_async_span | def end_async_span(kvs = {}, span)
span.set_tags(kvs) unless kvs.empty?
span.close
end | ruby | def end_async_span(kvs = {}, span)
span.set_tags(kvs) unless kvs.empty?
span.close
end | [
"def",
"end_async_span",
"(",
"kvs",
"=",
"{",
"}",
",",
"span",
")",
"span",
".",
"set_tags",
"(",
"kvs",
")",
"unless",
"kvs",
".",
"empty?",
"span",
".",
"close",
"end"
] | End an asynchronous span
@param name [Symbol] the name of the span
@param kvs [Hash] list of key values to be reported in the span
@param span [Span] the span of this Async op (previously returned
from `log_async_entry`) | [
"End",
"an",
"asynchronous",
"span"
] | 9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99 | https://github.com/instana/ruby-sensor/blob/9d1b3e46b22c4f77919f67ff6ee5831dad5d5b99/lib/instana/tracing/trace.rb#L168-L171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.