query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Internal: Builds a verbatim from the token stream. A verbatim in the Examples section will be marked as in Ruby format. margin The indentation from the margin for lines that belong to this verbatim section. Returns an RDoc::Markup::Verbatim
def build_verbatim margin verbatim = super verbatim.format = :ruby if @section == 'Examples' verbatim end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_verbatim margin\n p :verbatim_begin => margin if @debug\n verbatim = RDoc::Markup::Verbatim.new\n\n until @tokens.empty? do\n type, data, column, = get\n\n case type\n when :INDENT then\n if margin >= data then\n unget\n break\n end\n\n inden...
[ "0.7552872", "0.74464136", "0.5676717", "0.5641463", "0.5625039", "0.5527235", "0.5484767", "0.5342028", "0.53377473", "0.51975065", "0.504185", "0.5024269", "0.49908572", "0.4948641", "0.4948641", "0.46372822", "0.46068153", "0.45386827", "0.45236257", "0.45073098", "0.44946...
0.7548612
1
Internal: Builds a paragraph from the token stream margin Unused Returns an RDoc::Markup::Paragraph.
def build_paragraph margin p :paragraph_start => margin if @debug paragraph = RDoc::Markup::Paragraph.new until @tokens.empty? do type, data, = get case type when :TEXT then @section = 'Returns' if data =~ /\A(Returns|Raises)/ paragraph << data when :NEWLINE then ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_paragraph margin\n p :paragraph_start => margin if @debug\n\n paragraph = RDoc::Markup::Paragraph.new\n\n until @tokens.empty? do\n type, data, column, = get\n\n if type == :TEXT and column == margin then\n paragraph << data\n\n break if peek_token.first == :BREAK\n\n ...
[ "0.8619436", "0.85564226", "0.7056046", "0.6538728", "0.6342142", "0.6342142", "0.6302455", "0.6259069", "0.61756504", "0.61541325", "0.61406064", "0.6132215", "0.5947039", "0.5928403", "0.58459616", "0.58402944", "0.58221316", "0.5818685", "0.5799842", "0.5791125", "0.578450...
0.75836694
2
Detects a section change to "Returns" and adds a heading
def parse_text parent, indent # :nodoc: paragraph = build_paragraph indent if false == @seen_returns and 'Returns' == @section then @seen_returns = true parent << RDoc::Markup::Heading.new(3, 'Returns') parent << RDoc::Markup::BlankLine.new end parent << paragraph end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_returns(section)\n returns, raises, current = [], [], []\n\n lines = section.split(\"\\n\") \n lines.each do |line|\n case line\n when /^Returns/\n returns << line\n current = returns\n when /^Raises/\n raises << line\n current = ra...
[ "0.6560862", "0.6202438", "0.5785449", "0.5785449", "0.57825756", "0.5768589", "0.55796504", "0.55480075", "0.554385", "0.5537326", "0.55330086", "0.5452602", "0.5440875", "0.5426424", "0.5388582", "0.53337556", "0.53091127", "0.53033274", "0.5300115", "0.5234853", "0.5206179...
0.65610564
0
Internal: Turns text into an Array of tokens text A String containing TomDocformat text. Returns self.
def tokenize text text = text.sub(/\A(Public|Internal|Deprecated):\s+/, '') setup_scanner text until @s.eos? do pos = @s.pos # leading spaces will be reflected by the column of the next token # the only thing we loose are trailing spaces at the end of the file next if @s.scan(/ +/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokens\n @tokens ||= Tokeniser.instance.tokenise(text)\n end", "def text_tokens_texts\n @text_tokens_texts ||= linearize(text_tokens).map(&:to_s).map(&:strip)\n end", "def tokens\n @tokens ||= texts.map do |value|\n GoogleTranslateDiff::Tokenizer.tokenize(value)\n end\n end", "def...
[ "0.72176915", "0.70018876", "0.66975313", "0.6633069", "0.6588061", "0.65582794", "0.65037787", "0.6459025", "0.6459025", "0.6432139", "0.64231247", "0.64231247", "0.63621503", "0.63613176", "0.63371074", "0.6291743", "0.6285183", "0.6285183", "0.62846476", "0.62381", "0.6230...
0.6906296
2
Creates a new Mixin for +name+ with +comment+
def initialize(name, comment) super() @name = name self.comment = comment @module = nil # cache for module if found end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(name, comment)\n super()\n @name = name\n self.comment = comment\n end", "def add klass, name, comment\n if RDoc::Extend == klass then\n ext = RDoc::Extend.new name, comment\n add_extend ext\n elsif RDoc::Include == klass then\n incl = RDoc::Include.new name, comment...
[ "0.6404659", "0.60865", "0.6062115", "0.60561115", "0.5836733", "0.5833846", "0.5833846", "0.57994473", "0.5781375", "0.565833", "0.5653976", "0.563011", "0.5612925", "0.558142", "0.5544472", "0.5486351", "0.5470692", "0.54583853", "0.5453552", "0.5450035", "0.5427632", "0....
0.6264627
1
Mixins are sorted by name
def <=> other return unless self.class === other name <=> other.name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comparer_methods\n super + [\n :four_of_a_kind_rank,\n :kicker_rank\n ]\n end", "def all_gems()\n self.sort.collect {|k,g| g }\n end", "def sorted_plugins\n @sorted_plugins ||= plugins.sort do |a, b|\n Setting.module_list.index(a.name) <=> Setting.module_list.index(b.na...
[ "0.5564308", "0.55072594", "0.5476064", "0.5468795", "0.5436036", "0.5408076", "0.539895", "0.53981066", "0.53723866", "0.5361772", "0.5351046", "0.53389376", "0.5329611", "0.5286235", "0.52860737", "0.5284265", "0.52671945", "0.5238572", "0.5238572", "0.5227885", "0.52140397...
0.0
-1
:nodoc: Full name based on module
def full_name m = self.module RDoc::ClassModule === m ? m.full_name : @name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_module_name\n self.class.ndx_full_module_names([id_handle]).values.first\n end", "def name\n @module.name\n end", "def fully_qualified_name\n return \".#{self.package}\"\n end", "def module_name\n root? ? nil : @name.camelize\n end", "def module_name\n File.basenam...
[ "0.80629605", "0.80434185", "0.8019004", "0.787853", "0.7865599", "0.78060967", "0.77901906", "0.7742938", "0.75993824", "0.75895953", "0.7556693", "0.75391865", "0.7535461", "0.7481766", "0.7476661", "0.74572843", "0.74150527", "0.7403139", "0.73818934", "0.73792166", "0.735...
0.7921299
3
Attempts to locate the included module object. Returns the name if not known. The scoping rules of Ruby to resolve the name of an included module are: first look into the children of the current context; if not found, look into the children of included modules, in reverse inclusion order; if still not found, go up the ...
def module return @module if @module # search the current context return @name unless parent full_name = parent.child_name(@name) @module = @store.modules_hash[full_name] return @module if @module return @name if @name =~ /^::/ # search the includes before this one, in reverse order ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_module_named(name)\n find_class_or_module_named(name) || find_enclosing_module_named(name)\n end", "def find_module_named(name)\n res = @modules[name] || @classes[name]\n return res if res\n return self if self.name == name\n find_enclosing_module_named name\n end", "def find_module_n...
[ "0.64671123", "0.6338409", "0.6338409", "0.6188853", "0.6188853", "0.6005841", "0.59934574", "0.57633895", "0.55904394", "0.55828285", "0.5514163", "0.54730856", "0.53666645", "0.5179523", "0.51362765", "0.5064827", "0.5010237", "0.49405253", "0.4933517", "0.49330541", "0.492...
0.69831747
0
Sets the store for this class or module and its contained code objects.
def store= store super @file = @store.add_file @file.full_name if @file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store=(store)\n @store = store\n end", "def store= store\n super\n\n @attributes .each do |attr| attr.store = store end\n @constants .each do |const| const.store = store end\n @includes .each do |incl| incl.store = store end\n @extends .each do |ext| ext.store = store...
[ "0.7269087", "0.7238779", "0.70190316", "0.69160426", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6850121", "0.6842632", "0.6842632", "0.67211676", "0.67198664", "0.6634314", "0.66194427", "0.66120833...
0.56899375
84
Creates a new ClassModule with +name+ with optional +superclass+ This is a constructor for subclasses, and must never be called directly.
def initialize(name, superclass = nil) @constant_aliases = [] @diagram = nil @is_alias_for = nil @name = name @superclass = superclass @comment_location = [] # [[comment, location]] super() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name)\n\t\t\n\t\t# if (mod_ambiguous[name])\n\t\t#\traise Rex::AmbiguousArgumentError.new(name), \n\t\t#\t\t\"The module name #{name} is ambiguous.\", caller\n\t\t# end\n\n\t\tklass = get_hash_val(name)\n\t\tinstance = nil\n\n\t\t# If there is no module associated with this class, then try to demand\...
[ "0.67421407", "0.651437", "0.6323791", "0.6288068", "0.6202969", "0.6157572", "0.609936", "0.6018946", "0.6018748", "0.5933302", "0.5919946", "0.5887584", "0.5834264", "0.5771912", "0.57311165", "0.5651509", "0.5651223", "0.5622552", "0.5619695", "0.56182414", "0.55267423", ...
0.5822962
13
Adds +comment+ to this ClassModule's list of comments at +location+. This method is preferred over comment= since it allows ri data to be updated across multiple runs.
def add_comment comment, location return unless document_self original = comment comment = case comment when RDoc::Comment then comment.normalize else normalize_comment comment end if location.parser == RDoc::Parser::C @c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(body, location = nil)\n return comments << body if location.nil?\n\n add_comment_on_file(body, *parse_location(location))\n end", "def <<(comment)\n @comments << comment\n end", "def add_comment(comment)\n @comments << comment\n end", "def add_commen...
[ "0.7389821", "0.7079334", "0.6893528", "0.68471664", "0.6820354", "0.68073684", "0.68073684", "0.6746036", "0.67417556", "0.6727358", "0.65887654", "0.6509558", "0.64620256", "0.62619174", "0.60703164", "0.598532", "0.5978738", "0.59291774", "0.59291774", "0.58782524", "0.586...
0.799765
0
Ancestors list for this ClassModule: the list of included modules (classes will add their superclass if any). Returns the included classes or modules, not the includes themselves. The returned values are either String or RDoc::NormalModule instances (see RDoc::Includemodule). The values are returned in reverse order of...
def ancestors includes.map { |i| i.module }.reverse end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ancestors\n @ancestors ||= parent ? parent.ancestors + [parent] : []\n end", "def ancestors\n @ancestors ||= [self] + (self.parent.try(:ancestors) || [])\n end", "def ancestors\n []\n end", "def ancestors \n \t\tres=parents\n \t\tparents.each {|c| res += c.ancest...
[ "0.6614867", "0.6564969", "0.651595", "0.64668816", "0.6440692", "0.63867754", "0.63715196", "0.6368688", "0.6363149", "0.6355984", "0.63539124", "0.63222724", "0.6302917", "0.6293996", "0.62852657", "0.6256626", "0.6248863", "0.62317467", "0.6226788", "0.62246513", "0.620568...
0.76097023
0
HTML fragment reference for this module or class. See RDoc::NormalClassaref and RDoc::NormalModulearef
def aref "#{aref_prefix}-#{full_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ref\n # memoizing this is worthwhile ~ 3 percent of calls are the \"first time\n # around\" in an average run of Puppet. --daniel 2012-07-17\n @ref ||= \"#{self.class.name.to_s.capitalize}[#{self.title}]\"\n end", "def name\n '#document-fragment'\n end", "def name\n '#document-...
[ "0.6269309", "0.61800784", "0.61800784", "0.61777407", "0.60466415", "0.60157865", "0.60033166", "0.5980255", "0.590513", "0.58976763", "0.5821804", "0.58148104", "0.5774656", "0.57492906", "0.57100433", "0.56613314", "0.5644705", "0.56296265", "0.562773", "0.56083035", "0.55...
0.55164564
26
Clears the comment. Used by the Ruby parser.
def clear_comment @comment = '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_comment\n @comment = nil\n end", "def del_comment\n @comment = ''\n end", "def delete_comment\n Jhead.call(\"-dc\", @match, @pattern)\n end", "def remove_comment comment\n return if @comments.empty?\n\n case @comments\n when Array then\n @comments.delete_if do |my_...
[ "0.88725966", "0.82487476", "0.69283944", "0.63561153", "0.60568094", "0.60218394", "0.5996699", "0.5980364", "0.59339195", "0.5931946", "0.5851887", "0.58348763", "0.5827643", "0.5797385", "0.57898486", "0.577449", "0.5771156", "0.57548374", "0.57075083", "0.5697946", "0.569...
0.8660718
1
This method is deprecated, use add_comment instead. Appends +comment+ to the current comment, but separated by a rule. Works more like +=.
def comment= comment # :nodoc: comment = case comment when RDoc::Comment then comment.normalize else normalize_comment comment end comment = "#{@comment.to_s}\n---\n#{comment.to_s}" unless @comment.empty? super comment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(comment)\n @comment += comment + \"\\n\"\n end", "def add_comment(comment)\n \"\\n+++++++++++++++++++++++++++++++++++++++++ #{comment} ++++++++++++++++++++++++++++++++++++++++++++++\\n\"\n end", "def add_comment(comment); end", "def add_comment comment\n \"\\n###### #{comment} ...
[ "0.7772952", "0.7520771", "0.7416679", "0.7232574", "0.71941096", "0.6989955", "0.6989955", "0.69811434", "0.6978645", "0.695226", "0.68902373", "0.68820006", "0.6835978", "0.68250525", "0.67677885", "0.67620057", "0.66698706", "0.66353154", "0.64394194", "0.642913", "0.63541...
0.6484035
18
Prepares this ClassModule for use by a generator. See RDoc::Storecomplete
def complete min_visibility update_aliases remove_nodoc_children update_includes remove_invisible min_visibility end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_generate\n super\n declare_cookbook_gems\n declare_rake_tasks\n declare_guard_sets\n end", "def initialize_generate\n super\n add_accessors\n declare_guardfile\n declare_chefignore_patterns\n end", "def prepare\n prepare_pr...
[ "0.63943166", "0.6315958", "0.62448126", "0.6205205", "0.61652976", "0.6140821", "0.612693", "0.60622627", "0.60622627", "0.60091084", "0.599112", "0.5924284", "0.59050536", "0.5882851", "0.5882851", "0.5882851", "0.5882851", "0.5882851", "0.5882851", "0.5882851", "0.58333796...
0.0
-1
Does this ClassModule or any of its methods have document_self set?
def document_self_or_methods document_self || method_list.any?{ |m| m.document_self } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def document_self=(document_self)\n return unless @track_visibility\n return if @done_documenting\n\n @document_self = document_self\n @received_nodoc = true if document_self.nil?\n end", "def self\n @define_self = true", "def doc; end", "def doc; end", "def doc; end", "def doc; end",...
[ "0.70987433", "0.67259204", "0.6320285", "0.6320285", "0.6320285", "0.6320285", "0.6304816", "0.6253346", "0.6214517", "0.6154535", "0.6154535", "0.6149774", "0.60662544", "0.5982065", "0.59596306", "0.59596306", "0.59596306", "0.59596306", "0.59596306", "0.59596306", "0.5959...
0.740901
0
Does this class or module have a comment with content or is received_nodoc true?
def documented? return true if @received_nodoc return false if @comment_location.empty? @comment_location.any? { |comment, _| not comment.empty? } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def documented?\n @received_nodoc or !@comment.empty?\n end", "def nodoc_comment?(node, require_all: T.unsafe(nil)); end", "def nodoc_comment?(node, ast_with_comments, require_all = false)\n return false unless node\n nodoc_node = node.children.first\n return false unless nodoc_n...
[ "0.8069228", "0.7259798", "0.6915587", "0.6653443", "0.6581214", "0.6534827", "0.64463407", "0.64423096", "0.64423096", "0.6360162", "0.63385224", "0.6320346", "0.6269287", "0.6223934", "0.6172545", "0.61629593", "0.60957724", "0.6085061", "0.6034923", "0.5997813", "0.5967451...
0.73598623
1
Iterates the ancestors of this class or module for which an RDoc::ClassModule exists.
def each_ancestor # :yields: module return enum_for __method__ unless block_given? ancestors.each do |mod| next if String === mod next if self == mod yield mod end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def each_ancestor # :nodoc:\n end", "def ancestors\n includes.map { |i| i.module }.reverse\n end", "def ancestors() end", "def ancestors; end", "def ancestors; end", "def ancestors; end", "def ancestors; end", "def ancestors\n itr = self\n res = []\n until itr.top_level?\n itr = it...
[ "0.6712031", "0.6608605", "0.6565908", "0.6347632", "0.6347632", "0.6347632", "0.6347632", "0.6324832", "0.6287786", "0.62164444", "0.60935014", "0.6083789", "0.6082888", "0.60591537", "0.605178", "0.60515743", "0.6037379", "0.60361964", "0.6035936", "0.6001785", "0.5989208",...
0.63547814
3
Looks for a symbol in the ancestors. See Contextfind_local_symbol.
def find_ancestor_local_symbol symbol each_ancestor do |m| res = m.find_local_symbol(symbol) return res if res end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_local_symbol(symbol)\n find_class_or_module(symbol) || super\n end", "def find_local_symbol(symbol)\n find_class_or_module_named(symbol) || super\n end", "def find_local_symbol(symbol)\n find_method_named(symbol) or\n find_constant_named(symbol) or\n find_attribute_named(symbol) or\n ...
[ "0.7332925", "0.72611016", "0.70456326", "0.69994605", "0.69676", "0.6908187", "0.66148365", "0.6547527", "0.63947564", "0.6038272", "0.5786973", "0.57863665", "0.5757106", "0.57525486", "0.55099905", "0.54958373", "0.54815584", "0.5473554", "0.542415", "0.5414513", "0.535448...
0.8356282
0
Finds a class or module with +name+ in this namespace or its descendants
def find_class_named name return self if full_name == name return self if @name == name @classes.values.find do |klass| next if klass == self klass.find_class_named name end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_module_named(name)\n find_class_or_module(name)\n end", "def find_module_named(name)\n res = @modules[name] || @classes[name]\n return res if res\n return self if self.name == name\n find_enclosing_module_named name\n end", "def find_module_named(name)\n res = @modules[name] || @cl...
[ "0.8135945", "0.8063909", "0.8063909", "0.78960955", "0.7523476", "0.7423326", "0.7293396", "0.72842246", "0.727067", "0.7244362", "0.71473104", "0.71473104", "0.7116864", "0.7038127", "0.70193547", "0.6978606", "0.6954391", "0.69488496", "0.69488496", "0.6921913", "0.6830989...
0.77657425
4
Return the fully qualified name of this class or module
def full_name @full_name ||= if RDoc::ClassModule === parent then "#{parent.full_name}::#{@name}" else @name end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fully_qualified_name\n return \".#{self.package}\"\n end", "def qualified_name\n self.class.name\n end", "def full_name\n \"#{namespace.name || namespace.inspect}::#{namespace.instances[ self ]}\"\n end", "def fully_qualified_ruby_name\n return \"::#{self.package.gsub('.', ':...
[ "0.8386202", "0.8301837", "0.8124556", "0.80990314", "0.8078781", "0.8058312", "0.8048711", "0.8020346", "0.8012402", "0.7995597", "0.79687506", "0.79683155", "0.795874", "0.79526615", "0.7922944", "0.78990924", "0.78847516", "0.7883151", "0.7866998", "0.78295594", "0.7829447...
0.77451754
21
TODO: filter included items by display?
def marshal_dump # :nodoc: attrs = attributes.sort.map do |attr| next unless attr.display? [ attr.name, attr.rw, attr.visibility, attr.singleton, attr.file_name, ] end.compact method_types = methods_by_type.map do |type, visibilities| visibilities = visibilities.map do |visi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayable_items(items)\n items.select do |item|\n display_item? item\n end.sort { |i1, i2| priority_for(i1) <=> priority_for(i2) }\n end", "def show\n @include_order_items = true\n end", "def render_items(items)\n @list.items = case @footer.filters.selected.value\n whe...
[ "0.68828523", "0.6647232", "0.66421545", "0.64118963", "0.6358485", "0.6345996", "0.61642283", "0.6115754", "0.6034924", "0.59631634", "0.58968514", "0.58927095", "0.588846", "0.5850597", "0.58471864", "0.5833848", "0.57997024", "0.57982475", "0.5777558", "0.5772301", "0.5766...
0.0
-1
Merges +class_module+ into this ClassModule. The data in +class_module+ is preferred over the receiver.
def merge class_module @parent = class_module.parent @parent_name = class_module.parent_name other_document = parse class_module.comment_location if other_document then document = parse @comment_location document = document.merge other_document @comment = @comment_location = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_class(class_, module_)\n class_.class_eval do\n include module_\n extend module_.const_get(:ClassMethods) if module_.const_defined?(:ClassMethods, false)\n prepend module_.const_get(:PrependMethods) if module_.const_defined?(:PrependMethods, false)\n end\n end", "def ...
[ "0.5555917", "0.5497857", "0.5497857", "0.53397614", "0.5327279", "0.5258974", "0.52436167", "0.51002985", "0.5090566", "0.5046593", "0.50412655", "0.49896252", "0.49447063", "0.4911198", "0.4911198", "0.48481193", "0.48461604", "0.4813828", "0.48008883", "0.4779919", "0.4764...
0.6503794
0
Merges collection +mine+ with +other+ preferring other. +other_files+ is used to help determine which items should be deleted. Yields whether the item should be added or removed (true or false) and the item to be added or removed. merge_collections things, other.things, other.in_files do |add, thing| if add then add th...
def merge_collections mine, other, other_files, &block # :nodoc: my_things = mine. group_by { |thing| thing.file } other_things = other.group_by { |thing| thing.file } remove_things my_things, other_files, &block add_things my_things, other_things, &block end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge other\n if empty? then\n @parts = other.parts\n return self\n end\n\n other.parts.each do |other_part|\n self.parts.delete_if do |self_part|\n self_part.file and self_part.file == other_part.file\n end\n\n self.parts << other_part\n end\n\n self\n end", "...
[ "0.6284036", "0.60907936", "0.57991236", "0.57798934", "0.5643306", "0.5533879", "0.5472967", "0.5467348", "0.5432438", "0.53837574", "0.53818023", "0.5372819", "0.5317418", "0.5303991", "0.5298065", "0.5267467", "0.52593553", "0.5248145", "0.52431095", "0.5216812", "0.517903...
0.82198215
0
Merges the comments in this ClassModule with the comments in the other ClassModule +cm+.
def merge_sections cm # :nodoc: my_sections = sections.group_by { |section| section.title } other_sections = cm.sections.group_by { |section| section.title } other_files = cm.in_files remove_things my_sections, other_files do |_, section| @sections.delete section.title end other_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge class_module\n @parent = class_module.parent\n @parent_name = class_module.parent_name\n\n other_document = parse class_module.comment_location\n\n if other_document then\n document = parse @comment_location\n\n document = document.merge other_document\n\n @comment = @comm...
[ "0.7151887", "0.5769985", "0.54262334", "0.5355822", "0.53405523", "0.5315275", "0.5248817", "0.5242122", "0.52241147", "0.52058554", "0.52058554", "0.52058554", "0.52058554", "0.52058554", "0.52058554", "0.51652986", "0.51528776", "0.509873", "0.5069505", "0.50403893", "0.50...
0.62097
1
Does this object represent a module?
def module? false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def module?\n @type == :module\n end", "def module?\n @type == :module\n end", "def module?\n true\n end", "def module?\n true\n end", "def module_eigenclass?(target)\n target < Module\n end", "def module_loaded? mod\n Bot::Modules.include? mod\n end", ...
[ "0.8641356", "0.8641356", "0.81930894", "0.81930894", "0.7338125", "0.7083943", "0.7042394", "0.7005077", "0.7005077", "0.69409716", "0.67975", "0.67900276", "0.6742991", "0.6657189", "0.6606814", "0.6449961", "0.6426453", "0.64126325", "0.6395451", "0.638705", "0.638705", ...
0.7868704
4
Allows overriding the initial name. Used for modules and classes that are constant aliases.
def name= new_name @name = new_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initial_name\n end", "def name_prefix; end", "def name_prefix=(_arg0); end", "def default_name\n return unless name\n Dry::Core::Inflector.underscore(name).tr('/', '_').to_sym\n end", "def name_prefix\n singleton ? '::' : '#'\n end", "def name_prefix\n @singleton ? '::' : '...
[ "0.7135001", "0.70300597", "0.6943981", "0.6924556", "0.68930906", "0.67045647", "0.6686901", "0.66551465", "0.6650747", "0.6650747", "0.65953153", "0.6572759", "0.65561306", "0.6505361", "0.64690447", "0.645764", "0.6432687", "0.6429564", "0.6397381", "0.6392057", "0.6375369...
0.0
-1
Parses +comment_location+ into an RDoc::Markup::Document composed of multiple RDoc::Markup::Documents with their file set.
def parse comment_location case comment_location when String then super when Array then docs = comment_location.map do |comment, location| doc = super comment doc.file = location doc end RDoc::Markup::Document.new(*docs) when RDoc::Comment then doc ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse\n case @comments\n when String then\n super\n when Array then\n docs = @comments.map do |comment, location|\n doc = super comment\n doc.file = location if location\n doc\n end\n\n RDoc::Markup::Document.new(*docs)\n when RDoc::Comment then\n doc =...
[ "0.6479855", "0.6285561", "0.6097439", "0.5828631", "0.5828631", "0.5828631", "0.5574399", "0.53866416", "0.5384673", "0.5366144", "0.5333812", "0.53274274", "0.5323905", "0.52155876", "0.521524", "0.52019703", "0.51901597", "0.5163592", "0.5131565", "0.5114611", "0.510405", ...
0.74700147
0
Path to this class or module for use with HTML generator output.
def path http_url @store.rdoc.generator.class_dir end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assets_path() = self.class.name.demodulize.delete_suffix('Generator').underscore", "def path\n @path ||= make_path(@module.to_a.concat(outter_class.to_a).push(filename))\n end", "def path\n Pathname(super)\n end", "def path\n raise NotImplementedError.new 'This is only a function body ...
[ "0.6668175", "0.66536987", "0.6394326", "0.635281", "0.6331144", "0.62979776", "0.62498695", "0.62111163", "0.61904675", "0.6152475", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667", "0.6151667",...
0.7232282
0
Name to use to generate the url: modules and classes that are aliases for another module or class return the name of the latter.
def name_for_path is_alias_for ? is_alias_for.full_name : full_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_url\n url = name.demodulize.underscore.downcase.pluralize\n url = \"#{namespace}/#{url}\" if respond_to?(:namespace)\n url\n end", "def do_url (name)\n name.to_s.downcase.gsub(' ', '_')\n end", "def name\n \"#{id}: #{url}\"\n end", "def name\n n = self.class.name...
[ "0.71671844", "0.691297", "0.67525846", "0.67133343", "0.66779804", "0.6617244", "0.6507747", "0.64876235", "0.6486474", "0.64656454", "0.6446431", "0.64287776", "0.6387704", "0.6387704", "0.63238984", "0.6322908", "0.6322428", "0.6310463", "0.6288342", "0.62878835", "0.62758...
0.67518467
3
Returns the classes and modules that are not constants aliasing another class or module. For use by formatters only (caches its result).
def non_aliases @non_aliases ||= classes_and_modules.reject { |cm| cm.is_alias_for } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boring_classes\n return [::Class, *::Class.included_modules,\n ::Module, *::Module.included_modules,\n ::Kernel, *::Kernel.included_modules,\n ::Object, *::Object.included_modules,\n ::BasicObject, *::BasicObject.included_modules].uniq\n end", "def included_in_...
[ "0.66485494", "0.64634025", "0.6329843", "0.62673503", "0.6238032", "0.6160288", "0.6111949", "0.6111949", "0.6063912", "0.59598064", "0.59588045", "0.5935146", "0.5890995", "0.585867", "0.5838256", "0.58260816", "0.58230126", "0.58194584", "0.57978076", "0.57952696", "0.5772...
0.70476156
0
Updates the child modules or classes of class/module +parent+ by deleting the ones that have been removed from the documentation. +parent_hash+ is either parent.modules_hash or parent.classes_hash and +all_hash+ is ::all_modules_hash or ::all_classes_hash.
def remove_nodoc_children prefix = self.full_name + '::' modules_hash.each_key do |name| full_name = prefix + name modules_hash.delete name unless @store.modules_hash[full_name] end classes_hash.each_key do |name| full_name = prefix + name classes_hash.delete name unless @store...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_parents\n ordered_by.each do |parent|\n parent.ordered_members.delete(self) # Delete the list node\n parent.members.delete(self) # Delete the indirect container Proxy\n parent.save! # record the changes to the ordered members\n end\n end", "def unregi...
[ "0.60872906", "0.58742845", "0.58138025", "0.56854457", "0.5583998", "0.5421216", "0.538848", "0.5383046", "0.53812724", "0.5357434", "0.5341773", "0.5327055", "0.52853256", "0.528456", "0.52636683", "0.5260271", "0.5242481", "0.52235925", "0.52163726", "0.52153283", "0.52153...
0.6095351
0
Search record used by RDoc::Generator::JsonIndex
def search_record [ name, full_name, full_name, '', path, '', snippet(@comment_location), ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_record\n return unless @parser < RDoc::Parser::Text\n\n [\n page_name,\n '',\n page_name,\n '',\n path,\n '',\n snippet(@comment),\n ]\n end", "def search_record\n [\n @name,\n full_name,\n @name,\n @parent.full_name,\n path,\n ...
[ "0.73032945", "0.70097286", "0.64631605", "0.6449211", "0.64343673", "0.6415579", "0.6292327", "0.6279934", "0.62718064", "0.62683606", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.6240378", "0.620508"...
0.66592264
2
Sets the store for this class or module and its contained code objects.
def store= store super @attributes .each do |attr| attr.store = store end @constants .each do |const| const.store = store end @includes .each do |incl| incl.store = store end @extends .each do |ext| ext.store = store end @method_list.each do |meth| meth.store = store end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store=(store)\n @store = store\n end", "def set_store\n @store = Store.find(params[:id])\n end", "def set_store\n @store = Store.find(params[:id])\n end", "def set_store\n @store = Store.find(params[:id])\n end", "def set_store\n @store = Store.find(pa...
[ "0.7269087", "0.70190316", "0.69160426", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6850121", "0.6842632", "0.6842632", "0.67211676", "0.67198664", "0.6634314", "0.66194427", "0.66120833", "0.6588079...
0.7238779
1
Get the superclass of this class. Attempts to retrieve the superclass object, returns the name if it is not known.
def superclass @store.find_class_named(@superclass) || @superclass end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def super_class\n return nil unless super_class_name\n Parfait.object_space.get_class_by_name(super_class_name)\n end", "def super_class!\n raise \"No super_class for class #{name}\" unless super_class_name\n s = super_class\n raise \"superclass not found for class #{name} (#{super_cl...
[ "0.7361536", "0.73590076", "0.702251", "0.6355694", "0.6352034", "0.6195028", "0.6136473", "0.6136473", "0.5996843", "0.5919517", "0.5835648", "0.5818486", "0.5703626", "0.56976265", "0.5625476", "0.56148833", "0.55974317", "0.5509405", "0.54221153", "0.538102", "0.53639174",...
0.7605434
0
Set the superclass of this class to +superclass+
def superclass=(superclass) raise NoMethodError, "#{full_name} is a module" if module? @superclass = superclass end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def superclass=(other)\n @superclass = other\n end", "def superclass=(other)\n @superclass = other\n end", "def use_superclass(klass)\n @use_superclass = klass\n end", "def superclass=(object); end", "def attach_to(cls)\n @superclass = cls.direct_superclass\n cls.superclass = self...
[ "0.8301769", "0.8301769", "0.7546101", "0.7254001", "0.6743955", "0.63795835", "0.63563955", "0.63130265", "0.628096", "0.628096", "0.61026406", "0.6056182", "0.6034744", "0.58312887", "0.58212537", "0.58180434", "0.57608074", "0.5736648", "0.568037", "0.5617445", "0.56068397...
0.7579421
2
Updates the child modules & classes by replacing the ones that are aliases through a constant. The aliased module/class is replaced in the children and in RDoc::Storemodules_hash or RDoc::Storeclasses_hash by a copy that has RDoc::ClassModuleis_alias_for set to the aliased module/class, and this copy is added to aliase...
def update_aliases constants.each do |const| next unless cm = const.is_alias_for cm_alias = cm.dup cm_alias.name = const.name # Don't move top-level aliases under Object, they look ugly there unless RDoc::TopLevel === cm_alias.parent then cm_alias.parent = self cm_alia...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_aliases\n @content.scan(/rb_define_alias\\s*\\(\n \\s*(\\w+),\n \\s*\"(.+?)\",\n \\s*\"(.+?)\"\n \\s*\\)/xm) do |var_name, new_name, old_name|\n class_name = @known_classes[var_name]\n\n unless class_name then\n @opt...
[ "0.5777977", "0.5371688", "0.50381845", "0.500432", "0.4924206", "0.49200812", "0.48818412", "0.48376507", "0.48071575", "0.47501135", "0.47359285", "0.47323114", "0.47184077", "0.4705775", "0.47030318", "0.46473673", "0.45900238", "0.45832238", "0.45613033", "0.45348006", "0...
0.78149337
0
Deletes from includes those whose module has been removed from the documentation. FIXME: includes are not reliably removed, see _possible_bug test case
def update_includes includes.reject! do |include| mod = include.module !(String === mod) && @store.modules_hash[mod.full_name].nil? end includes.uniq! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_documentation?\n @remove_from_documentation ||=\n @received_nodoc &&\n !any_content(false) &&\n @includes.all? { |i| !i.module.is_a?(String) && i.module.remove_from_documentation? } &&\n classes_and_modules.all? { |cm| cm.remove_from_documentation? }\n end", "def uninclude...
[ "0.703952", "0.6317293", "0.6271669", "0.6189883", "0.5917372", "0.5916961", "0.5741221", "0.56809086", "0.56153643", "0.55600065", "0.5549075", "0.55404365", "0.5450456", "0.5425514", "0.5399694", "0.5399344", "0.53822494", "0.53794354", "0.5374306", "0.53572476", "0.5355597...
0.6793223
1
Deletes from extends those whose module has been removed from the documentation. FIXME: like update_includes, extends are not reliably removed
def update_extends extends.reject! do |ext| mod = ext.module !(String === mod) && @store.modules_hash[mod.full_name].nil? end extends.uniq! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_nodoc all_hash\n all_hash.keys.each do |name|\n context = all_hash[name]\n all_hash.delete(name) if context.remove_from_documentation?\n end\n end", "def remove_from_documentation?\n @remove_from_documentation ||=\n @received_nodoc &&\n !any_content(false) &&\n @incl...
[ "0.6528485", "0.64014775", "0.6141598", "0.5914576", "0.5872415", "0.5685057", "0.5622498", "0.5560209", "0.5558247", "0.5545042", "0.55303305", "0.55303305", "0.5512421", "0.5499762", "0.54396003", "0.5429628", "0.5408705", "0.5400537", "0.5394804", "0.5345037", "0.5335471",...
0.6466808
1
Creates a new RDoc::RDoc instance. Call document to parse files and generate documentation.
def initialize @current = nil @generator = nil @last_modified = {} @old_siginfo = nil @options = nil @stats = nil @store = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rdoc(outputdir, files, charset = nil)\n\n # then rdoc\n require 'rdoc/rdoc'\n require 'rdoc/options'\n\n # load our parser\n require_relative 'rdoc/parser'\n\n r = RDoc::RDoc.new\n\n # specify our own format & where to output\n options = [ \"--fmt\", \"puppet\",\n \"--qui...
[ "0.717976", "0.71319073", "0.7131454", "0.71121514", "0.71121514", "0.6967407", "0.6871805", "0.6847587", "0.6629137", "0.66271377", "0.63612777", "0.63583505", "0.6270797", "0.62558395", "0.6239084", "0.6203671", "0.6157248", "0.6083624", "0.6056747", "0.60303265", "0.594397...
0.0
-1
Report an error message and exit
def error(msg) raise RDoc::Error, msg end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(message) puts(message) || exit end", "def error(msg)\n return if @nolog\n puts msg\n exit 5\n end", "def error( text )\n puts \"Script #{@name} #{version} - Error: #{text}\"\n exit 1\n end", "def quit_with_error( error_msg )\n puts error_msg\n exit \nend", "def e...
[ "0.79317695", "0.77762264", "0.7766124", "0.7735804", "0.77151966", "0.7711541", "0.76912063", "0.76822954", "0.7546643", "0.7459903", "0.7400567", "0.7397789", "0.7350553", "0.7333322", "0.73158216", "0.73158216", "0.7310881", "0.73045504", "0.72607714", "0.72607714", "0.726...
0.0
-1
Gathers a set of parseable files from the files and directories listed in +files+.
def gather_files files files = ["."] if files.empty? file_list = normalized_file_list files, true, @options.exclude file_list = remove_unparseable(file_list) if file_list.count {|name, mtime| file_list[name] = @last_modified[name] unless mtime mtime } > 0 @last_modified...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_files(*files); end", "def parse_files files\n file_list = gather_files files\n @stats = RDoc::Stats.new @store, file_list.length, @options.verbosity\n\n return [] if file_list.empty?\n\n original_options = @options.dup\n @stats.begin_adding\n\n file_info = file_list.map do |filename|\...
[ "0.78564996", "0.74462575", "0.7438647", "0.70011264", "0.6944013", "0.69125235", "0.69125235", "0.6869739", "0.6797712", "0.6754583", "0.67366487", "0.66714907", "0.6669084", "0.65829605", "0.6506988", "0.644196", "0.64224875", "0.6285528", "0.62710434", "0.6247524", "0.6229...
0.6689978
11
Turns RDoc from stdin into HTML
def handle_pipe @html = RDoc::Markup::ToHtml.new @options parser = RDoc::Text::MARKUP_FORMAT[@options.markup] document = parser.parse $stdin.read out = @html.convert document $stdout.write out end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rdoc(input)\n markup = RDoc::Markup::ToHtml.new\n markup.convert(input)\n end", "def html_markup_asciidoc(text); end", "def html_markup_rdoc(text); end", "def convert input, formatter\n document = case input\n when RDoc::Markup::Document then\n input\n ...
[ "0.7264012", "0.67765975", "0.671805", "0.6449235", "0.6263542", "0.62415", "0.62265503", "0.6130091", "0.60709405", "0.60604846", "0.6036972", "0.5983567", "0.59829783", "0.5974989", "0.5972588", "0.5952192", "0.5950518", "0.592464", "0.5885685", "0.5853675", "0.581661", "...
0.81880397
0
Installs a siginfo handler that prints the current filename.
def install_siginfo_handler return unless Signal.list.include? 'INFO' @old_siginfo = trap 'INFO' do puts @current if @current end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_siginfo_handler\n return unless Signal.list.key? 'INFO'\n\n handler = @old_siginfo || 'DEFAULT'\n\n trap 'INFO', handler\n end", "def trap_info\n return unless Signal.list['INFO']\n\n trap 'INFO' do\n @statistics.show_basic\n end\n end", "def handler_name\n module_info['H...
[ "0.58696854", "0.54972565", "0.50775945", "0.50619805", "0.5014536", "0.50024515", "0.49972376", "0.49892634", "0.4944547", "0.49097204", "0.4900229", "0.48866403", "0.48853618", "0.48843306", "0.4877083", "0.48480433", "0.48180577", "0.47992617", "0.47556153", "0.47556153", ...
0.7171575
0
Create an output dir if it doesn't exist. If it does exist, but doesn't contain the flag file created.rid then we refuse to use it, as we may clobber some manually generated documentation
def setup_output_dir(dir, force) flag_file = output_flag_file dir last = {} if @options.dry_run then # do nothing elsif File.exist? dir then error "#{dir} exists and is not a directory" unless File.directory? dir begin File.open flag_file do |io| unless force then ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_output_dir(op_dir)\n flag_file = File.join(op_dir, \"created.rid\")\n if File.exist?(op_dir)\n unless File.directory?(op_dir)\n error \"'#{op_dir}' exists, and is not a directory\" \n end\n unless File.file?(flag_file)\n error \"\\nDirectory #{op_dir} alre...
[ "0.81401074", "0.79529786", "0.79529786", "0.73594034", "0.7322895", "0.72159475", "0.72148824", "0.7052501", "0.70097315", "0.68714684", "0.68714684", "0.68693745", "0.6828706", "0.6828094", "0.67246896", "0.66662467", "0.6437363", "0.64291424", "0.6401872", "0.64018613", "0...
0.76158667
3
Sets the current documentation tree to +store+ and sets the store's rdoc driver to this instance.
def store= store @store = store @store.rdoc = self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store=(store)\n @store = store\n end", "def set_store\n @store = Store.find(params[:id])\n end", "def set_store\n @store = Store.find(params[:id])\n end", "def set_store\n @store = Store.find(params[:id])\n end", "def set_store\n @store = Store.find(params[:...
[ "0.65815246", "0.61408496", "0.6049993", "0.6049993", "0.6049993", "0.6049993", "0.6049993", "0.6049993", "0.6049993", "0.6049993", "0.6049993", "0.6010396", "0.5930271", "0.5920642", "0.5890897", "0.5824021", "0.579979", "0.579979", "0.579979", "0.579979", "0.5793739", "0....
0.7702708
0
Update the flag file in an output directory.
def update_output_dir(op_dir, time, last = {}) return if @options.dry_run or not @options.update_output_dir unless ENV['SOURCE_DATE_EPOCH'].nil? time = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime end File.open output_flag_file(op_dir), "w" do |f| f.puts time.rfc2822 last.each do |n,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_output_dir(op_dir, time)\n File.open(output_flag_file(op_dir), \"w\") {|f| f.puts time.rfc2822 }\n end", "def update_output_dir(op_dir, time)\n File.open(output_flag_file(op_dir), \"w\") {|f| f.puts time.rfc2822 }\n end", "def updated_file_only=(flag)\r\n @conf[:update] = flag\r\n...
[ "0.74091583", "0.74091583", "0.6242528", "0.60966164", "0.59435004", "0.59435004", "0.5935063", "0.5924203", "0.5875068", "0.586434", "0.586434", "0.5755615", "0.5748795", "0.5712727", "0.5707312", "0.56158555", "0.5587517", "0.5585516", "0.5559908", "0.5517731", "0.55177224"...
0.66924024
2
Return the path name of the flag file in an output directory.
def output_flag_file(op_dir) File.join op_dir, "created.rid" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_file\n if @argv.include?(\"-o\")\n out = @argv[(@argv.index(\"-o\"))+1] \n Error::message(9) if out.nil? || out == @source || out == \"-d\" || out == \"--debug\"\n return out\n else\n return \"progfile.dat\"\n end\n end", "def path(name)\n File.j...
[ "0.6900864", "0.67117566", "0.666267", "0.666267", "0.6578079", "0.65640384", "0.6550729", "0.65068936", "0.6467337", "0.64066267", "0.63470787", "0.6328386", "0.6323955", "0.62945426", "0.6265408", "0.62317085", "0.62264955", "0.61446315", "0.61334634", "0.60851216", "0.6081...
0.661191
4
The .document file contains a list of file and directory name patterns, representing candidates for documentation. It may also contain comments (starting with '')
def parse_dot_doc_file in_dir, filename # read and strip comments patterns = File.read(filename).gsub(/#.*/, '') result = {} patterns.split(' ').each do |patt| candidates = Dir.glob(File.join(in_dir, patt)) result.update normalized_file_list(candidates, false, @options.exclude) end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def support_rdoc_document_file!\n IO.read(\".document\").gsub(/^[ \\t]*#.+/m, '').split(/\\s+/)\n rescue Errno::ENOENT\n []\n end", "def support_rdoc_document_file!(file = '.document')\n return [] unless use_document_file\n File.read(file).gsub(/^[ \\t]*#.+/m, '').split(/\\s...
[ "0.78933376", "0.7491209", "0.7460384", "0.69373953", "0.6741642", "0.64899695", "0.64306504", "0.64186573", "0.64186573", "0.64186573", "0.6317092", "0.6295271", "0.62465644", "0.6211936", "0.6210883", "0.6188516", "0.61801034", "0.61538476", "0.60775244", "0.6066387", "0.60...
0.6458311
6
Given a list of files and directories, create a list of all the Ruby files they contain. If +force_doc+ is true we always add the given files, if false, only add files that we guarantee we can parse. It is true when looking at files given on the command line, false when recursing through subdirectories. The effect of t...
def normalized_file_list(relative_files, force_doc = false, exclude_pattern = nil) file_list = {} relative_files.each do |rel_file_name| rel_file_name = rel_file_name.sub(/^\.\//, '') next if rel_file_name.end_with? 'created.rid' next if exclude_pattern && exclude_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern && exclude_pattern =~ rel_file_name\n case type = File.stat(rel_file_name).ftype\n when \"file\"\n ...
[ "0.694732", "0.6851224", "0.68483025", "0.64136136", "0.6289244", "0.6288709", "0.6172846", "0.6146431", "0.61245555", "0.6106666", "0.60976654", "0.60287106", "0.6008108", "0.59221727", "0.59139687", "0.5899661", "0.589467", "0.5894384", "0.58418065", "0.58123636", "0.576478...
0.6170111
7
Return a list of the files to be processed in a directory. We know that this directory doesn't have a .document file, so we're looking for real files. However we may well contain subdirectories which must be tested for .document files.
def list_files_in_directory dir files = Dir.glob File.join(dir, "*") normalized_file_list files, false, @options.exclude end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files(directory)\n Dir.entries(directory).select { |entry| not is_dir?(\"#{directory}/#{entry}\") }\n end", "def files(directory)\n files_list = Dir[directory + '/*']\n files = []\n\n files_list.each do |file|\n if File.directory?(file)\n dir_files = files(file)\n dir_...
[ "0.7403026", "0.7383126", "0.7315285", "0.71293247", "0.70783114", "0.70684046", "0.7045816", "0.70337677", "0.7025752", "0.70134217", "0.7013008", "0.69913214", "0.6968053", "0.69418865", "0.69338393", "0.69265884", "0.6912482", "0.69026804", "0.69008255", "0.6871731", "0.68...
0.74427867
0
Parses +filename+ and returns an RDoc::TopLevel
def parse_file filename encoding = @options.encoding filename = filename.encode encoding @stats.add_file filename return if RDoc::Parser.binary? filename content = RDoc::Encoding.read_file filename, encoding return unless content filename_path = Pathname(filename).expand_path begin ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(filename)\n file = File.open(filename, \"r\").readlines\n\n $root = Node.new('root')\n $context = $root\n\n file.each_with_index do |line, index|\n process_line(line, index) if line.match(/\\S/)\n end\n\n return $root\n\nend", "def parse(filename)\n Parser::CurrentRuby.parse(File.open(filen...
[ "0.67836034", "0.65692073", "0.63495916", "0.61693835", "0.6110947", "0.6099776", "0.6050666", "0.59684694", "0.59373873", "0.5886577", "0.5873867", "0.58609945", "0.5856131", "0.57586557", "0.57255024", "0.57183", "0.5718057", "0.5650066", "0.562801", "0.56190085", "0.55867"...
0.7307265
0
Parse each file on the command line, recursively entering directories.
def parse_files files file_list = gather_files files @stats = RDoc::Stats.new @store, file_list.length, @options.verbosity return [] if file_list.empty? original_options = @options.dup @stats.begin_adding file_info = file_list.map do |filename| @current = filename parse_file filen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_files (path = '.', parent_id = 0)\n\n full_path = root_path().join(path)\n\n Dir.foreach(full_path) {|file_name|\n\n if file_name == '.' || file_name == '..'\n next\n end\n\n program_file = program_files.build()\n program_file.name = file_name\n progr...
[ "0.6300341", "0.6245786", "0.61879027", "0.6071299", "0.6016289", "0.59875005", "0.59191144", "0.58486557", "0.5847296", "0.58380777", "0.5780317", "0.57718253", "0.5756431", "0.57445806", "0.57099926", "0.56761205", "0.56637514", "0.5654717", "0.5635593", "0.56152475", "0.56...
0.56599087
17
Removes file extensions known to be unparseable from +files+ and TAGS files for emacs and vim.
def remove_unparseable files files.reject do |file, *| file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or (file =~ /tags$/i and File.open(file, 'rb') { |io| io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/ }) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_arb_dot_files(src)\n clean_list = $config[\"clean\"][\"remove_extentions\"].split(/,/)\n\n Find.find(src) do |path|\n next if File.basename(path) =~ /^\\._/\n clean_list.each do |ext|\n next if path !~ /\\.#{ext}/\n FileUtils.rm(path,$options) if File.exists? path\n end\n\n end\nend...
[ "0.62668836", "0.6153284", "0.60704386", "0.5969171", "0.5919334", "0.58704036", "0.58439994", "0.57422256", "0.57309073", "0.5729599", "0.5701907", "0.5698455", "0.5696269", "0.56843543", "0.55804324", "0.5568112", "0.55580825", "0.5534943", "0.5526975", "0.55252236", "0.552...
0.7808883
0
Generates documentation or a coverage report depending upon the settings in +options+. +options+ can be either an RDoc::Options instance or an array of strings equivalent to the strings that would be passed on the command line like %w[q o doc t My\ Doc\ Title]. document will automatically call RDoc::Optionsfinish if an...
def document options self.store = RDoc::Store.new if RDoc::Options === options then @options = options else @options = RDoc::Options.load_options @options.parse options end @options.finish if @options.pipe then handle_pipe exit end unless @options.coverag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def document generator, options, destination\n generator_name = generator\n\n options = options.dup\n options.exclude ||= [] # TODO maybe move to RDoc::Options#finish\n options.setup_generator generator\n options.op_dir = destination\n options.finish\n\n generator = options.generator.new @rdoc...
[ "0.6622513", "0.6621934", "0.6406277", "0.63206714", "0.6101354", "0.6099963", "0.57605386", "0.5752706", "0.5738859", "0.5687782", "0.56568676", "0.56529236", "0.5645923", "0.5630607", "0.5602939", "0.5532864", "0.55094475", "0.5505454", "0.5438535", "0.5429665", "0.541031",...
0.7869888
0
Generates documentation for +file_info+ (from parse_files) into the output dir using the generator selected by the RDoc options
def generate if @options.dry_run then # do nothing @generator.generate else Dir.chdir @options.op_dir do unless @options.quiet then $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..." end @generator.generate ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_file_files\n setup\n\n page_file = @template_dir + 'page.rhtml'\n fileinfo_file = @template_dir + 'fileinfo.rhtml'\n\n # for legacy templates\n filepage_file = @template_dir + 'filepage.rhtml' unless\n page_file.exist? or fileinfo_file.exist?\n\n return unless\n page_fi...
[ "0.76945513", "0.7312811", "0.73063314", "0.7160689", "0.69742316", "0.69057727", "0.68596214", "0.67972976", "0.6655169", "0.66386783", "0.6586343", "0.6520325", "0.65193063", "0.64336824", "0.64234954", "0.6361846", "0.63282675", "0.62681824", "0.62525344", "0.62418884", "0...
0.57425237
55
Removes a siginfo handler and replaces the previous
def remove_siginfo_handler return unless Signal.list.key? 'INFO' handler = @old_siginfo || 'DEFAULT' trap 'INFO', handler end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def untrap_info\n return unless Signal.list['INFO']\n\n trap 'INFO', 'DEFAULT'\n end", "def install_siginfo_handler\n return unless Signal.list.include? 'INFO'\n\n @old_siginfo = trap 'INFO' do\n puts @current if @current\n end\n end", "def deregister_inbound_handler(handler)\n\t\t@inboun...
[ "0.65002996", "0.61441326", "0.6142795", "0.610125", "0.58891904", "0.5880686", "0.5875503", "0.57217956", "0.5699634", "0.5690955", "0.56399524", "0.5578222", "0.5563426", "0.5508386", "0.5443273", "0.5440091", "0.54251903", "0.5414909", "0.5377573", "0.5368898", "0.5352663"...
0.8085343
0
Sets the locale object for +locale_name+. Normally, this method is not used. This method is useful for testing.
def []=(locale_name, locale) @@locales[locale_name] = locale end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locale=(value)\n @locale = value\n end", "def locale=(value)\n @locale = value\n end", "def locale=(locale)\n Thread.current[:locale] = locale.to_s\n end", "def setLocale(locale)\n @fields['locale'] = locale\n self\n ...
[ "0.7216306", "0.7216306", "0.70546454", "0.7049918", "0.7049918", "0.6992472", "0.6992472", "0.6976164", "0.6788537", "0.67764795", "0.67764795", "0.67764795", "0.67764795", "0.67203885", "0.6707899", "0.6697914", "0.66905755", "0.66706216", "0.66513497", "0.6644911", "0.6630...
0.7786934
0
Creates a new locale object for +name+ locale. +name+ must follow IETF language tag format.
def initialize(name) @name = name @messages = {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(locale, name)\r\n self[locale][name.to_s]\r\n end", "def create_language(name, opts=OPTS)\n self << create_language_sql(name, opts)\n end", "def new\n @locale = LOCALE.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render...
[ "0.5748505", "0.56391937", "0.5638943", "0.5605071", "0.5600421", "0.5597377", "0.55107147", "0.54661316", "0.53845257", "0.5348087", "0.53473103", "0.53385204", "0.5332762", "0.53316045", "0.53118616", "0.5310579", "0.5310579", "0.5310579", "0.5310579", "0.5310579", "0.53105...
0.0
-1
Translates the +message+ into locale. If there is no translation messages for +message+ in locale, +message+ itself is returned.
def translate(message) @messages[message] || message end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def messages(message, lang='en')\n MESSAGES[lang][message]\n end", "def translation(locale=nil)\n return translation_for(:value, locale)\n end", "def message(message, lang=LANGUAGE)\n MESSAGES[lang][message]\nend", "def translated_msg(translate, message, src_lang, target_lang)\n retur...
[ "0.65016216", "0.64988303", "0.64583045", "0.64373636", "0.64297634", "0.6419629", "0.6335466", "0.6296547", "0.62721276", "0.61639893", "0.61639893", "0.6132734", "0.60069704", "0.5954681", "0.59044045", "0.5843485", "0.5821892", "0.5781806", "0.57431805", "0.57421166", "0.5...
0.79554284
0
Extracts translation target messages and yields each message. Each yielded message is a Hash. It consists of the followings: :type :: :paragraph :paragraph :: String (The translation target message itself.) :line_no :: Integer (The line number of the :paragraph is started.) The above content may be added in the future.
def extract_messages parse do |part| case part[:type] when :empty_line # ignore when :paragraph yield(part) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def texts_translated\n @texts_translated ||= tokens_translated.map do |group|\n group.map { |value, type| type == :text ? value : fix_ascii(value) }.join\n end\n end", "def parse_po_section( content )\n\n # Maybe this is a bit of overkill, but it's easy to extend\n # if we want to capture m...
[ "0.53996474", "0.5393807", "0.52879906", "0.5083833", "0.5063767", "0.50583506", "0.5047876", "0.50157547", "0.49663886", "0.49595824", "0.49595112", "0.49411765", "0.49337876", "0.4929596", "0.4925383", "0.4925383", "0.49221566", "0.49185938", "0.49066696", "0.48955852", "0....
0.6096271
0
Translates raw text into +locale+.
def translate(locale) translated_text = '' parse do |part| case part[:type] when :paragraph translated_text += locale.translate(part[:paragraph]) when :empty_line translated_text += part[:line] else raise "should not reach here: unexpected type: #{type}" end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def localize_text(locale, text)\n text_tag = Regexp.escape(localize_text_tag).to_s\n expression = Regexp.new(text_tag + \"(.*?)\" + text_tag)\n tagged_text = text[expression, 1]\n while tagged_text do\n text = text.sub(expression, translate(locale, tagged_text))\n ...
[ "0.72640353", "0.6634108", "0.65968966", "0.65883297", "0.6400718", "0.63501275", "0.6270355", "0.62642956", "0.6247267", "0.622424", "0.6161327", "0.6110685", "0.60665685", "0.60629976", "0.6017891", "0.5991912", "0.59765446", "0.5963916", "0.59633", "0.5942178", "0.59111905...
0.6899815
1
Creates a new Require that loads +name+ with +comment+
def initialize(name, comment) super() @name = name.gsub(/'|"/, "") #' @top_level = nil self.comment = comment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(name, comment)\n super()\n @name = name\n self.comment = comment\n @module = nil # cache for module if found\n end", "def load_comment(name)\n Jhead.call(\"-ci\", name.shellescape, @match, @pattern)\n end", "def initialize(name, comment)\n super()\n @name = name\n self....
[ "0.71523035", "0.6994104", "0.6666188", "0.5867357", "0.58251923", "0.5798484", "0.5786203", "0.5728728", "0.5727716", "0.5662294", "0.5654685", "0.56007916", "0.5593332", "0.5585508", "0.5580822", "0.5525203", "0.54385936", "0.5426492", "0.54157263", "0.5412701", "0.53625685...
0.6187769
3
The RDoc::TopLevel corresponding to this require, or +nil+ if not found.
def top_level @top_level ||= begin tl = RDoc::TopLevel.all_files_hash[name + '.rb'] if tl.nil? and RDoc::TopLevel.all_files.first.full_name =~ %r(^lib/) then # second chance tl = RDoc::TopLevel.all_files_hash['lib/' + name + '.rb'] end tl end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_level\n return @top_level if defined? @top_level\n @top_level = self\n @top_level = @top_level.parent until RDoc::TopLevel === @top_level\n @top_level\n end", "def top_level\n return @top_level if defined? @top_level\n @top_level = self\n @top_level = @top_level.parent until RDoc::T...
[ "0.76465493", "0.76465493", "0.6825724", "0.671748", "0.65149194", "0.6478938", "0.62142164", "0.6194788", "0.6137087", "0.6033018", "0.60263073", "0.5985325", "0.5970004", "0.5949417", "0.58753145", "0.58623093", "0.5743192", "0.5731552", "0.57208717", "0.5716335", "0.571136...
0.7557548
2
Take a block of text and use various heuristics to determine its structure (paragraphs, lists, and so on). Invoke an event handler as we identify significant chunks.
def initialize attribute_manager = nil @attribute_manager = attribute_manager || RDoc::Markup::AttributeManager.new @output = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_line(text, index)\n @index = index + 1\n\n case text[0]\n when DIV_CLASS; render_div(text)\n when DIV_ID\n return push_plain(text) if text[1] == ?{\n render_div(text)\n when ELEMENT; render_tag(text)\n when COMMENT; render_comment(text[1..-1].strip)\n wh...
[ "0.63825923", "0.5983752", "0.59657496", "0.5740977", "0.57122666", "0.56539863", "0.5566966", "0.55186796", "0.5509519", "0.5461979", "0.5454713", "0.5438348", "0.5388986", "0.5377608", "0.536535", "0.53632706", "0.5357385", "0.5330056", "0.5324737", "0.5310541", "0.5310257"...
0.0
-1
Add to the sequences used to add formatting to an individual word (such as bold). Matching entries will generate attributes that the output formatters can recognize by their +name+.
def add_word_pair(start, stop, name) @attribute_manager.add_word_pair(start, stop, name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bold(*args); end", "def add_special(pattern, name)\n @attribute_manager.add_special(pattern, name)\n end", "def draw_attributes\n draw_header\n \n change_color(system_color)\n #draw_text(5, 32, self.width, 24, \"Categoria:\")\n draw_text(5, 32, self.width, 24, \"Atributos:\")\n change...
[ "0.54497117", "0.5372391", "0.5342253", "0.5299643", "0.5296183", "0.52796406", "0.51648", "0.51534176", "0.51310545", "0.5086855", "0.508594", "0.50735277", "0.5068351", "0.5059513", "0.5059513", "0.5049203", "0.5046039", "0.5038545", "0.50319093", "0.50169957", "0.49862352"...
0.5403689
2
Add to the sequences recognized as general markup.
def add_html(tag, name) @attribute_manager.add_html(tag, name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_sequence(seq)\n\n\t\t\t# Append false gi\n\t\t\tfasta = \">gi|00000|gb|00000.0|N/A\\n\" + seq\n\t\t\t\n\t\t\t@midi_format_array.push(Bio::MidiFormat.new(fasta))\n\n\t\t\t# Increment number of sequences\n\t\t\t@num_midi_seqs += 1\n\t\tend", "def setup_markup_transform(&block)\n self.send :define_meth...
[ "0.5819357", "0.53650236", "0.5302094", "0.5248085", "0.5218202", "0.5157621", "0.514572", "0.512872", "0.51196724", "0.5112617", "0.50733316", "0.50463533", "0.4995102", "0.4980269", "0.4928323", "0.49056673", "0.49011865", "0.4900295", "0.48990422", "0.48869485", "0.4886629...
0.0
-1
Add to other inline sequences. For example, we could add WikiWords using something like: parser.add_regexp_handling(/\b([AZ][az]+[AZ]\w+)/, :WIKIWORD) Each wiki word will be presented to the output formatter.
def add_regexp_handling(pattern, name) @attribute_manager.add_regexp_handling(pattern, name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inline_mark(text)\n # process simple inlines\n for inline in INLINES_MARK\n text.gsub!(/#{inline[0]}/m, inline[1]) if text.match(/#{inline[0]}/m)\n end\n # process note inlines\n if text.match(NOTES_REGEXP)\n text.gsub!(NOTES_REGEXP) do |string|\n ...
[ "0.56401795", "0.51242566", "0.5080161", "0.50385696", "0.5012968", "0.50120395", "0.500821", "0.4958887", "0.49410865", "0.49255046", "0.49215046", "0.4919125", "0.49047485", "0.4898437", "0.4896243", "0.48837343", "0.48653874", "0.4863451", "0.48254406", "0.4819927", "0.481...
0.0
-1
We take +input+, parse it if necessary, then invoke the output +formatter+ using a Visitor to render the result.
def convert input, formatter document = case input when RDoc::Markup::Document then input else RDoc::Markup::Parser.parse input end document.accept formatter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(input)\n\n str = convert(input)\n # Sanitize strings.\n str = sanitize(str)\n # Mark the beginning of the text.\n if not @inside_input\n str = \"#{BEGIN_MARKER}\\n#{str}\\n\"\n @inside_input = true\n else\n str = str + \"\\n\"\n end\n @mutex....
[ "0.6720805", "0.661275", "0.64019513", "0.60581785", "0.5878033", "0.58708984", "0.58678156", "0.5833976", "0.5832634", "0.58325195", "0.5812663", "0.5755716", "0.57279867", "0.57279867", "0.5680041", "0.56559324", "0.5631272", "0.56296986", "0.5627107", "0.562184", "0.562184...
0.64241046
2
Creates a new Alias with a token stream of +text+ that aliases +old_name+ to +new_name+, has +comment+ and is a +singleton+ context.
def initialize(text, old_name, new_name, comment, singleton = false) super() @text = text @singleton = singleton @old_name = old_name @new_name = new_name self.comment = comment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_alias(context, single, tk, comment)\n line_no = tk[:line_no]\n\n skip_tkspace\n\n if :on_lparen === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n new_name = get_symbol_or_name\n\n skip_tkspace\n if :on_comma === peek_tk[:kind] then\n get_tk\n skip_tkspace\...
[ "0.6234162", "0.6165731", "0.5960238", "0.581205", "0.57858026", "0.5754075", "0.5692648", "0.5649237", "0.56250346", "0.5510972", "0.5491291", "0.5348544", "0.53252983", "0.5320485", "0.52781457", "0.522753", "0.519422", "0.51927364", "0.5173667", "0.5104738", "0.51039326", ...
0.6666011
0
Order by singleton then new_name
def <=>(other) [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_name\n sort_constituent\n end", "def default_order\n \"name\"\n end", "def sort_name\n n = \"#{self.last_name}, #{self.first_name}\"\n if self.middle_name.present?\n n += \" #{self.middle_name}\"\n end\n n\n end", "def sort_name\n prefix = self.hack_a...
[ "0.6958831", "0.644003", "0.6363226", "0.62957245", "0.6291598", "0.60395145", "0.6016036", "0.60095125", "0.5956431", "0.5905639", "0.5885646", "0.5813872", "0.5811079", "0.57577246", "0.5752599", "0.57215595", "0.57071984", "0.5656595", "0.5656595", "0.56420475", "0.5611234...
0.56769174
17
HTML fragment reference for this alias
def aref type = singleton ? 'c' : 'i' "#alias-#{type}-#{html_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fragment\n <<~HTML\n my html here\n HTML\n end", "def aref\n type = singleton ? 'c' : 'i'\n # % characters are not allowed in html names => dash instead\n \"#{aref_prefix}-#{type}-#{html_name}\"\n end", "def name\n '#document-fragment'\n end", "def name\n ...
[ "0.708591", "0.67597705", "0.66950434", "0.66950434", "0.66427404", "0.642397", "0.62437147", "0.6222465", "0.61717045", "0.6135757", "0.6092335", "0.6091057", "0.6090595", "0.6090595", "0.6070662", "0.60645884", "0.6041429", "0.60104245", "0.5939538", "0.591801", "0.58966607...
0.7425642
0
Full old name including namespace
def full_old_name @full_name || "#{parent.name}#{pretty_old_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name\n if namespace\n \"#{namespace}#{SEPARATOR}#{name}\"\n else\n \"#{name}\"\n end\n end", "def namespace\n return self.name ? self.name.downcase.gsub(/[^0-9A-Za-z ]/, '').gsub(' ', '-') : ''\n end", "def old_name; end", "def pretty_old_name\n \"#{singlet...
[ "0.78773785", "0.7781035", "0.750463", "0.74003685", "0.7396781", "0.7236042", "0.7201717", "0.7148715", "0.7131253", "0.71308875", "0.70896226", "0.7069067", "0.7061536", "0.7052262", "0.70457554", "0.70415545", "0.69728804", "0.69660604", "0.6942568", "0.68973047", "0.68725...
0.7727164
2
HTML idfriendly version of +new_name+.
def html_name CGI.escape(@new_name.gsub('-', '-2D')).gsub('%','-').sub(/^-/, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html_name\n require 'cgi'\n\n CGI.escape(@name.gsub('-', '-2D')).gsub('%','-').sub(/^-/, '')\n end", "def new_name; end", "def entire_name_with_id\r\n self.entire_full_name + \" (#{self.id})\"\r\n end", "def html_name\n @name.gsub(/[^a-z]+/, '-')\n end", "def html_name\n @name.gsub(/[...
[ "0.72390455", "0.7208785", "0.71714246", "0.71474576", "0.71474576", "0.6918816", "0.6849806", "0.6797456", "0.6797456", "0.6781552", "0.6683768", "0.6651085", "0.65169406", "0.64845765", "0.6457671", "0.64501625", "0.6432382", "0.6406367", "0.6406367", "0.63892573", "0.63658...
0.80123436
0
'::' for the alias of a singleton method/attribute, '' for instancelevel.
def name_prefix singleton ? '::' : '#' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_prefix\n @singleton ? '::' : '#'\n end", "def alias_of; end", "def method\n self.class.name.split('::').last || ''\n end", "def full_name\n \"#{namespace.name || namespace.inspect}::#{namespace.instances[ self ]}\"\n end", "def dot\n end", "def pretty_name\n \"#{sin...
[ "0.61228114", "0.6098093", "0.5932548", "0.5788448", "0.5694033", "0.5676405", "0.5676405", "0.5637513", "0.5637385", "0.56250525", "0.56242204", "0.56095976", "0.5550019", "0.5488115", "0.5466925", "0.54414016", "0.54414016", "0.54414016", "0.54414016", "0.54414016", "0.5430...
0.6122002
1
Old name with prefix '::' or ''.
def pretty_old_name "#{singleton ? '::' : '#'}#{@old_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mangle_name(name)\r\n name.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').gsub(/([a-z\\d])([A-Z])/,'\\1 \\2')\r\n end", "def fix_name(name)\n if name[0,1] == '^'\n return \"#{ARTML.prefix}#{name[1..-1].strip}\"\n else\n return name.strip\n end\n end", "def normal...
[ "0.74491364", "0.7448337", "0.7228868", "0.7086433", "0.7059398", "0.69129896", "0.69053376", "0.68759894", "0.6832901", "0.6750089", "0.6750089", "0.6680104", "0.6679016", "0.6652957", "0.6585857", "0.6521594", "0.6470668", "0.64665586", "0.64650464", "0.6456731", "0.6435657...
0.76220113
0
New name with prefix '::' or ''.
def pretty_new_name "#{singleton ? '::' : '#'}#{@new_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefix\n \"#{name}::\"\n end", "def name_prefix\n singleton ? '::' : '#'\n end", "def mangle_name(name)\r\n name.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').gsub(/([a-z\\d])([A-Z])/,'\\1 \\2')\r\n end", "def name_prefix\n @singleton ? '::' : '#'\n end", "def pretty_ol...
[ "0.7544868", "0.7516889", "0.7466055", "0.731866", "0.7302591", "0.7064259", "0.70074093", "0.70046335", "0.6975599", "0.68172175", "0.68172175", "0.68111813", "0.67729115", "0.67261595", "0.67261595", "0.67080206", "0.6626036", "0.657661", "0.65728754", "0.65722376", "0.6489...
0.7520081
1
Creates a new constant with +name+, +value+ and +comment+
def initialize(name, value, comment) super() @name = name @value = value @is_alias_for = nil @visibility = :public self.comment = comment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_const(name, value, namespace=nil)\n define(ConstSymbol.new name, value, namespace)\n end", "def const name, value\n Symbolic.check_name name\n const = ConstExpr.new(name, value)\n meta_def name do\n const\n end\n const\n end", "def initialize(name, value, c...
[ "0.7327526", "0.7205887", "0.7016474", "0.65955585", "0.6492001", "0.63480747", "0.621448", "0.6210596", "0.61706716", "0.6164007", "0.61436623", "0.6139912", "0.6049394", "0.59939235", "0.5903693", "0.58746254", "0.5860919", "0.58552325", "0.5807487", "0.57225657", "0.572199...
0.6733699
3
Constants are ordered by name
def <=> other return unless self.class === other [parent_name, name] <=> [other.parent_name, other.name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def constants\n @context.constants.sort{|a,b| a.name<=>b.name}.collect{|c| {:name=>c.name, :value=>c.value, :description=>markup(c.comment, true)}}\n end", "def constant_names\n return if @constant_names.empty?\n @constant_names.uniq.sort\n end", "def enum\n self.const_get(:Order).keys....
[ "0.76325047", "0.7367443", "0.6998079", "0.66696393", "0.65987366", "0.6416719", "0.63671863", "0.6351908", "0.6313388", "0.62904316", "0.6209202", "0.6195415", "0.6187439", "0.6166906", "0.6155783", "0.6139805", "0.6125657", "0.5988353", "0.5970769", "0.5964701", "0.594175",...
0.0
-1
Constants are equal when their parent and name is the same
def == other self.class == other.class and @parent == other.parent and @name == other.name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def == other\n self.class === other and @relative_name == other.relative_name\n end", "def should_be_parent_of?(other_constant_name)\n if match = other_constant_name.match(/^#{Regexp.escape(constant_name + '::')}/)\n %(#{match}#{other_constant_name.split('::').last}) == other_constant_name\n else\...
[ "0.7114603", "0.6740235", "0.66088194", "0.6521022", "0.6473221", "0.6292002", "0.6253704", "0.62312925", "0.6210778", "0.61984426", "0.61761934", "0.61613107", "0.60724354", "0.60568434", "0.6034011", "0.60050416", "0.60050416", "0.59865284", "0.59816384", "0.5942692", "0.59...
0.7047518
1
A constant is documented if it has a comment, or is an alias for a documented class or module.
def documented? return true if super return false unless @is_alias_for case @is_alias_for when String then found = @store.find_class_or_module @is_alias_for return false unless found @is_alias_for = found end @is_alias_for.documented? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_constants(type, var_name, const_name, definition)\n class_name = @known_classes[var_name]\n\n return unless class_name\n\n class_obj = find_class var_name, class_name\n\n unless class_obj then\n @options.warn 'Enclosing class or module %p is not known' % [const_name]\n return\n ...
[ "0.6413091", "0.6340798", "0.63175213", "0.62764376", "0.6178672", "0.61294127", "0.6096297", "0.6095222", "0.6084382", "0.60775775", "0.6072954", "0.6043984", "0.6014788", "0.59994674", "0.5984122", "0.5965309", "0.5904259", "0.58381313", "0.5815059", "0.5795781", "0.5777213...
0.6079413
9
Full constant name including namespace
def full_name @full_name ||= "#{parent_name}::#{@name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_const_string\n gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def to_const_string\n gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def name\n underscore const_name\n end", "def to_const_name\n n = to_s.split(/_/...
[ "0.7749204", "0.7749204", "0.77189", "0.7467171", "0.74609935", "0.74609935", "0.73731494", "0.73699844", "0.73699844", "0.7261402", "0.7182935", "0.7156712", "0.70763934", "0.7066503", "0.70562285", "0.69491524", "0.68676215", "0.682082", "0.67757326", "0.67506355", "0.67440...
0.0
-1
The module or class this constant is an alias for
def is_alias_for case @is_alias_for when String then found = @store.find_class_or_module @is_alias_for @is_alias_for = found if found @is_alias_for else @is_alias_for end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def class_constant; end", "def class_constant; end", "def name\n \"#{base_module.name}::#{constant_name}\"\n end", "def name\n has_module?(klass) ? klass[(klass.index(\"::\")+2)..-1] : klass\n end", "def shareable_constant_value; end", "def shareable_constant_value; end", "def alias\n\t\tmo...
[ "0.72736907", "0.72736907", "0.6785901", "0.6744614", "0.6694201", "0.6694201", "0.6671979", "0.6656894", "0.6586817", "0.6569998", "0.6554179", "0.6515588", "0.64861006", "0.64719313", "0.6466374", "0.6408175", "0.6347217", "0.6347217", "0.634318", "0.6341084", "0.6321439", ...
0.0
-1
Dumps this Constant for use by ri. See also marshal_load
def marshal_dump alias_name = case found = is_alias_for when RDoc::CodeObject then found.full_name else found end [ MARSHAL_VERSION, @name, full_name, @visibility, alias_name, parse(@comment), @file.rel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def marshal_dump\n dump\n end", "def dump_constants(io)\n @constants.each do |name, constant|\n name = [@prefix, name].join '.' if @prefix\n io.puts \"#{name} = #{constant.converted_value}\"\n end\n end", "def dump() end", "def _dump() end", "def dump\n do_dump(0)\n ...
[ "0.6705582", "0.6702172", "0.66617227", "0.6635724", "0.653682", "0.65337163", "0.64362526", "0.63883066", "0.6376328", "0.63693714", "0.6318948", "0.6257688", "0.6242558", "0.6211783", "0.62054044", "0.6203395", "0.61966395", "0.6188959", "0.61759996", "0.6160559", "0.613999...
0.55085987
83
Loads this Constant from +array+. For a loaded Constant the following methods will return cached values: full_name parent_name
def marshal_load array initialize array[1], nil, array[5] @full_name = array[2] @visibility = array[3] || :public @is_alias_for = array[4] # 5 handled above # 6 handled below @parent_name = array[7] @parent_class = array[8] @secti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_colon2_constants(array)\n array = array.flatten\n constants = array[array.length/-2..-1]\n name = constants.pop\n \n parent = self.scope\n \n constants.each do |c|\n parent = record ModuleCode.new(c, parent, Sexp.new)\n end\n \n [name,parent]\n end", "def marsh...
[ "0.5250746", "0.5245372", "0.5241397", "0.52008396", "0.5086277", "0.4926279", "0.4910131", "0.49055725", "0.48845005", "0.48161155", "0.48100057", "0.47787157", "0.47768936", "0.47231302", "0.47141305", "0.47013885", "0.46136484", "0.45936698", "0.45881882", "0.45864567", "0...
0.5157063
4
Path to this constant for use with HTML generator output.
def path "#{@parent.path}##{@name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path\n File.join(@base, '_static', @name)\n end", "def render_path\n @render_path ||= generate_file_name(@site.config[\"url\"], @site.config[\"baseurl\"])\n end", "def path\n File.join(@base, @name)\n end", "def path\n File.join(@base, @name)\n end", "def path\n ...
[ "0.6979295", "0.6920677", "0.6661039", "0.6633667", "0.6624347", "0.6554474", "0.65265787", "0.64503765", "0.63820827", "0.63761425", "0.6358483", "0.6357952", "0.6349621", "0.6349082", "0.6349082", "0.6334441", "0.63277113", "0.6307378", "0.63051844", "0.62783176", "0.625998...
0.0
-1
Sets the store for this class or module and its contained code objects.
def store= store super @file = @store.add_file @file.full_name if @file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store=(store)\n @store = store\n end", "def store= store\n super\n\n @attributes .each do |attr| attr.store = store end\n @constants .each do |const| const.store = store end\n @includes .each do |incl| incl.store = store end\n @extends .each do |ext| ext.store = store...
[ "0.7269087", "0.7238779", "0.70190316", "0.69160426", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6891404", "0.6850121", "0.6842632", "0.6842632", "0.67211676", "0.67198664", "0.6634314", "0.66194427", "0.66120833...
0.56899375
82
Creates a new MethodAttr from token stream +text+ and method or attribute name +name+. Usually this is called by super from a subclass.
def initialize text, name super() @text = text @name = name @aliases = [] @is_alias_for = nil @parent_name = nil @singleton = nil @visibility = :public @see = false @arglists = nil @block_params = nil @call_seq = nil @param_seq = nil @para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize text, name\n super\n\n @c_function = nil\n @dont_rename_initialize = false\n @token_stream = nil\n @calls_super = false\n @superclass_method = nil\n end", "def new_method(mod, name, *args)\n m = Method.new(gensym(name), mod, name, *args)\n add_method(m)\n m\n e...
[ "0.541454", "0.5189615", "0.5182545", "0.5113805", "0.50941443", "0.50841147", "0.5054396", "0.5054174", "0.5040252", "0.49650115", "0.49031806", "0.4898402", "0.489078", "0.4880014", "0.48729718", "0.4824377", "0.4766", "0.4710933", "0.47017816", "0.46979582", "0.46895653", ...
0.4896634
12
Resets cached data for the object so it can be rebuilt by accessor methods
def initialize_copy other # :nodoc: @full_name = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset\r\n @cache.reset\r\n end", "def reset!\n @cache = nil\n end", "def reset\n cache.remove(\"#{klass}/#{options}\")\n @records = []\n @loaded = nil\n self\n end", "def reset_cache\n self.class.reset_cache\n end", "def reset\n hash.clear\n ...
[ "0.800999", "0.78913563", "0.77298844", "0.7690231", "0.7617481", "0.7617067", "0.75500196", "0.75069135", "0.7506912", "0.7493112", "0.7353303", "0.7345461", "0.7345461", "0.7267647", "0.72673106", "0.72389203", "0.7225609", "0.7184398", "0.7180493", "0.7173504", "0.7170396"...
0.0
-1
Order by singleton then name
def <=>(other) return unless other.respond_to?(:singleton) && other.respond_to?(:name) [ @singleton ? 0 : 1, name] <=> [other.singleton ? 0 : 1, other.name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_name\n sort_constituent\n end", "def default_order\n \"name\"\n end", "def tree_ordered_names\n tree_order_name_ids.collect { |name_id| queried_names[queried_names.index { |name| name[:id] == name_id }] }\n end", "def default_sort\n 'name asc'\n end", "def prept...
[ "0.75121254", "0.686631", "0.6382167", "0.63698745", "0.62958574", "0.61759675", "0.615858", "0.6139576", "0.6062677", "0.60412896", "0.5961276", "0.5941692", "0.5934215", "0.5903741", "0.58902603", "0.5869161", "0.5869029", "0.58467275", "0.583984", "0.5807441", "0.58004075"...
0.0
-1
A method/attribute is documented if any of the following is true: it was marked with :nodoc:; it has a comment; it is an alias for a documented method; it has a +see+ method that is documented.
def documented? super or (is_alias_for and is_alias_for.documented?) or (see and see.documented?) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def documented?\n @received_nodoc or !@comment.empty?\n end", "def documented?\n return true if @received_nodoc\n return false if @comment_location.empty?\n @comment_location.any? { |comment, _| not comment.empty? }\n end", "def fully_documented?\n documented? and\n attributes.all? { |a| ...
[ "0.7289811", "0.7119942", "0.6980099", "0.6427374", "0.6354699", "0.63049215", "0.62559354", "0.6194617", "0.61087424", "0.6059493", "0.6050881", "0.60409737", "0.60343915", "0.60343915", "0.5972003", "0.5891248", "0.58264756", "0.58264756", "0.58264756", "0.58264756", "0.574...
0.70776254
2
A method/attribute to look at, in particular if this method/attribute has no documentation. It can be a method/attribute of the superclass or of an included module, including the Kernel module, which is always appended to the included modules. Returns +nil+ if there is no such method/attribute. The +is_alias_for+ metho...
def see @see = find_see if @see == false @see end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_alias_for # :nodoc:\n case @is_alias_for\n when RDoc::MethodAttr then\n @is_alias_for\n when Array then\n return nil unless @store\n\n klass_name, singleton, method_name = @is_alias_for\n\n return nil unless klass = @store.find_class_or_module(klass_name)\n\n @is_alias_for ...
[ "0.68950564", "0.65456116", "0.6415", "0.5946175", "0.57343054", "0.5702092", "0.5561823", "0.5506101", "0.5464633", "0.5342458", "0.53086495", "0.52542126", "0.5202581", "0.51812047", "0.51787984", "0.5145424", "0.51234776", "0.51125103", "0.5084791", "0.5051475", "0.5034218...
0.0
-1
Sets the store for this class or module and its contained code objects.
def store= store super @file = @store.add_file @file.full_name if @file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store=(store)\n @store = store\n end", "def store= store\n super\n\n @attributes .each do |attr| attr.store = store end\n @constants .each do |const| const.store = store end\n @includes .each do |incl| incl.store = store end\n @extends .each do |ext| ext.store = store...
[ "0.7270792", "0.72397053", "0.7019088", "0.6916019", "0.689128", "0.689128", "0.689128", "0.689128", "0.689128", "0.689128", "0.689128", "0.689128", "0.689128", "0.6849894", "0.68427503", "0.68427503", "0.6722753", "0.6720614", "0.6633593", "0.6619114", "0.6612183", "0.6587...
0.56910646
83
Abstract method. Contexts in their building phase call this to register a new alias for this known method/attribute. creates a new AnyMethod/Attribute named an_alias.new_name; adds +self+ as an alias for the new method or attribute adds the method or attribute to aliases adds the method or attribute to +context+.
def add_alias(an_alias, context) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_alias an_alias, context = nil\n method = self.class.new an_alias.text, an_alias.new_name\n\n method.record_location an_alias.file\n method.singleton = self.singleton\n method.params = self.params\n method.visibility = self.visibility\n method.comment = an_alias.comment\n method.is_alia...
[ "0.7741986", "0.7025634", "0.67663884", "0.6673699", "0.660182", "0.6588781", "0.64223737", "0.6418865", "0.6297837", "0.62848943", "0.6278044", "0.62528807", "0.6231882", "0.6137954", "0.6122636", "0.60146046", "0.60102105", "0.60102105", "0.5986055", "0.59705603", "0.592578...
0.71352375
1
HTML fragment reference for this method
def aref type = singleton ? 'c' : 'i' # % characters are not allowed in html names => dash instead "#{aref_prefix}-#{type}-#{html_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fragment\n <<~HTML\n my html here\n HTML\n end", "def fragment?; end", "def fragment?; end", "def inner_html(*args); end", "def inner_html(*args); end", "def inner_html\n self.inner_xml\n end", "def to_html; end", "def inner_html(options = T.unsafe(nil)); end", "def mark...
[ "0.78149563", "0.71513134", "0.71513134", "0.71228224", "0.71228224", "0.68651164", "0.67748505", "0.66718316", "0.66623974", "0.66595256", "0.6616163", "0.6616163", "0.6616163", "0.65560675", "0.6507314", "0.64740443", "0.64619994", "0.6444104", "0.6444104", "0.6444104", "0....
0.0
-1
Prefix for +aref+, defined by subclasses.
def aref_prefix raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aref_prefix\n 'method'\n end", "def aref\n \"#{aref_prefix}-#{full_name}\"\n end", "def aref_prefix\n 'attribute'\n end", "def aref\n type = singleton ? 'c' : 'i'\n # % characters are not allowed in html names => dash instead\n \"#{aref_prefix}-#{type}-#{html_name}\"\n end", "def ...
[ "0.7592747", "0.7553915", "0.73886466", "0.68732303", "0.6635005", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6076509", "0.6045916", "0.5914199", "0.5902504", "0.58243394", "0.5813505", "0.57225204",...
0.81645745
0
Attempts to sanitize the content passed by the Ruby parser: remove outer parentheses, etc.
def block_params=(value) # 'yield.to_s' or 'assert yield, msg' return @block_params = '' if value =~ /^[\.,]/ # remove trailing 'if/unless ...' return @block_params = '' if value =~ /^(if|unless)\s/ value = $1.strip if value =~ /^(.+)\s(if|unless)\s/ # outer parentheses value = $1 if valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize content #:nodoc:\n if content.is_a? String\n content.chomp!\n content.gsub!(/\\t/, ' ') # don't display tab\n content.gsub!(/[^[:print:]]/, '') # don't display non print characters\n else\n content\n end\n end", "def sanitize content #:nodoc:\n if...
[ "0.67916065", "0.67916065", "0.671317", "0.6694932", "0.6669583", "0.6536258", "0.65192306", "0.65082586", "0.6464963", "0.63330066", "0.63233703", "0.62755775", "0.6275116", "0.6244935", "0.6222619", "0.62223583", "0.6220019", "0.6173538", "0.61463445", "0.61345625", "0.6131...
0.0
-1
HTML idfriendly method/attribute name
def html_name require 'cgi' CGI.escape(@name.gsub('-', '-2D')).gsub('%','-').sub(/^-/, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_html_id(method_name, value='input') #:nodoc:\n if options.has_key?(:index)\n index = \"_#{options[:index]}\"\n elsif defined?(@auto_index)\n index = \"_#{@auto_index}\"\n else\n index = \"\"\n end\n sanitized_method_name = method_name.to_s....
[ "0.73923635", "0.72533286", "0.72533286", "0.72533286", "0.72533286", "0.72533286", "0.72533286", "0.72533286", "0.7175728", "0.71705186", "0.71665794", "0.6991278", "0.6873275", "0.6829855", "0.68241304", "0.68241304", "0.6793949", "0.6736306", "0.6736306", "0.6736306", "0.6...
0.0
-1
Full method/attribute name including namespace
def full_name @full_name ||= "#{parent_name}#{pretty_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attribute_ns(namespace, name); end", "def full_name\n @full_name ||= \"#{@klass}##{@method_name}\"\n end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attri...
[ "0.70352143", "0.6916602", "0.68825436", "0.68825436", "0.68825436", "0.68825436", "0.68825436", "0.68825436", "0.68825436", "0.67675287", "0.67631453", "0.6762619", "0.6665876", "0.6656596", "0.6596991", "0.65848804", "0.6563603", "0.6563603", "0.6563603", "0.65445113", "0.6...
0.0
-1