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 |
|---|---|---|---|---|---|---|
Path to the ri data for +method_name+ in +klass_name+ | def method_file klass_name, method_name
method_name = method_name.split('::').last
method_name =~ /#(.*)/
method_type = $1 ? 'i' : 'c'
method_name = $1 if $1
method_name = method_name.gsub(/\W/) { "%%%02x" % $&[0].ord }
File.join class_path(klass_name), "#{method_name}-#{method_type}.ri"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n if @internal_data.have_test_data?\n \"#{@method_name}[#{data_label}](#{self.class.name})\"\n else\n \"#{@method_name}(#{self.class.name})\"\n end\n end",
"def compiled_template_path(klass, method_name)\n path = const_to_path(klass, @context.gen_root)\... | [
"0.6138451",
"0.5831902",
"0.57347417",
"0.57073724",
"0.56915385",
"0.5682637",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5639088",
"0.5613093",
"0.5593825",
"0.5592133",
... | 0.66651714 | 0 |
Modules cache accessor. An Array of all the module (and class) names in the store. | def module_names
@cache[:modules]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules\n @modules.values\n end",
"def modules\n @modules.values\n end",
"def all_modules\n modules_hash.values\n end",
"def modules\n @modules ||= Array.new\n @modules\nend",
"def modules\n @module_ids.collect { |idx| BModule.store[idx] }\n end",
"def classes\n return @class... | [
"0.76295066",
"0.76295066",
"0.72398734",
"0.71777505",
"0.71698713",
"0.7124744",
"0.70514005",
"0.6927991",
"0.6927991",
"0.6739717",
"0.67066497",
"0.6589065",
"0.6580508",
"0.6440525",
"0.6425569",
"0.63962114",
"0.63724965",
"0.6344665",
"0.6343094",
"0.6323119",
"0.6322... | 0.8387144 | 0 |
Hash of all modules known to RDoc | def modules_hash
@modules_hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules_hash\n @modules\n end",
"def modules_hash\n @modules\n end",
"def module_names\n @cache[:modules]\n end",
"def unique_modules\n @unique_modules\n end",
"def hash\n [hint,name,ordinal,module_name].hash\n end",
"def all_modules\n modules_hash.values\n end",
"def re... | [
"0.66519666",
"0.66519666",
"0.633772",
"0.63032645",
"0.62779045",
"0.6253392",
"0.6080444",
"0.6035348",
"0.60229754",
"0.59317213",
"0.5869601",
"0.5829788",
"0.573655",
"0.5681603",
"0.5665864",
"0.5635523",
"0.56227744",
"0.55998486",
"0.5597061",
"0.5584225",
"0.5566093... | 0.651158 | 2 |
Returns the RDoc::TopLevel that is a text file and has the given +name+ | def page name
@text_files_hash.each_value.find do |file|
file.page_name == name or file.base_name == name
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_file_named(name)\n top_level.class.find_file_named(name)\n end",
"def top_level\n @top_level ||= begin\n tl = RDoc::TopLevel.all_files_hash[name + '.rb']\n\n if tl.nil? and RDoc::TopLevel.all_files.first.full_name =~ %r(^lib/) then\n # second chance\n tl = RDoc::TopLevel.a... | [
"0.5821613",
"0.57343423",
"0.56400365",
"0.548225",
"0.54312295",
"0.53867775",
"0.53844076",
"0.53725016",
"0.53522897",
"0.5194312",
"0.51832217",
"0.51668954",
"0.51025313",
"0.51018816",
"0.50980496",
"0.5086086",
"0.5083094",
"0.5048262",
"0.5036579",
"0.5019428",
"0.50... | 0.51494795 | 12 |
Path to the ri data for +page_name+ | def page_file page_name
file_name = File.basename(page_name).gsub('.', '_')
File.join @path, File.dirname(page_name), "page-#{file_name}.ri"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path\n data.path\n end",
"def path\n data.path\n end",
"def data_d\n Pathname.new \"#{exp_crit_d}/data\"\n \n end",
"def render_path\n return @render_path.dup unless @page_url.nil?\n generate_file_name()\n @render_path.dup\n end",
"def data name\n... | [
"0.62449414",
"0.62449414",
"0.6048172",
"0.6034528",
"0.60100734",
"0.60082847",
"0.59273195",
"0.59121066",
"0.5896042",
"0.588123",
"0.5860093",
"0.5848051",
"0.5847938",
"0.583032",
"0.58150476",
"0.58104694",
"0.57934254",
"0.5778245",
"0.57492876",
"0.5702511",
"0.56995... | 0.71974176 | 0 |
Removes from +all_hash+ the contexts that are nodoc or have no content. See RDoc::Contextremove_from_documentation? | def remove_nodoc all_hash
all_hash.keys.each do |name|
context = all_hash[name]
all_hash.delete(name) if context.remove_from_documentation?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_all_contexts\n previous_size = @contexts.size\n @contexts = []\n previous_size\n end",
"def clear\n \n @hook_contexts.clear if @hook_contexts\n @execution_contexts.clear if @execution_contexts\n @cascade_contexts.clear if @cascade_contexts\n \n self\n \n ... | [
"0.7345445",
"0.66363823",
"0.650514",
"0.650514",
"0.6269471",
"0.6269471",
"0.6235213",
"0.61940837",
"0.61940837",
"0.6045849",
"0.6006847",
"0.59117067",
"0.5892403",
"0.5869458",
"0.5862803",
"0.58370477",
"0.58270776",
"0.5733888",
"0.56916296",
"0.56105065",
"0.5609852... | 0.7358672 | 0 |
Saves all entries in the store | def save
load_cache
all_classes_and_modules.each do |klass|
save_class klass
klass.each_method do |method|
save_method klass, method
end
klass.each_attribute do |attribute|
save_method klass, attribute
end
end
all_files.each do |file|
save_page fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save\n @@all.push(self)\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n en... | [
"0.73056287",
"0.72894657",
"0.72711307",
"0.72711307",
"0.72711307",
"0.72711307",
"0.72711307",
"0.72711307",
"0.72711307",
"0.72711307",
"0.7269163",
"0.72678125",
"0.7232348",
"0.707421",
"0.69811153",
"0.6925056",
"0.68893653",
"0.68872154",
"0.6886833",
"0.6850874",
"0.... | 0.0 | -1 |
Writes the cache file for this store | def save_cache
clean_cache_collection @cache[:ancestors]
clean_cache_collection @cache[:attributes]
clean_cache_collection @cache[:class_methods]
clean_cache_collection @cache[:instance_methods]
@cache[:modules].uniq!
@cache[:modules].sort!
@cache[:pages].uniq!
@cache[:pages].sort!
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_cache_file()\n @logger.debug @cache.inspect\n File.open(options[:cache_file], \"w\") {|f| f.write(@cache.to_yaml)}\n end",
"def write\n File.write(cache_file, @cache_log.to_json)\n end",
"def write_cache_file\n open(@cache_file, 'w') do |f|\n f.puts({ \n :userid => @user... | [
"0.8158035",
"0.8069366",
"0.80320746",
"0.795994",
"0.79096395",
"0.78010356",
"0.7396828",
"0.73911804",
"0.7372214",
"0.73167187",
"0.7248857",
"0.7242248",
"0.7131661",
"0.70618755",
"0.70618755",
"0.70393735",
"0.69790506",
"0.6899185",
"0.67468715",
"0.6707302",
"0.6676... | 0.6290412 | 37 |
Writes the ri data for +klass+ (or module) | def save_class klass
full_name = klass.full_name
FileUtils.mkdir_p class_path(full_name) unless @dry_run
@cache[:modules] << full_name
path = class_file full_name
begin
disk_klass = load_class full_name
klass = disk_klass.merge klass
rescue MissingFileError
end
# BasicO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_class out, store, klass, also_in # :nodoc:\n comment = klass.comment\n # TODO the store's cache should always return an empty Array\n class_methods = store.class_methods[klass.full_name] || []\n instance_methods = store.instance_methods[klass.full_name] || []\n attributes = st... | [
"0.60472035",
"0.5956131",
"0.57493216",
"0.57493216",
"0.5673479",
"0.5646511",
"0.5631539",
"0.5624091",
"0.5605544",
"0.5584919",
"0.5584919",
"0.5584919",
"0.5584919",
"0.55814517",
"0.54779536",
"0.541956",
"0.5404861",
"0.53584677",
"0.5356175",
"0.5356175",
"0.5327141"... | 0.5012489 | 42 |
Writes the ri data for +method+ on +klass+ | def save_method klass, method
full_name = klass.full_name
FileUtils.mkdir_p class_path(full_name) unless @dry_run
cache = if method.singleton then
@cache[:class_methods]
else
@cache[:instance_methods]
end
cache[full_name] ||= []
cache[full_name] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(method, data)\n self.send(method.to_sym, convert_to_hash_array(data))\n end",
"def ri(method = nil)\n\t unless method && method =~ /^[A-Z]/ # if class isn't specified\n\t klass = self.kind_of?(Class) ? name : self.class.name\n\t method = [klass, method].compact.join('#')\n\t end\n\t puts `... | [
"0.60994357",
"0.5829862",
"0.5791979",
"0.57821095",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.5740915",
"0.572897",
"0.5575819",
"0.5492168",
"0.54543865",
"0.54543865",
"0.54543865",... | 0.6483745 | 0 |
Writes the ri data for +page+ | def save_page page
return unless page.text?
path = page_file page.full_name
FileUtils.mkdir_p File.dirname(path) unless @dry_run
cache[:pages] ||= []
cache[:pages] << page.full_name
return if @dry_run
File.open path, 'wb' do |io|
Marshal.dump page, io
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_recordset_page(asrpage)\t\n\t\twrite_byte(16) #write custom object flag\n\t\twrite_utf('RecordSetPage') #write the specific class type\n\n\t\t#write cursor position\n\t\twrite_utf('Cursor')\n\t\twrite_number(asrpage.cursor)\n\n\t\t#write the page data\n\t\twrite_utf('Page')\n\n\t\t#writed the data\n\t\tw... | [
"0.66192997",
"0.6333476",
"0.6213908",
"0.61183673",
"0.6102871",
"0.6070431",
"0.6032395",
"0.6032395",
"0.5980024",
"0.59159416",
"0.5901268",
"0.58470106",
"0.58198535",
"0.58198535",
"0.5816552",
"0.5492322",
"0.5443624",
"0.54167455",
"0.5406605",
"0.5405215",
"0.539261... | 0.5535345 | 15 |
Source of the contents of this store. For a store from a gem the source is the gem name. For a store from the home directory the source is "home". For system ri store (the standard library documentation) the source is"ruby". For a store from the site ri directory the store is "site". For other stores the source is the ... | def source
case type
when :gem then File.basename File.expand_path '..', @path
when :home then 'home'
when :site then 'site'
when :system then 'ruby'
else @path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def documentation_source path\n _, source_name, path = path.split '/', 3\n\n store = @stores[source_name]\n return store, path if store\n\n store = store_for source_name\n\n store.load_all\n\n @stores[source_name] = store\n\n return store, path\n end",
"def store_for source_name\n case s... | [
"0.74437016",
"0.70536125",
"0.6914386",
"0.68274194",
"0.6751854",
"0.6735718",
"0.66001695",
"0.6590412",
"0.6555405",
"0.65404576",
"0.6524631",
"0.6499027",
"0.6499027",
"0.6449645",
"0.64090747",
"0.6390965",
"0.6362186",
"0.6355934",
"0.6316801",
"0.63157004",
"0.629074... | 0.70804733 | 1 |
Gets the title for this RDoc store. This is used as the title in each page on the RDoc server | def title
@cache[:title]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title\n @doc.title || DEFAULT_TITLE\n end",
"def title\n @title_pages.each { |tp| tp.title and return tp.title }\n nil\n end",
"def title(force_refresh = false)\n if @title && !force_refresh\n @title\n else\n @title = document[\"title\"] rescue nil\n end\n ... | [
"0.7748929",
"0.77421",
"0.76950264",
"0.76264256",
"0.76264256",
"0.76264256",
"0.75823534",
"0.7526332",
"0.7520351",
"0.7496582",
"0.74711937",
"0.74711937",
"0.74711937",
"0.74711937",
"0.74711937",
"0.74711937",
"0.74711937",
"0.74694693",
"0.7468772",
"0.746555",
"0.746... | 0.0 | -1 |
Sets the title page for this RDoc store. | def title= title
@cache[:title] = title
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_page_title(title)\n @page_title = title\n end",
"def page_title=(title)\n @content_for_page_title = title\n end",
"def SetTitle(title)\n\t\t#Title of document\n\t\t@title = title\n\tend",
"def set_title(title)\n @title = title\n end",
"def set_page_title\n @page_title = \"Race Re... | [
"0.8446331",
"0.7928652",
"0.79049534",
"0.7819569",
"0.7710263",
"0.76237506",
"0.75524026",
"0.7550537",
"0.7487426",
"0.7476271",
"0.74457616",
"0.7318308",
"0.7318308",
"0.7318308",
"0.7318308",
"0.7318308",
"0.7318308",
"0.7318308",
"0.7307076",
"0.73048383",
"0.72469723... | 0.0 | -1 |
Returns the unique classes discovered by RDoc. ::complete must have been called prior to using this method. | def unique_classes
@unique_classes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def classes\n return @classes if @classes\n @classes = @context.classes.sort.find_all{|c| c.document_self}.collect{|c| R2Doc.all_references[c.full_name]}\n end",
"def extract_rdoc_information_from_classes(classes, options, stats)\n result = []\n classes.each do |clzz|\n tp = r... | [
"0.77220696",
"0.6626466",
"0.6500768",
"0.6468858",
"0.6401169",
"0.6401169",
"0.62026846",
"0.61421156",
"0.61291116",
"0.61208785",
"0.60804033",
"0.60506743",
"0.6016058",
"0.59885293",
"0.59885293",
"0.59418267",
"0.5917452",
"0.5898588",
"0.5881054",
"0.58697206",
"0.58... | 0.62365514 | 6 |
Returns the unique classes and modules discovered by RDoc. ::complete must have been called prior to using this method. | def unique_classes_and_modules
@unique_classes + @unique_modules
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def classes\n return @classes if @classes\n @classes = @context.classes.sort.find_all{|c| c.document_self}.collect{|c| R2Doc.all_references[c.full_name]}\n end",
"def complete min_visibility\n fix_basic_object_inheritance\n\n # cache included modules before they are removed from the documentat... | [
"0.6875838",
"0.6543892",
"0.64643663",
"0.6104573",
"0.59350395",
"0.59111685",
"0.56883126",
"0.5680792",
"0.5629118",
"0.56242305",
"0.56018335",
"0.5552295",
"0.55454224",
"0.55454224",
"0.5475611",
"0.54731923",
"0.5469872",
"0.54403484",
"0.5384687",
"0.532407",
"0.5318... | 0.56540704 | 8 |
Returns the unique modules discovered by RDoc. ::complete must have been called prior to using this method. | def unique_modules
@unique_modules
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules\n return @modules if @modules\n @modules = @context.modules.sort.find_all{|m| m.document_self}.collect{|m| R2Doc.all_references[m.full_name]}\n end",
"def referenced_modules\n # TODO: check content type before scanning\n content.scan(/\\s*(include|extend)\\s+([A-Za-z0-9_\\.]*)/).ma... | [
"0.7149384",
"0.64827377",
"0.6079634",
"0.6043777",
"0.5821938",
"0.5703221",
"0.5700115",
"0.56639415",
"0.5603309",
"0.5603309",
"0.55881786",
"0.55450886",
"0.554077",
"0.55139595",
"0.54563594",
"0.54274243",
"0.5382002",
"0.5313487",
"0.53096694",
"0.53066784",
"0.53066... | 0.65796155 | 1 |
Check that the files on the command line exist | def check_files
@files.delete_if do |file|
if File.exist? file then
if File.readable? file then
false
else
warn "file '#{file}' not readable"
true
end
else
warn "file '#{file}' not found"
true
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_file_existence (file_path)\n \"[ -f '#{file_path}' ]\"\n end",
"def check_args(args)\r\n args.count == 1\r\n File.exist?(ARGV[0].to_s)\r\nrescue StandardError\r\n false\r\nend",
"def file_exists?(path)\n run(\"test -f #{path}\").success?\n end",
"def check_files fnames\n fna... | [
"0.7517258",
"0.725228",
"0.70512056",
"0.70389605",
"0.6947288",
"0.6874572",
"0.6836191",
"0.68173957",
"0.67931074",
"0.6791099",
"0.67790127",
"0.67790127",
"0.6773494",
"0.6749506",
"0.6722105",
"0.6709542",
"0.6701245",
"0.6684992",
"0.66514295",
"0.6633069",
"0.6633069... | 0.67412984 | 14 |
Ensure only one generator is loaded | def check_generator
if @generator then
raise OptionParser::InvalidOption,
"generator already set to #{@generator_name}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_generators(app = T.unsafe(nil)); end",
"def load_generators(app = T.unsafe(nil)); end",
"def generators\n @generators ||= {}\n end",
"def generators\n @generators ||= []\n end",
"def generators\n @generators ||= []\n end",
"def generators; end",
"def generators; end... | [
"0.6556681",
"0.6556681",
"0.649154",
"0.64578044",
"0.64578044",
"0.6437649",
"0.6437649",
"0.6200667",
"0.6091855",
"0.60620725",
"0.60515827",
"0.6042254",
"0.59931254",
"0.5932848",
"0.5908256",
"0.5906905",
"0.5906905",
"0.58329815",
"0.5771903",
"0.57212335",
"0.5700009... | 0.60749763 | 9 |
Set the title, but only if not already set. Used to set the title from a source file, so that a title set from the command line will have the priority. | def default_title=(string)
@title ||= string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_title_locally(title)\n @title = title\n end",
"def set_title\n @title = File.basename(@absolute_path)\n @title.sub!(/^[0-9][0-9]-/, '')\n @title.gsub!(/_/, ' ')\n @title.gsub!(/-/, ', ')\n end",
"def set_title(title)\n @title = title\n end",
"def set_title\n unless s... | [
"0.751073",
"0.74643683",
"0.74461496",
"0.733973",
"0.73372936",
"0.730627",
"0.727281",
"0.727281",
"0.727281",
"0.72617465",
"0.72338486",
"0.7206005",
"0.7200483",
"0.71987456",
"0.7179253",
"0.7178903",
"0.71697694",
"0.71397704",
"0.71397704",
"0.71397704",
"0.71397704"... | 0.68492365 | 59 |
Create a regexp for exclude | def exclude
if @exclude.nil? or Regexp === @exclude then
# done, #finish is being re-run
@exclude
elsif @exclude.empty? then
nil
else
Regexp.new(@exclude.join("|"))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locale_exclude_regex(kind)\n Regexp.union(@exclude_objects[kind.to_sym].map do |identifier|\n if identifier.is_a? String\n # Add leading/trailing slashes if necessary\n new_identifier = identifier.dup\n new_identifier[/^/] = '/' if identifier[0,1] != '/'\n new_id... | [
"0.7772894",
"0.71182126",
"0.70763075",
"0.7016665",
"0.6819992",
"0.6794058",
"0.6794058",
"0.67827064",
"0.67382044",
"0.667945",
"0.6656339",
"0.6503383",
"0.6479956",
"0.64703035",
"0.64013624",
"0.6383205",
"0.6278095",
"0.6263507",
"0.62286294",
"0.61715746",
"0.611528... | 0.6814099 | 5 |
Completes any unfinished option setup business such as filtering for existent files, creating a regexp for exclude and setting a default template. | def finish
if @write_options then
write_options
exit
end
@op_dir ||= 'doc'
@rdoc_include << "." if @rdoc_include.empty?
root = @root.to_s
@rdoc_include << root unless @rdoc_include.include?(root)
@exclude = self.exclude
finish_page_dir
check_files
# If no templa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_options\n @options.verbose = false if @options.quiet\n # @options.output = \"#{@options.output}/#{File.basename(@options.input)}\" if File.directory?(@options.output)\n @options.output = \"#{@options.output}\" if (File.directory?(@options.output) && File.exists?(File.dirname(@options.out... | [
"0.5929771",
"0.5732655",
"0.56542957",
"0.5602181",
"0.5602181",
"0.5571333",
"0.55619824",
"0.553459",
"0.552064",
"0.54953945",
"0.5474419",
"0.54480904",
"0.5446881",
"0.54363656",
"0.5433614",
"0.5433614",
"0.5433614",
"0.5433614",
"0.5433614",
"0.5433614",
"0.5433614",
... | 0.0 | -1 |
Fixes the page_dir to be relative to the root_dir and adds the page_dir to the files list. | def finish_page_dir
return unless @page_dir
@files << @page_dir
page_dir = Pathname(@page_dir)
begin
page_dir = page_dir.expand_path.relative_path_from @root
rescue ArgumentError
# On Windows, sometimes crosses different drive letters.
page_dir = page_dir.expand_path
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page_dir\n if root?\n site.public_dir\n else\n pieces = path.sub(/^\\//, '').split('/')\n File.join(site.site_files_dir, *pieces[0..-2])\n end\n end",
"def move_root_files\n docs = \"#{@dir}/usr/share/doc/#{@ctrl[:package]}\"\n files = Dir.entries(@dir).selec... | [
"0.63187563",
"0.61075807",
"0.60662955",
"0.60091144",
"0.59338987",
"0.5888009",
"0.58530825",
"0.58019036",
"0.57591325",
"0.571858",
"0.56848586",
"0.56563693",
"0.5655519",
"0.5611606",
"0.56027377",
"0.5578046",
"0.556996",
"0.55468684",
"0.5502119",
"0.5499753",
"0.546... | 0.77215344 | 0 |
Returns a properlyspace list of generators and their descriptions. | def generator_descriptions
lengths = []
generators = RDoc::RDoc::GENERATORS.map do |name, generator|
lengths << name.length
description = generator::DESCRIPTION if
generator.const_defined? :DESCRIPTION
[name, description]
end
longest = lengths.max
generators.sort.map d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generators\n generators = []\n section_found = false\n `cmake --help`.each_line do |line|\n section_found = true if line =~ /^Generators/\n next unless section_found\n generators << $1 if line =~ /^ (\\S.*?)(?: \\[arch\\])?\\s*(=|$)/\n end\n return generators\nend",
"def generators\n @gen... | [
"0.71192753",
"0.70794725",
"0.70794725",
"0.66838396",
"0.6453138",
"0.6453138",
"0.6411333",
"0.63862634",
"0.6359909",
"0.5997892",
"0.5997892",
"0.5945054",
"0.5936462",
"0.5923758",
"0.5915513",
"0.58923274",
"0.5739617",
"0.567753",
"0.5645664",
"0.56375164",
"0.5632462... | 0.7850787 | 0 |
Parses command line options. | def parse argv
ignore_invalid = true
argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
opts = OptionParser.new do |opt|
@option_parser = opt
opt.program_name = File.basename $0
opt.version = RDoc::VERSION
opt.release = nil
opt.summary_indent = ' ' * 4
opt.banner =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse\n # The options specified on the command line will be collected in *options*.\n # We set default values here.\n OptionParser.new { |options| parse_options options}.parse!(@args)\n @options\n end",
"def parse_opts\n option_parser.parse(@argv)\n end",
"def parse\n ... | [
"0.8243291",
"0.8218524",
"0.8071313",
"0.80686",
"0.7838684",
"0.78110224",
"0.7796951",
"0.77584517",
"0.7755769",
"0.7662116",
"0.7608654",
"0.76061463",
"0.7585635",
"0.7576564",
"0.75570345",
"0.75411046",
"0.7532688",
"0.74282163",
"0.7427725",
"0.73861563",
"0.73615885... | 0.0 | -1 |
Don't display progress as we process the files | def quiet
@verbosity.zero?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_progress; end",
"def show_progress=(_arg0); end",
"def progress; end",
"def progress; end",
"def progress; end",
"def progress; end",
"def progress; end",
"def indicate_progress\n end",
"def use_progress_bar?; true end",
"def print_file files_so_far, filename\n progress_bar = spri... | [
"0.66427344",
"0.6606345",
"0.6556154",
"0.6556154",
"0.6556154",
"0.6556154",
"0.6556154",
"0.64019454",
"0.63750094",
"0.6206398",
"0.6192894",
"0.6178257",
"0.6143749",
"0.60878193",
"0.6044675",
"0.6030863",
"0.6030863",
"0.6030863",
"0.6030863",
"0.59433866",
"0.58844036... | 0.0 | -1 |
Set quietness to +bool+ | def quiet= bool
@verbosity = bool ? 0 : 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quiet=(bool)\n @quiet = bool\n end",
"def quiet=(val)\n @quiet = val\n end",
"def quiet?\n false\n end",
"def quiet\n true\n end",
"def quiet=(val)\n @@quiet = val\n end",
"def quiet?\n @quiet\n end",
"def quiet\n @verbosity.zero?\n end",
... | [
"0.84011054",
"0.7761089",
"0.7754379",
"0.7697707",
"0.76737595",
"0.76266366",
"0.7346502",
"0.7346502",
"0.7288472",
"0.7257301",
"0.72465783",
"0.7225889",
"0.70130855",
"0.6851749",
"0.67524564",
"0.6747352",
"0.6570104",
"0.65126854",
"0.6419026",
"0.6385697",
"0.638569... | 0.8255471 | 1 |
Removes directories from +path+ that are outside the current directory | def sanitize_path path
require 'pathname'
dot = Pathname.new('.').expand_path
path.reject do |item|
path = Pathname.new(item).expand_path
is_reject = nil
relative = nil
begin
relative = path.relative_path_from(dot).to_s
rescue ArgumentError
# On Windows, someti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _clean_dir(path)\n\n if File.expand_path(path) == File.expand_path(THETIS_MAIL_LOCATION_DIR)\n return\n end\n\n files_dirs = Dir.glob(File.join(path, '**/*'))\n if files_dirs.nil? or files_dirs.empty?\n FileUtils.remove_entry_secure(path, true)\n _clean_dir(File.dirname(path))\n e... | [
"0.7436511",
"0.74212605",
"0.74074423",
"0.73893195",
"0.73193955",
"0.7202782",
"0.66467184",
"0.66467184",
"0.65935755",
"0.6584855",
"0.65453726",
"0.64939994",
"0.64660865",
"0.64592516",
"0.64376426",
"0.62861705",
"0.6281579",
"0.6269047",
"0.6239115",
"0.61887616",
"0... | 0.62806344 | 17 |
Set up an output generator for the named +generator_name+. If the found generator responds to :setup_options it will be called with the options instance. This allows generators to add custom options or set default options. | def setup_generator generator_name = @generator_name
@generator = @generators[generator_name]
unless @generator then
raise OptionParser::InvalidArgument,
"Invalid output formatter #{generator_name}"
end
return if @generator_options.include? @generator
@generator_name = generator... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generator(name = nil)\n metadata[:generator_name] = name.to_s if name\n return metadata[:generator_name] if metadata[:generator_name]\n \n if genspec_subclass?\n superclass.generator\n else\n describes || description\n end\n end",
"def with_gen... | [
"0.6327986",
"0.6038365",
"0.58741754",
"0.5780381",
"0.57221264",
"0.5612199",
"0.559371",
"0.5546028",
"0.55328",
"0.5518277",
"0.5515722",
"0.5479353",
"0.54418844",
"0.5411067",
"0.53912723",
"0.5384746",
"0.537352",
"0.53617316",
"0.53418326",
"0.5325788",
"0.5325788",
... | 0.82951635 | 0 |
Finds the template dir for +template+ | def template_dir_for template
template_path = File.join 'rdoc', 'generator', 'template', template
$LOAD_PATH.map do |path|
File.join File.expand_path(path), template_path
end.find do |dir|
File.directory? dir
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_template(template, environment = nil)\n if template == File.expand_path(template)\n return template\n end\n\n if template_paths = templatepath(environment)\n # If we can find the template in :templatedir, we return that.\n template_paths.collect { |path|\n File::join(path, t... | [
"0.7697728",
"0.7442538",
"0.7375207",
"0.7342334",
"0.730042",
"0.7266352",
"0.7195497",
"0.7160194",
"0.70773727",
"0.70425653",
"0.7033582",
"0.69727063",
"0.69649947",
"0.68451715",
"0.6829783",
"0.68171185",
"0.6808569",
"0.6801624",
"0.67940944",
"0.67928237",
"0.678107... | 0.8370017 | 0 |
Sets the minimum visibility of a documented method. Accepts +:public+, +:protected+, +:private+, +:nodoc+, or +:all+. When +:all+ is passed, visibility is set to +:private+, similarly to RDOCOPT="all", see visibility for more information. | def visibility= visibility
case visibility
when :all
@visibility = :private
else
@visibility = visibility
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_invisible min_visibility\n return if [:private, :nodoc].include? min_visibility\n remove_invisible_in @method_list, min_visibility\n remove_invisible_in @attributes, min_visibility\n remove_invisible_in @constants, min_visibility\n end",
"def set_visibility_for(methods, visibility, single... | [
"0.6008659",
"0.592695",
"0.592695",
"0.5912931",
"0.568222",
"0.56786",
"0.5651809",
"0.5651809",
"0.5651005",
"0.56307065",
"0.5623809",
"0.5505743",
"0.54684997",
"0.5417983",
"0.53534794",
"0.5335085",
"0.53225",
"0.53225",
"0.53225",
"0.53225",
"0.53225",
"0.5315503",
... | 0.63949263 | 0 |
Displays a warning using Kernelwarn if we're being verbose | def warn message
super message if @verbosity > 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gocdkit_warn(*message)\n unless ENV['GOCDKIT_SILENT']\n warn message\n end\n end",
"def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",
"def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",
"def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",
"def octokit_warn(*message... | [
"0.7673542",
"0.76444554",
"0.76444554",
"0.76444554",
"0.7520182",
"0.751475",
"0.7404578",
"0.7392319",
"0.72966343",
"0.7206673",
"0.7127614",
"0.7115326",
"0.7108486",
"0.7088187",
"0.7080167",
"0.70779353",
"0.7043646",
"0.7031715",
"0.7027203",
"0.69252634",
"0.6924737"... | 0.7228957 | 9 |
Writes the YAML file .rdoc_options to the current directory containing the parsed options. | def write_options
RDoc.load_yaml
File.open '.rdoc_options', 'w' do |io|
io.set_encoding Encoding::UTF_8
io.print to_yaml
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def document options\n self.store = RDoc::Store.new\n\n if RDoc::Options === options then\n @options = options\n else\n @options = RDoc::Options.load_options\n @options.parse options\n end\n @options.finish\n\n if @options.pipe then\n handle_pipe\n exit\n end\n\n un... | [
"0.6075542",
"0.6069516",
"0.6067342",
"0.5986676",
"0.5837384",
"0.57750684",
"0.5729022",
"0.56936115",
"0.56932694",
"0.5689446",
"0.5613527",
"0.55708367",
"0.55134165",
"0.5508096",
"0.5436622",
"0.5417602",
"0.5397582",
"0.5392399",
"0.5384748",
"0.53786826",
"0.5350565... | 0.82631624 | 0 |
Creates a new AnyMethod with a token stream +text+ and +name+ | def initialize text, name
super
@c_function = nil
@dont_rename_initialize = false
@token_stream = nil
@calls_super = false
@superclass_method = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test(name, token_stream)\n self.send(name, TokenStream.new(token_stream))\n end",
"def create_token( text )\n return Scanner::Artifacts::Nodes::Token.new( text, nil, 0, 0, 0, nil )\n end",
"def text_token(text, kind); end",
"def text_token(text, kind); end",
"def initialize(text, optio... | [
"0.58341265",
"0.5797723",
"0.57810575",
"0.57810575",
"0.566603",
"0.56172067",
"0.56023026",
"0.5558583",
"0.5506642",
"0.5495882",
"0.548744",
"0.54529977",
"0.54500985",
"0.541519",
"0.5400607",
"0.53805083",
"0.5347173",
"0.5336197",
"0.53248465",
"0.5309997",
"0.5280722... | 0.57982385 | 1 |
Adds +an_alias+ as an alias for this method in +context+. | def add_alias an_alias, context = nil
method = self.class.new an_alias.text, an_alias.new_name
method.record_location an_alias.file
method.singleton = self.singleton
method.params = self.params
method.visibility = self.visibility
method.comment = an_alias.comment
method.is_alias_for = self
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_alias(an_alias, context)\n raise NotImplementedError\n end",
"def add_alias(an_alias, context)\n new_attr = self.class.new(self.text, an_alias.new_name, self.rw,\n self.comment, self.singleton)\n\n new_attr.record_location an_alias.file\n new_attr.visibility = se... | [
"0.83964986",
"0.7671703",
"0.739793",
"0.7379153",
"0.7163875",
"0.70848215",
"0.697994",
"0.6931855",
"0.6931855",
"0.69190544",
"0.6720706",
"0.66777015",
"0.66632897",
"0.66632897",
"0.651904",
"0.6510194",
"0.6484467",
"0.6484467",
"0.647357",
"0.6464377",
"0.6391861",
... | 0.8062045 | 1 |
Prefix for +aref+ is 'method'. | def aref_prefix
'method'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aref_prefix\n raise NotImplementedError\n end",
"def route_prefix_to_method_name(method)\n \"#{route_prefix + \"_\" if route_prefix}#{method}\"\n end",
"def aref_prefix\n 'attribute'\n end",
"def method_missing(method, *args)\r\n str = method.to_s\r\n str = str.sub(/[\\!\\?]$/, ... | [
"0.70967954",
"0.70398235",
"0.6547926",
"0.62356687",
"0.614052",
"0.6117049",
"0.60966617",
"0.60916513",
"0.60742325",
"0.60742325",
"0.6040047",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299",
"0.6023299... | 0.9118117 | 0 |
The call_seq or the param_seq with method name, if there is no call_seq. Use this for displaying a method's argument lists. | def arglists
if @call_seq then
@call_seq
elsif @params then
"#{name}#{param_seq}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def param_seq\n if @call_seq then\n params = @call_seq.split(\"\\n\").last\n params = params.sub(/[^( ]+/, '')\n params = params.sub(/(\\|[^|]+\\|)\\s*\\.\\.\\.\\s*(end|\\})/, '\\1 \\2')\n elsif @params then\n params = @params.gsub(/\\s*\\#.*/, '')\n params = params.tr_s(\"\\n \", \"... | [
"0.67508477",
"0.65573275",
"0.62178177",
"0.620205",
"0.61209977",
"0.60524356",
"0.6038629",
"0.6002108",
"0.5972253",
"0.59435546",
"0.5922307",
"0.5922307",
"0.58942676",
"0.58508563",
"0.5809066",
"0.57786137",
"0.5764622",
"0.5739311",
"0.57344025",
"0.5728271",
"0.5711... | 0.78492826 | 1 |
Different ways to call this method | def call_seq
unless call_seq = _call_seq
call_seq = is_alias_for._call_seq if is_alias_for
end
return unless call_seq
deduplicate_call_seq(call_seq)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calls; end",
"def calls; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call() end",
"def call( *args )\n raise NotImplementedError\n end",
"def overload; end",
"def call(*)... | [
"0.68725365",
"0.68725365",
"0.6868664",
"0.6868664",
"0.6868664",
"0.6868664",
"0.6868664",
"0.6868664",
"0.6868664",
"0.6868664",
"0.6712348",
"0.6683475",
"0.66578263",
"0.6572899",
"0.6572899",
"0.6565752",
"0.6544124",
"0.6538732",
"0.6538732",
"0.65015197",
"0.6304526",... | 0.0 | -1 |
Sets the different ways you can call this method. If an empty +call_seq+ is given nil is assumed. See also param_seq | def call_seq= call_seq
return if call_seq.empty?
@call_seq = call_seq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _call_seq\n @call_seq if defined?(@call_seq) && @call_seq\n end",
"def place_calls\n @calls.each do |call|\n target, specific_options = @call_targets[call]\n local_options = @options.dup.deep_merge specific_options if specific_options\n call.dial target, (local_o... | [
"0.62757266",
"0.59299755",
"0.58129305",
"0.56491065",
"0.5647646",
"0.5647646",
"0.53507656",
"0.5276475",
"0.5276475",
"0.52525824",
"0.521244",
"0.51870793",
"0.5144569",
"0.5066181",
"0.50464803",
"0.5009604",
"0.50087047",
"0.50087047",
"0.49982953",
"0.49978772",
"0.49... | 0.6377772 | 0 |
Loads is_alias_for from the internal name. Returns nil if the alias cannot be found. | def is_alias_for # :nodoc:
case @is_alias_for
when RDoc::MethodAttr then
@is_alias_for
when Array then
return nil unless @store
klass_name, singleton, method_name = @is_alias_for
return nil unless klass = @store.find_class_or_module(klass_name)
@is_alias_for = klass.find_met... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_alias_for\n case @is_alias_for\n when String then\n found = @store.find_class_or_module @is_alias_for\n @is_alias_for = found if found\n @is_alias_for\n else\n @is_alias_for\n end\n end",
"def is_alias?; end",
"def has_alias?\n !@alias.nil?\n end",
"def alias?(... | [
"0.7494695",
"0.6886952",
"0.68017095",
"0.6567702",
"0.65331286",
"0.636127",
"0.6352708",
"0.62146986",
"0.61285305",
"0.6084077",
"0.60774475",
"0.6025077",
"0.59720117",
"0.5902924",
"0.5900017",
"0.58084136",
"0.57820135",
"0.575944",
"0.5729423",
"0.56979275",
"0.569357... | 0.667236 | 3 |
Dumps this AnyMethod for use by ri. See also marshal_load | def marshal_dump
aliases = @aliases.map do |a|
[a.name, parse(a.comment)]
end
is_alias_for = [
@is_alias_for.parent.full_name,
@is_alias_for.singleton,
@is_alias_for.name
] if @is_alias_for
[ MARSHAL_VERSION,
@name,
full_name,
@singleton,
@visibility... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _dump() end",
"def _dump\n end",
"def _dump()\n #This is a stub, used for indexing\n end",
"def dump() end",
"def marshal_dump; end",
"def marshal_dump\n dump\n end",
"def _dump(level)\n payload = Marshal.dump [@caller, @method, @arguments, @block]\n \"#{@id}:#{payload}... | [
"0.70663774",
"0.69539905",
"0.69534725",
"0.69393677",
"0.68569255",
"0.68542564",
"0.6771337",
"0.66543525",
"0.6579627",
"0.65086126",
"0.6458632",
"0.6409861",
"0.63889354",
"0.6382539",
"0.63780934",
"0.63472605",
"0.6287966",
"0.6233806",
"0.62275493",
"0.6222901",
"0.6... | 0.0 | -1 |
Loads this AnyMethod from +array+. For a loaded AnyMethod the following methods will return cached values: full_name parent_name | def marshal_load array
initialize_visibility
@dont_rename_initialize = nil
@token_stream = nil
@aliases = []
@parent = nil
@parent_name = nil
@parent_class = nil
@section = nil
@file = nil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def marshal_load(array)\n @dont_rename_initialize = nil\n @is_alias_for = nil\n @token_stream = nil\n\n @name = array[1]\n @full_name = array[2]\n @singleton = array[3]\n @visibility = array[4]\n @comment = array[5]\n @call_seq = array[6]\n ... | [
"0.5621846",
"0.55711114",
"0.5530012",
"0.55126613",
"0.5421555",
"0.5330415",
"0.5271249",
"0.5102776",
"0.5013179",
"0.49915543",
"0.49794537",
"0.49727702",
"0.49285346",
"0.49176413",
"0.49061695",
"0.4897669",
"0.48522916",
"0.48515472",
"0.4840028",
"0.47851676",
"0.47... | 0.52232814 | 7 |
Method name If the method has no assigned name, it extracts it from call_seq. | def name
return @name if @name
@name =
@call_seq[/^.*?\.(\w+)/, 1] ||
@call_seq[/^.*?(\w+)/, 1] ||
@call_seq if @call_seq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calls_by_method_name; end",
"def method_name\n m = @method_stack.first || @@no_method\n m = \"##{m}\" unless m =~ /::/\n m\n end",
"def method_name\n m = @method_stack.first || @@no_method\n m = \"##{m}\" unless m =~ /::/\n m\n end",
"def method_name\r\n method_info[:method_name]... | [
"0.72311246",
"0.72139025",
"0.72139025",
"0.7084698",
"0.68768936",
"0.68564343",
"0.6757987",
"0.67031676",
"0.66973305",
"0.66973305",
"0.6680738",
"0.6674905",
"0.6674432",
"0.66331017",
"0.6618215",
"0.65405804",
"0.65405804",
"0.65405804",
"0.65405804",
"0.65405804",
"0... | 0.70307744 | 4 |
A list of this method's method and yield parameters. +callseq+ params are preferred over parsed method and block params. | def param_list
if @call_seq then
params = @call_seq.split("\n").last
params = params.sub(/.*?\((.*)\)/, '\1')
params = params.sub(/(\{|do)\s*\|([^|]*)\|.*/, ',\2')
elsif @params then
params = @params.sub(/\((.*)\)/, '\1')
params << ",#{@block_params}" if @block_params
elsif @b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def param_seq\n if @call_seq then\n params = @call_seq.split(\"\\n\").last\n params = params.sub(/[^( ]+/, '')\n params = params.sub(/(\\|[^|]+\\|)\\s*\\.\\.\\.\\s*(end|\\})/, '\\1 \\2')\n elsif @params then\n params = @params.gsub(/\\s*\\#.*/, '')\n params = params.tr_s(\"\\n \", \"... | [
"0.684731",
"0.6598407",
"0.6598407",
"0.6472708",
"0.6472427",
"0.6447312",
"0.63102514",
"0.6290509",
"0.6141693",
"0.6070898",
"0.60342383",
"0.5934896",
"0.5934896",
"0.5880556",
"0.58792156",
"0.5871095",
"0.5853704",
"0.58509713",
"0.5831957",
"0.580083",
"0.5797163",
... | 0.69549257 | 0 |
Pretty parameter list for this method. If the method's parameters were given by +callseq+ it is preferred over the parsed values. | def param_seq
if @call_seq then
params = @call_seq.split("\n").last
params = params.sub(/[^( ]+/, '')
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
elsif @params then
params = @params.gsub(/\s*\#.*/, '')
params = params.tr_s("\n ", " ")
params = "(#{params})... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arglists\n if @call_seq then\n @call_seq\n elsif @params then\n \"#{name}#{param_seq}\"\n end\n end",
"def arglists\n if @call_seq then\n @call_seq\n elsif @params then\n \"#{name}#{param_seq}\"\n end\n end",
"def build_param_calls_from( atts )\n atts.map do |... | [
"0.6839637",
"0.6839637",
"0.67042387",
"0.64520663",
"0.6018173",
"0.5959671",
"0.59574276",
"0.5946748",
"0.5922979",
"0.59062135",
"0.5875338",
"0.58475673",
"0.58163786",
"0.5788929",
"0.5747776",
"0.57407427",
"0.5679343",
"0.56777716",
"0.5659089",
"0.56201506",
"0.5614... | 0.6651911 | 3 |
Sets the store for this method and its referenced 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 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 end\n @method_list.each do |meth| meth.store = store... | [
"0.7138566",
"0.7021693",
"0.66073364",
"0.64950687",
"0.64733726",
"0.64733726",
"0.6429448",
"0.64170086",
"0.6399626",
"0.6399626",
"0.6399626",
"0.6399626",
"0.6399626",
"0.6399626",
"0.6399626",
"0.6399626",
"0.6399626",
"0.63991064",
"0.6385239",
"0.6385239",
"0.6380176... | 0.5835279 | 55 |
For methods that +super+, find the superclass method that would be called. | def superclass_method
return unless @calls_super
return @superclass_method if @superclass_method
parent.each_ancestor do |ancestor|
if method = ancestor.method_list.find { |m| m.name == @name } then
@superclass_method = method
break
end
end
@superclass_method
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def super_method \n puts \"Method of a superclass\"\n end",
"def super_method; end",
"def super_method \n \n puts \"Method of superclass\"\n end",
"def lookup_super(obj, super_level)\n return nil if !obj\n\n sup = obj.super(super_level)\n if !sup\n raise Pry... | [
"0.6979434",
"0.6880229",
"0.6824984",
"0.65224755",
"0.63332254",
"0.62823665",
"0.61578363",
"0.61525464",
"0.61525464",
"0.61387485",
"0.6090119",
"0.60673434",
"0.60469705",
"0.60387564",
"0.60387564",
"0.5982182",
"0.58913845",
"0.5875029",
"0.5853069",
"0.58464587",
"0.... | 0.8290427 | 0 |
call_seq without deduplication and alias lookup. | def _call_seq
@call_seq if defined?(@call_seq) && @call_seq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call_seq\n unless call_seq = _call_seq\n call_seq = is_alias_for._call_seq if is_alias_for\n end\n\n return unless call_seq\n\n deduplicate_call_seq(call_seq)\n end",
"def deduplicate_call_seq(call_seq)\n return call_seq unless is_alias_for || !aliases.empty?\n\n method_name = self.na... | [
"0.8064703",
"0.7404433",
"0.6208634",
"0.6208634",
"0.5899502",
"0.58980423",
"0.575407",
"0.56632257",
"0.5573145",
"0.549801",
"0.549801",
"0.5484957",
"0.5452981",
"0.54337364",
"0.5357398",
"0.5357398",
"0.5355978",
"0.5355978",
"0.5342083",
"0.5326662",
"0.5326662",
"... | 0.6046925 | 4 |
call_seq with alias examples information removed, if this method is an alias method. | def deduplicate_call_seq(call_seq)
return call_seq unless is_alias_for || !aliases.empty?
method_name = self.name
method_name = method_name[0, 1] if method_name =~ /\A\[/
entries = call_seq.split "\n"
ignore = aliases.map(&:name)
if is_alias_for
ignore << is_alias_for.name
ignore.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alias_delete(al)\n obj_delete al, Alias\n end",
"def call_seq\n unless call_seq = _call_seq\n call_seq = is_alias_for._call_seq if is_alias_for\n end\n\n return unless call_seq\n\n deduplicate_call_seq(call_seq)\n end",
"def alias_remove(al,member)\n obj_remove(al,Alias,membe... | [
"0.5651361",
"0.56202185",
"0.5572169",
"0.5512471",
"0.5494346",
"0.54467034",
"0.54459894",
"0.542238",
"0.5419948",
"0.5419948",
"0.53450125",
"0.53450125",
"0.53450125",
"0.53127974",
"0.5310631",
"0.5303873",
"0.52883434",
"0.52883434",
"0.52883434",
"0.5258295",
"0.5254... | 0.62829864 | 0 |
Create an RDoc task with the given name. See the RDoc::Task class overview for documentation. | def initialize name = :rdoc # :yield: self
defaults
check_names name
@name = name
yield self if block_given?
define
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simple_rake_task(task_name = 'test_task', indent: '', task_body: \"\\n\")\n \"\\n\" + indent +\n \"desc 'task named #{task_name}'\\n\" +\n indent + \"task :#{task_name} do\\n\" +\n indent + \" \" + task_body +\n indent + \"end\\n\\n\"\n\n end",
"def rdoc_task_description\n ... | [
"0.70349896",
"0.6996707",
"0.676218",
"0.676218",
"0.6760346",
"0.6690553",
"0.66201705",
"0.6613103",
"0.6595898",
"0.6574311",
"0.6531792",
"0.65095055",
"0.64601403",
"0.6378694",
"0.6226249",
"0.6192413",
"0.6132034",
"0.6120559",
"0.60903907",
"0.6064441",
"0.60530967",... | 0.0 | -1 |
Task description for the clobber rdoc task or its renamed equivalent | def clobber_task_description
"Remove RDoc HTML files"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rerdoc_task_description\n \"Rebuild RDoc HTML files\"\n end",
"def rdoc_task_description\n 'Build RDoc HTML files'\n end",
"def doc_task; end",
"def define\n desc rdoc_task_description\n task rdoc_task_name\n\n desc rerdoc_task_description\n task rerdoc_task_name => [clobber_task_name... | [
"0.7634239",
"0.7562876",
"0.7010758",
"0.69219744",
"0.6781453",
"0.6746637",
"0.6450325",
"0.6440954",
"0.6408459",
"0.6372122",
"0.6355384",
"0.6354911",
"0.6315474",
"0.6277704",
"0.6230498",
"0.6122453",
"0.61222035",
"0.60569453",
"0.6041828",
"0.60317385",
"0.60223144"... | 0.84101456 | 0 |
Sets default task values | def defaults
@name = :rdoc
@rdoc_files = Rake::FileList.new
@rdoc_dir = 'html'
@main = nil
@title = nil
@template = nil
@generator = nil
@options = []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_task(name,task=nil) # Add a Task and its name\n @defaults['taskname']=name.to_s # taskname = task name\n if ! task.nil?\n @defaults['taskobj']=task # taskobj = the Task\n @defaults['env']=task.envars # env = the Task's env vars\n @defaults['seq']=task.seq # seq = Task'... | [
"0.707794",
"0.6714458",
"0.6627441",
"0.6597361",
"0.6597361",
"0.65888643",
"0.6561272",
"0.65471274",
"0.6491222",
"0.6491222",
"0.6491222",
"0.6491222",
"0.6491222",
"0.6491222",
"0.6490677",
"0.646767",
"0.6465677",
"0.64562196",
"0.64266276",
"0.6413825",
"0.6340562",
... | 0.0 | -1 |
All source is inline now. This method is deprecated | def inline_source # :nodoc:
warn "RDoc::Task#inline_source is deprecated"
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inline_code; end",
"def inline_source=(value) # :nodoc:\n warn \"RDoc::Task#inline_source is deprecated\"\n end",
"def inline!\n @inline = true\n end",
"def inline!\n self.enabled = true \n self.inline = true\n end",
"def update!(**args)\n @inline_source = args[:in... | [
"0.74800813",
"0.7433687",
"0.70340157",
"0.6661789",
"0.66229266",
"0.65431505",
"0.64780843",
"0.6472432",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242",
"0.6300242"... | 0.7943368 | 0 |
All source is inline now. This method is deprecated | def inline_source=(value) # :nodoc:
warn "RDoc::Task#inline_source is deprecated"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inline_source # :nodoc:\n warn \"RDoc::Task#inline_source is deprecated\"\n true\n end",
"def inline_code; end",
"def inline!\n @inline = true\n end",
"def inline!\n self.enabled = true \n self.inline = true\n end",
"def update!(**args)\n @inline_source = args[:... | [
"0.7942548",
"0.7481691",
"0.70356363",
"0.666276",
"0.66232437",
"0.65440905",
"0.6479122",
"0.6470943",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0.62989694",
"0... | 0.74332106 | 2 |
Create the tasks defined by this task lib. | def define
desc rdoc_task_description
task rdoc_task_name
desc rerdoc_task_description
task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
desc clobber_task_description
task clobber_task_name do
rm_r @rdoc_dir rescue nil
end
task :clobber => [clobber_task_name]
dir... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def define_tasks\r\n define_repeat_task\r\n define_clobber_task\r\n define_build_task\r\n end",
"def define_tasks\r\n define_clobber_task\r\n define_build_task\r\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def make_tasks\n ... | [
"0.7606729",
"0.7325037",
"0.73218364",
"0.73150355",
"0.72710544",
"0.7211392",
"0.72080183",
"0.7176689",
"0.71062285",
"0.70869637",
"0.7025319",
"0.69870484",
"0.6883644",
"0.6845661",
"0.6837366",
"0.6808642",
"0.67390406",
"0.6733832",
"0.6724307",
"0.6697595",
"0.66771... | 0.0 | -1 |
List of options that will be supplied to RDoc | def option_list
result = @options.dup
result << "-o" << @rdoc_dir
result << "--main" << main if main
result << "--markup" << markup if markup
result << "--title" << title if title
result << "-T" << template if template
result << '-f' << generator if generato... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rdoc_options\n @rdoc_options ||= []\n end",
"def rdoc_options=(options)\n @rdoc_options = Array options\n end",
"def options() end",
"def docopt_options(width)\n @options['Options'] = {} unless @options['Options']\n @options['Options']['-h --help'] = 'Show this screen'\n @options['... | [
"0.77255386",
"0.7311494",
"0.72042596",
"0.70888925",
"0.6972602",
"0.6967391",
"0.6967045",
"0.6951866",
"0.6931266",
"0.6930278",
"0.6808264",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
"0.6743728",
... | 0.7736303 | 0 |
The block passed to this method will be called just before running the RDoc generator. It is allowed to modify RDoc::Task attributes inside the block. | def before_running_rdoc(&block)
@before_running_rdoc = block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def doc_task=(_arg0); end",
"def doc_task; end",
"def with_yardoc_task(&block)\n @with_yardoc_task = block\n nil\n end",
"def pre_generation_hook(task)\n end",
"def pre_task\n end",
"def task\n end",
"def define(&block)\n namespace :dm do\n namespace(:doc... | [
"0.7145589",
"0.7019063",
"0.6740689",
"0.65608174",
"0.5966829",
"0.5952098",
"0.5929191",
"0.58684564",
"0.5787329",
"0.57535446",
"0.57535446",
"0.5698232",
"0.5696052",
"0.5666234",
"0.56387347",
"0.56251484",
"0.5578047",
"0.55409217",
"0.5537149",
"0.55287",
"0.54910785... | 0.5981278 | 4 |
Task description for the rdoc task or its renamed equivalent | def rdoc_task_description
'Build RDoc HTML files'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def taskDescription _args\n \"taskDescription _args;\" \n end",
"def rerdoc_task_description\n \"Rebuild RDoc HTML files\"\n end",
"def description\n \"This task hits the corpwatch API and adds detail for the organization.\"\nend",
"def description\n\t\t\"Msf Wrapper Task\"\n\tend",
"def descr... | [
"0.7695273",
"0.7619946",
"0.75597113",
"0.75311774",
"0.7489309",
"0.74144274",
"0.73922336",
"0.7366768",
"0.73498005",
"0.7334509",
"0.7334509",
"0.7320565",
"0.73193413",
"0.72138184",
"0.71772283",
"0.71500677",
"0.71500677",
"0.7129437",
"0.7100193",
"0.70712364",
"0.69... | 0.7991685 | 0 |
Task description for the rerdoc task or its renamed description | def rerdoc_task_description
"Rebuild RDoc HTML files"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def taskDescription _args\n \"taskDescription _args;\" \n end",
"def description\n \"This task hits the corpwatch API and adds detail for the organization.\"\nend",
"def rdoc_task_description\n 'Build RDoc HTML files'\n end",
"def desc(*args)\n Rake.application.DescribeTask(*args)\n end"... | [
"0.7661531",
"0.7567123",
"0.7506345",
"0.74476224",
"0.744363",
"0.74404067",
"0.7400638",
"0.7321042",
"0.72994107",
"0.72884053",
"0.72399926",
"0.71954626",
"0.71756124",
"0.716779",
"0.7162707",
"0.7131261",
"0.7111415",
"0.7111415",
"0.7060161",
"0.70168537",
"0.6988295... | 0.73898953 | 7 |
Name that wasn't found | def name
@klass
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n fail\n end",
"def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end",
"def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missi... | [
"0.75200295",
"0.6906543",
"0.6906543",
"0.6747619",
"0.6729524",
"0.67022157",
"0.66828257",
"0.6678322",
"0.6656013",
"0.66116047",
"0.6608149",
"0.6564318",
"0.6472278",
"0.6446503",
"0.644503",
"0.6393752",
"0.63899356",
"0.638383",
"0.6369293",
"0.63560224",
"0.63558555"... | 0.0 | -1 |
Creates a new driver using +initial_options+ from ::process_args | def initialize initial_options = {}
@paging = false
@classes = nil
options = self.class.default_options.update(initial_options)
@formatter_klass = options[:formatter]
require 'profile' if options[:profile]
@names = options[:names]
@list = options[:list]
@doc_dirs = []
@stores ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(args = {})\n @driver = args.fetch(:driver)\n @instrumenter = args[:instrumenter] || Instrumenters::Noop\n @argument_generators = args.fetch(:argument_generators, DefaultArgumentGenerators)\n @result_transformers = args.fetch(:result_transformers, DefaultResultTransformers... | [
"0.61163086",
"0.592743",
"0.5846046",
"0.57822436",
"0.56821674",
"0.5673008",
"0.5634621",
"0.56337065",
"0.55923206",
"0.5581425",
"0.5534453",
"0.54933894",
"0.5483133",
"0.54583746",
"0.54515123",
"0.54347366",
"0.54199743",
"0.54049885",
"0.5380666",
"0.5374082",
"0.536... | 0.0 | -1 |
Adds paths for undocumented classes +also_in+ to +out+ | def add_also_in out, also_in
return if also_in.empty?
out << RDoc::Markup::Rule.new(1)
out << RDoc::Markup::Paragraph.new("Also found in:")
paths = RDoc::Markup::Verbatim.new
also_in.each do |store|
paths.parts.push store.friendly_path, "\n"
end
out << paths
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_also_in out, also_in\n return if also_in.empty?\n out << RDoc::Markup::Rule.new(1)\n out << RDoc::Markup::Paragraph.new(\"Also found in:\")\n paths = RDoc::Markup::Verbatim.new\n also_in.each do |store|\n paths.parts.push store.friendly_path, \"\\n\"\n end\n out << paths\n end",
... | [
"0.6739344",
"0.54237914",
"0.527448",
"0.51251054",
"0.50434625",
"0.50198334",
"0.50198334",
"0.5015092",
"0.5009917",
"0.49243665",
"0.4923776",
"0.48050904",
"0.47949314",
"0.47633108",
"0.47474477",
"0.4745903",
"0.47249568",
"0.47080088",
"0.46964034",
"0.4681975",
"0.4... | 0.67099684 | 1 |
Adds a class header to +out+ for class +name+ which is described in +classes+. | def add_class out, name, classes
heading = if classes.all? { |klass| klass.module? } then
name
else
superclass = classes.map do |klass|
klass.superclass unless klass.module?
end.compact.shift || 'Object'
superclass = su... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_class out, name, classes\n heading = if classes.all? { |klass| klass.module? } then\n name\n else\n superclass = classes.map do |klass|\n klass.superclass unless klass.module?\n end.compact.shift || 'Object'\n \"#{... | [
"0.77203774",
"0.65526545",
"0.65526545",
"0.6417513",
"0.63913816",
"0.63913816",
"0.6008054",
"0.59873694",
"0.5978769",
"0.5935106",
"0.58697504",
"0.58523226",
"0.57526726",
"0.56985086",
"0.5645034",
"0.5632175",
"0.55988276",
"0.5539521",
"0.5519334",
"0.55119383",
"0.5... | 0.77744395 | 0 |
Adds "(from ...)" to +out+ for +store+ | def add_from out, store
out << RDoc::Markup::Paragraph.new("(from #{store.friendly_path})")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sinterstore(destination, *keys); end",
"def sinterstore(destination, *keys); end",
"def sunionstore(destination, *keys); end",
"def sunionstore(destination, *keys); end",
"def add_from out, store\n out << RDoc::Markup::Paragraph.new(\"(from #{store.friendly_path})\")\n #out << RDoc::Markup::Parag... | [
"0.57995206",
"0.57995206",
"0.5773362",
"0.5773362",
"0.57511467",
"0.53537023",
"0.53536487",
"0.5283503",
"0.524805",
"0.52138853",
"0.51939094",
"0.51939094",
"0.5091095",
"0.5091095",
"0.50848484",
"0.5054969",
"0.50179315",
"0.50150776",
"0.49996576",
"0.4979416",
"0.49... | 0.55201256 | 5 |
Adds +extends+ to +out+ | def add_extends out, extends
add_extension_modules out, 'Extended by', extends
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_extend ext\n add_to @extends, ext\n\n ext\n end",
"def extend_plugins(extends)\n extensions_matching(extends).each do |plugin|\n extend plugin\n end\n end",
"def each_extend # :yields: extend\n @extends.each do |e| yield e end\n end",
"def extend(*args)\n include... | [
"0.6509369",
"0.6364438",
"0.5815362",
"0.5729004",
"0.5626894",
"0.54826576",
"0.5457835",
"0.54395694",
"0.5422499",
"0.5240445",
"0.5185544",
"0.5095394",
"0.5055487",
"0.5020073",
"0.4994433",
"0.49303368",
"0.49262363",
"0.49157852",
"0.4907583",
"0.48698077",
"0.4860028... | 0.7312278 | 0 |
Adds a list of +extensions+ to this module of the given +type+ to +out+. add_includes and add_extends call this, so you should use those directly. | def add_extension_modules out, type, extensions
return if extensions.empty?
out << RDoc::Markup::Rule.new(1)
out << RDoc::Markup::Heading.new(1, "#{type}:")
extensions.each do |modules, store|
if modules.length == 1 then
add_extension_modules_single out, store, modules.first
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_extends out, extends\n add_extension_modules out, 'Extended by', extends\n end",
"def extensions\n TYPE_EXTS[type] || []\n end",
"def add_extensions(*extensions)\n self.extensions += extensions\n end",
"def append_extensions(*extensions)\n self.extensions.push(*extensions)\n e... | [
"0.6956549",
"0.6388496",
"0.6372871",
"0.636513",
"0.6339106",
"0.63236886",
"0.61988795",
"0.61988795",
"0.5986426",
"0.58087736",
"0.56447005",
"0.56015563",
"0.55908316",
"0.55464333",
"0.5524863",
"0.5515776",
"0.54997844",
"0.54997844",
"0.54617393",
"0.5448142",
"0.538... | 0.7872149 | 0 |
Renders multiple included +modules+ from +store+ to +out+. | def add_extension_modules_multiple out, store, modules # :nodoc:
out << RDoc::Markup::Paragraph.new("(from #{store.friendly_path})")
wout, with = modules.partition { |incl| incl.comment.empty? }
out << RDoc::Markup::BlankLine.new unless with.empty?
with.each do |incl|
out << RDoc::Markup::Parag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules\n @modules= GmaModule.all :order=>\"seq\"\n render :layout => false\n end",
"def add_extension_modules_single out, store, include # :nodoc:\n name = include.name\n path = store.friendly_path\n out << RDoc::Markup::Paragraph.new(\"#{name} (from #{path})\")\n\n if include.comment the... | [
"0.6124545",
"0.6084597",
"0.57668775",
"0.57668775",
"0.57668775",
"0.5758351",
"0.5685324",
"0.56576383",
"0.55537707",
"0.55479264",
"0.5527972",
"0.552513",
"0.5501531",
"0.5383362",
"0.5379218",
"0.52949005",
"0.5263258",
"0.5242882",
"0.52306014",
"0.52249473",
"0.52111... | 0.7015763 | 0 |
Adds a single extension module +include+ from +store+ to +out+ | def add_extension_modules_single out, store, include # :nodoc:
name = include.name
path = store.friendly_path
out << RDoc::Markup::Paragraph.new("#{name} (from #{path})")
if include.comment then
out << RDoc::Markup::BlankLine.new
out << include.comment
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_includes out, includes\n add_extension_modules out, 'Includes', includes\n end",
"def add_include include\n add_to @includes, include\n\n include\n end",
"def add_include(include)\n @includes << include\n end",
"def add_include(include)\n add_to @includes, include\n end",
"def in... | [
"0.74127895",
"0.6869869",
"0.67145747",
"0.6655095",
"0.63775396",
"0.6343441",
"0.6285606",
"0.6285606",
"0.6177459",
"0.6177459",
"0.6147971",
"0.61215615",
"0.6120721",
"0.6090778",
"0.6082915",
"0.6036588",
"0.60100085",
"0.5983713",
"0.5940662",
"0.5933757",
"0.5881097"... | 0.71581817 | 1 |
Adds +includes+ to +out+ | def add_includes out, includes
add_extension_modules out, 'Includes', includes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def include inc\n @includes << inc\n end",
"def add_include include\n add_to @includes, include\n\n include\n end",
"def add_includes out, includes\n return if includes.empty?\n out << RDoc::Markup::Rule.new(1)\n out << RDoc::Markup::Heading.new(1, \"Includes:\")\n includes.each do |... | [
"0.73664707",
"0.7247839",
"0.7094536",
"0.7030407",
"0.697872",
"0.6889653",
"0.67893213",
"0.6777362",
"0.6770735",
"0.67173666",
"0.67173666",
"0.6711081",
"0.65724623",
"0.6562634",
"0.6543851",
"0.6513643",
"0.6513024",
"0.63997626",
"0.63987345",
"0.6395279",
"0.6373952... | 0.6819499 | 6 |
Looks up the method +name+ and adds it to +out+ | def add_method out, name
filtered = lookup_method name
method_out = method_document name, filtered
out.concat method_out.parts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def walk_method(name); end",
"def register_outputter(name, klass, method_name)\n outputters[name] = [klass, method_name]\n end",
"def stow_existing_definition(method_name)\n @methods_proxied << method_name\n new_alias = create_alias_for_existing_method(method_name)\n if new_alias\n ... | [
"0.62960494",
"0.60110414",
"0.57946527",
"0.5714894",
"0.57066673",
"0.56831324",
"0.56717867",
"0.5604865",
"0.5590624",
"0.5575894",
"0.55369383",
"0.5528333",
"0.55261576",
"0.5525393",
"0.550881",
"0.54190844",
"0.54140127",
"0.5406891",
"0.54040015",
"0.5383091",
"0.538... | 0.7519652 | 0 |
Adds documentation for all methods in +klass+ to +out+ | def add_method_documentation out, klass
klass.method_list.each do |method|
begin
add_method out, method.full_name
rescue NotFoundError
next
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_class out, store, klass, also_in # :nodoc:\n comment = klass.comment\n # TODO the store's cache should always return an empty Array\n class_methods = store.class_methods[klass.full_name] || []\n instance_methods = store.instance_methods[klass.full_name] || []\n attributes = st... | [
"0.6364334",
"0.5920805",
"0.58570164",
"0.5765406",
"0.5726599",
"0.5652521",
"0.55982834",
"0.5517211",
"0.54982764",
"0.5448106",
"0.5331976",
"0.53133917",
"0.53133917",
"0.52918655",
"0.52892536",
"0.52611244",
"0.5214907",
"0.5212845",
"0.5187585",
"0.51817244",
"0.5179... | 0.74473655 | 0 |
Adds a list of +methods+ to +out+ with a heading of +name+ | def add_method_list out, methods, name
return if methods.empty?
out << RDoc::Markup::Heading.new(1, "#{name}:")
out << RDoc::Markup::BlankLine.new
if @use_stdout and !@interactive then
out.concat methods.map { |method|
RDoc::Markup::Verbatim.new method
}
else
out << RDoc:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_method_list out, methods, name\n return unless methods && !methods.empty?\n out << RDoc::Markup::Heading.new(1, \"#{name}:\")\n out << RDoc::Markup::BlankLine.new\n out << RDoc::Markup::IndentedParagraph.new(2, methods.join(', '))\n out << RDoc::Markup::BlankLine.new\n end",
"def add_meth... | [
"0.8043026",
"0.6502985",
"0.6378161",
"0.59863406",
"0.58586574",
"0.5774344",
"0.57324594",
"0.57123756",
"0.54879886",
"0.54867625",
"0.5477624",
"0.54506445",
"0.5264365",
"0.52585894",
"0.5243252",
"0.52431357",
"0.5228701",
"0.5181267",
"0.5156943",
"0.51393574",
"0.513... | 0.80965954 | 0 |
Returns ancestor classes of +klass+ | def ancestors_of klass
ancestors = []
unexamined = [klass]
seen = []
loop do
break if unexamined.empty?
current = unexamined.shift
seen << current
stores = classes[current]
next unless stores and not stores.empty?
klasses = stores.flat_map do |store|
stor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ancestors_of klass\n ancestors = []\n unexamined = [klass]\n seen = []\n loop do\n break if unexamined.empty?\n current = unexamined.shift\n seen << current\n stores = classes[current]\n break unless stores and not stores.empty?\n klasses = stores.map do |store|\n ... | [
"0.83071035",
"0.78065354",
"0.75626963",
"0.7206452",
"0.70982355",
"0.70751613",
"0.6948718",
"0.6875142",
"0.68399835",
"0.6815027",
"0.6805533",
"0.6690015",
"0.6590334",
"0.6535192",
"0.65232086",
"0.6506179",
"0.650397",
"0.64598286",
"0.64247954",
"0.64194846",
"0.6413... | 0.8305252 | 1 |
For RubyGems backwards compatibility | def class_cache # :nodoc:
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def require_gems; end",
"def gems; end",
"def gems; end",
"def gems; end",
"def gemspec; end",
"def gemspec; end",
"def gemspec; end",
"def gemspec; end",
"def gemspec; end",
"def gemspec; end",
"def gemspec; end",
"def gemspec; end",
"def add_gem_paths; end",
"def gemspec?; end",
"def ... | [
"0.7157622",
"0.6998525",
"0.6998525",
"0.6998525",
"0.69318503",
"0.69318503",
"0.69318503",
"0.69318503",
"0.69318503",
"0.69318503",
"0.69318503",
"0.69318503",
"0.6831311",
"0.67832875",
"0.6767336",
"0.6767336",
"0.6767336",
"0.6767336",
"0.6767336",
"0.6767336",
"0.6767... | 0.0 | -1 |
Builds a RDoc::Markup::Document from +found+, +klasess+ and +includes+ | def class_document name, found, klasses, includes, extends
also_in = []
out = RDoc::Markup::Document.new
add_class out, name, klasses
add_includes out, includes
add_extends out, extends
found.each do |store, klass|
render_class out, store, klass, also_in
end
add_also_in out, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build\n asdocs = scan(@src)\n\n if asdocs.empty?\n puts \"No .asdoc files found.\"\n else\n create_xml(asdocs)\n to_disk(xml)\n end\n end",
"def create_doc(match, path)\n DressCode::Document.new({\n :component => match[0],\n :prose => match[1].strip,\n :path => p... | [
"0.5901585",
"0.582901",
"0.56619716",
"0.5540303",
"0.5540278",
"0.5430599",
"0.5353088",
"0.5332917",
"0.53268015",
"0.5311451",
"0.52679837",
"0.5230315",
"0.5219238",
"0.518874",
"0.5186182",
"0.5182512",
"0.5146402",
"0.5123382",
"0.5121081",
"0.50974363",
"0.50936055",
... | 0.6296571 | 0 |
Adds the class +comment+ to +out+. | def class_document_comment out, comment # :nodoc:
unless comment.empty? then
out << RDoc::Markup::Rule.new(1)
if comment.merged? then
parts = comment.parts
parts = parts.zip [RDoc::Markup::BlankLine.new] * parts.length
parts.flatten!
parts.pop
out.concat parts
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def <<(comment)\n @comments << comment\n end",
"def add_comment(comment); end",
"def render_class out, store, klass, also_in # :nodoc:\n comment = klass.comment\n # TODO the store's cache should always return an empty Array\n class_methods = store.class_methods[klass.full_name] || []... | [
"0.58945864",
"0.58184034",
"0.5770695",
"0.5740637",
"0.5707559",
"0.56883997",
"0.5673362",
"0.5504875",
"0.5499567",
"0.5499567",
"0.5499567",
"0.5499567",
"0.5499567",
"0.5472996",
"0.5451987",
"0.54494137",
"0.54164475",
"0.540399",
"0.53972983",
"0.537935",
"0.537935",
... | 0.6948561 | 0 |
Adds the constants from +klass+ to the Document +out+. | def class_document_constants out, klass # :nodoc:
return if klass.constants.empty?
out << RDoc::Markup::Heading.new(1, "Constants:")
out << RDoc::Markup::BlankLine.new
list = RDoc::Markup::List.new :NOTE
constants = klass.constants.sort_by { |constant| constant.name }
list.items.concat consta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_class out, store, klass, also_in # :nodoc:\n comment = klass.comment\n # TODO the store's cache should always return an empty Array\n class_methods = store.class_methods[klass.full_name] || []\n instance_methods = store.instance_methods[klass.full_name] || []\n attributes = st... | [
"0.65778667",
"0.59145015",
"0.58858967",
"0.572758",
"0.56290203",
"0.561062",
"0.558023",
"0.55555165",
"0.5547819",
"0.54585034",
"0.5442894",
"0.5434946",
"0.5355207",
"0.5340481",
"0.5308442",
"0.5268046",
"0.52508986",
"0.52481246",
"0.5234485",
"0.52324915",
"0.5207352... | 0.7236444 | 0 |
Hash mapping a known class or module to the stores it can be loaded from | def classes
return @classes if @classes
@classes = {}
@stores.each do |store|
store.cache[:modules].each do |mod|
# using default block causes searched-for modules to be added
@classes[mod] ||= []
@classes[mod] << store
end
end
@classes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def classes\n return @classes if @classes\n @classes = {}\n @stores.each do |store|\n store.cache[:modules].each do |mod|\n # using default block causes searched-for modules to be added\n @classes[mod] ||= []\n @classes[mod] << store\n end\n end\n @classes\n end",
"... | [
"0.73785233",
"0.623235",
"0.62287295",
"0.62287295",
"0.6109646",
"0.6039928",
"0.6024243",
"0.59543496",
"0.59524804",
"0.59524804",
"0.59421074",
"0.59420294",
"0.59259015",
"0.5925158",
"0.59099615",
"0.58762145",
"0.5869858",
"0.5869858",
"0.5809342",
"0.58021563",
"0.57... | 0.73731065 | 1 |
Returns the stores wherein +name+ is found along with the classes, extends and includes that match it | def classes_and_includes_and_extends_for name
klasses = []
extends = []
includes = []
found = @stores.map do |store|
begin
klass = store.load_class name
klasses << klass
extends << [klass.extends, store] if klass.extends
includes << [klass.includes, store] if kl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_all_storenames\n\n WiStore.find(:all).collect do |store|\n store.name\n end\n end",
"def find_store name\n @stores.each do |store|\n source = store.source\n\n return source if source == name\n\n return source if\n store.type == :gem and source =~ /^#{Regexp.e... | [
"0.6270916",
"0.608247",
"0.6081846",
"0.6076666",
"0.60516834",
"0.60319704",
"0.60258406",
"0.60208",
"0.59779644",
"0.5956011",
"0.59101653",
"0.5884392",
"0.5820367",
"0.571646",
"0.5702359",
"0.57005537",
"0.57005537",
"0.57005537",
"0.567856",
"0.56647223",
"0.5640133",... | 0.7244604 | 0 |
Completes +name+ based on the caches. For Readline | def complete name
completions = []
klass, selector, method = parse_name name
complete_klass name, klass, selector, method, completions
complete_method name, klass, selector, completions
completions.sort.uniq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reload_name!\n clear_name_cache\n end",
"def store_cached_name\n self.cached_name = \"\"\n self.cached_name << \"#{reference} - \" if reference.present?\n self.cached_name << \"#{resource.title} - \"\n self.cached_name << \"#{criterion.name}\"\n end",
"def read(name)\n @memonized ... | [
"0.61375415",
"0.6118408",
"0.5936122",
"0.5886193",
"0.5885539",
"0.5799466",
"0.5595168",
"0.5491388",
"0.5422371",
"0.5399371",
"0.5338222",
"0.5335012",
"0.5264461",
"0.5241559",
"0.5227837",
"0.51824665",
"0.5133049",
"0.5131847",
"0.5125104",
"0.5122646",
"0.5094638",
... | 0.49453214 | 41 |
Converts +document+ to text and writes it to the pager | def display document
page do |io|
f = formatter(io)
f.width = @width if @width and f.respond_to?(:width)
text = document.accept f
io.write text
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display document\n page do |io|\n text = document.accept formatter(io)\n io.write text\n end\n end",
"def postprocess(document)\n document.gsub(\"\\n\", ' ').strip\n end",
"def process!(document); end",
"def output\n Vedeu::Models::Page.coerce(buffer)\n end",
"d... | [
"0.6938378",
"0.61244476",
"0.6118106",
"0.6033118",
"0.59731823",
"0.59707123",
"0.5948938",
"0.5936985",
"0.59124607",
"0.59021825",
"0.5850087",
"0.57991654",
"0.5795517",
"0.5773557",
"0.57499325",
"0.57006276",
"0.56937194",
"0.5660892",
"0.5567804",
"0.55502063",
"0.551... | 0.6559788 | 1 |
Outputs formatted RI data for class +name+. Groups undocumented classes | def display_class name
return if name =~ /#|\./
found, klasses, includes, extends =
classes_and_includes_and_extends_for name
return if found.empty?
out = class_document name, found, klasses, includes, extends
display out
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_class name\n return if name =~ /#|\\./\n\n found, klasses, includes, extends =\n classes_and_includes_and_extends_for name\n\n context = klasses.reverse.inject do |merged, k|\n merged.merge k\n end\n\n return if found.empty?\n\n out = class_document name, found, klasses, inc... | [
"0.6527846",
"0.61375225",
"0.6108157",
"0.6054026",
"0.60271895",
"0.5937995",
"0.5889655",
"0.57674617",
"0.5717051",
"0.56389844",
"0.56235343",
"0.55773276",
"0.5570585",
"0.5561109",
"0.55538386",
"0.55092895",
"0.55092895",
"0.5478726",
"0.5475212",
"0.5466165",
"0.5440... | 0.6671205 | 0 |
Outputs formatted RI data for method +name+ | def display_method name
out = RDoc::Markup::Document.new
add_method out, name
display out
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_method name\n found = load_methods_matching name\n raise NotFoundError, name if found.empty?\n filtered = filter_methods found, name\n out = RDoc::Markup::Document.new\n out << RDoc::Markup::Heading.new(1, name)\n out << RDoc::Markup::BlankLine.new\n filtered.each do |store, method... | [
"0.6954558",
"0.66272235",
"0.65950865",
"0.6206605",
"0.6168169",
"0.615016",
"0.6131373",
"0.61047035",
"0.6070864",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.60290587",
"0.... | 0.7039684 | 0 |
Outputs formatted RI data for the class or method +name+. Returns true if +name+ was found, false if it was not an alternative could be guessed, raises an error if +name+ couldn't be guessed. | def display_name name
if name =~ /\w:(\w|$)/ then
display_page name
return true
end
return true if display_class name
display_method name if name =~ /::|#|\./
true
rescue NotFoundError
matches = list_methods_matching name if name =~ /::|#|\./
matches = classes.keys.grep(/^#{... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_name name\n return if display_class name\n\n display_method name if name =~ /::|#|\\./\n\n true\n rescue NotFoundError\n @message.error \"#{name} not found\"\n end",
"def display_name name\n return true if display_class name\n if name =~ /::|#|\\./\n display_method name \n ... | [
"0.6229415",
"0.61003786",
"0.5575338",
"0.54054946",
"0.53143775",
"0.5274883",
"0.5259375",
"0.51909846",
"0.5162049",
"0.50495374",
"0.50429505",
"0.50131804",
"0.50065523",
"0.4995836",
"0.49872917",
"0.49684647",
"0.4966155",
"0.49507624",
"0.49362105",
"0.49241826",
"0.... | 0.64021254 | 0 |
Displays each name in +name+ | def display_names names
names.each do |name|
name = expand_name name
display_name name
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_name\n\t\tname = 'Myname'\n\t\ti = 0\n\t\t#zolang i kleiner is dan 10:\n\t\twhile i < 10\n\t\t\t#print naam en verhoog i met 1\n\t\t\tputs name\n\t\t\ti= i + 1\n\t\tend\n\tend",
"def display\n\t\tname\n\tend",
"def display\n\t\tname\n\tend",
"def display\n\t\tname\n\tend",
"def display\n\t\tname\... | [
"0.7373189",
"0.71449256",
"0.71449256",
"0.71449256",
"0.71449256",
"0.70438653",
"0.6979172",
"0.69328177",
"0.68172866",
"0.66702604",
"0.6651836",
"0.66351783",
"0.66033924",
"0.6562582",
"0.65612763",
"0.6555375",
"0.65402627",
"0.65265834",
"0.6515393",
"0.64087534",
"0... | 0.80034935 | 0 |
Outputs formatted RI data for page +name+. | def display_page name
store_name, page_name = name.split ':', 2
store = @stores.find { |s| s.source == store_name }
return display_page_list store if page_name.empty?
pages = store.cache[:pages]
unless pages.include? page_name then
found_names = pages.select do |n|
n =~ /#{Regexp.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(name)\n render_rhtml [\"#{name}.rhtml\"]\n return \"\"\n end",
"def output(name, data, undoc = nil)\n @total += data if data.is_a?(Integer) && undoc\n @undocumented += undoc if undoc.is_a?(Integer)\n data =\n if undoc\n (\"%5s (% 5d undocumented)\" %... | [
"0.6129578",
"0.60337883",
"0.5947757",
"0.5839221",
"0.5805289",
"0.56661904",
"0.5586387",
"0.54859334",
"0.54718834",
"0.54558516",
"0.54358935",
"0.5414462",
"0.5401373",
"0.5390232",
"0.53816193",
"0.53812176",
"0.537512",
"0.5364288",
"0.5345066",
"0.5339703",
"0.533131... | 0.0 | -1 |
Outputs a formatted RI page list for the pages in +store+. | def display_page_list store, pages = store.cache[:pages], search = nil
out = RDoc::Markup::Document.new
title = if search then
"#{search} pages"
else
'Pages'
end
out << RDoc::Markup::Heading.new(1, "#{title} in #{store.friendly_path}")
out << RDoc::M... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_all\n init_ivars\n uri_list = @pages.map { |page| page.uri }\n\n uri_list.empty? ? ',' : uri_list.join(',')\n end",
"def list\n\t@storecunsumptions = Storecunsumption.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\tformat.html \n\t\tformat.xml { render :x... | [
"0.5910991",
"0.579206",
"0.56706864",
"0.564637",
"0.553158",
"0.5526174",
"0.5518882",
"0.5509322",
"0.55080765",
"0.54799104",
"0.547776",
"0.54585904",
"0.54406655",
"0.54134095",
"0.54090935",
"0.5386857",
"0.5346142",
"0.53439605",
"0.5328709",
"0.5313524",
"0.53100073"... | 0.69862986 | 0 |
Expands the class portion of +name+ into a fullyqualified class. See expand_class. | def expand_name name
klass, selector, method = parse_name name
return [selector, method].join if klass.empty?
case selector
when ':' then
[find_store(klass), selector, method]
else
[expand_class(klass), selector, method]
end.join
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_class(name)\n name.split(/::/).inject(Object) { |p, n| p.const_get(n) } \n end",
"def append_class(name); end",
"def append_class(name); end",
"def add_class(name); end",
"def add_class(name); end",
"def class_for_name qualified_name\n raise unless ::Class === (resolved = ::Object.con... | [
"0.68846554",
"0.6733241",
"0.6733241",
"0.65355086",
"0.65355086",
"0.63342714",
"0.6247901",
"0.6221724",
"0.6221724",
"0.62178",
"0.6201857",
"0.6197605",
"0.6161493",
"0.61595565",
"0.6140592",
"0.6112743",
"0.60566205",
"0.6020603",
"0.5995614",
"0.5988033",
"0.5948074",... | 0.6194803 | 12 |
Filters the methods in +found+ trying to find a match for +name+. | def filter_methods found, name
regexp = name_regexp name
filtered = found.find_all do |store, methods|
methods.any? { |method| method.full_name =~ regexp }
end
return filtered unless filtered.empty?
found
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_methods found, name\n regexp = name_regexp name\n filtered = found.find_all do |store, methods|\n methods.any? { |method| method.full_name =~ regexp }\n end\n return filtered unless filtered.empty?\n found\n end",
"def lookup_method name\n found = load_methods_matching name\n\n... | [
"0.78533304",
"0.6774869",
"0.64452124",
"0.6432464",
"0.6295722",
"0.6257094",
"0.6254216",
"0.6240745",
"0.6127673",
"0.61137",
"0.6009451",
"0.6009451",
"0.6007337",
"0.5951514",
"0.59201777",
"0.59151334",
"0.5867356",
"0.58153313",
"0.5811365",
"0.5734013",
"0.571157",
... | 0.79419714 | 0 |
Yields items matching +name+ including the store they were found in, the class being searched for, the class they were found in (an ancestor) the types of methods to look up (from method_type), and the method name being searched for | def find_methods name
klass, selector, method = parse_name name
types = method_type selector
klasses = nil
ambiguous = klass.empty?
if ambiguous then
klasses = classes.keys
else
klasses = ancestors_of klass
klasses.unshift klass
end
methods = []
klasses.each do... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_methods name\n klass, selector, method = parse_name name\n types = method_type selector\n klasses = nil\n ambiguous = klass.empty?\n if ambiguous then\n klasses = classes.keys\n else\n klasses = ancestors_of klass\n klasses.unshift klass\n end\n methods = []\n kla... | [
"0.7484951",
"0.6760043",
"0.67395914",
"0.6688391",
"0.64259684",
"0.6115898",
"0.6013061",
"0.6003447",
"0.5735614",
"0.56978714",
"0.5657348",
"0.56424683",
"0.56262475",
"0.5606447",
"0.55650735",
"0.5453971",
"0.5448042",
"0.5403336",
"0.5359857",
"0.5359103",
"0.5346703... | 0.7438284 | 1 |
Finds the given +pager+ for jruby. Returns an IO if +pager+ was found. Returns false if +pager+ does not exist. Returns nil if the jruby JVM doesn't support ProcessBuilder redirection (1.6 and older). | def find_pager_jruby pager
require 'java'
require 'shellwords'
return nil unless java.lang.ProcessBuilder.constants.include? :Redirect
pager = Shellwords.split pager
pb = java.lang.ProcessBuilder.new(*pager)
pb = pb.redirect_output java.lang.ProcessBuilder::Redirect::INHERIT
@jruby_pager... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_pager\n return if @use_stdout\n\n jruby = RUBY_ENGINE == 'jruby'\n\n pagers = [ENV['RI_PAGER'], ENV['PAGER'], 'pager', 'less', 'more']\n\n pagers.compact.uniq.each do |pager|\n next unless pager\n\n pager_cmd = pager.split(' ').first\n\n next unless in_path? pager_cmd\n\n ... | [
"0.72065467",
"0.6075037",
"0.6016141",
"0.5917901",
"0.5222157",
"0.5178376",
"0.50696355",
"0.49939847",
"0.49848828",
"0.49533263",
"0.48315182",
"0.4801896",
"0.47878656",
"0.47512007",
"0.46339762",
"0.45800504",
"0.45136124",
"0.4500651",
"0.44758618",
"0.44430065",
"0.... | 0.8260045 | 0 |
Finds a store that matches +name+ which can be the name of a gem, "ruby", "home" or "site". See also RDoc::Storesource | def find_store name
@stores.each do |store|
source = store.source
return source if source == name
return source if
store.type == :gem and source =~ /^#{Regexp.escape name}-\d/
end
raise RDoc::RI::Driver::NotFoundError, name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lookup_store (store_name)\n each_store do |regex, name, store|\n return store if regex.match store_name\n end\n nil\n end",
"def get_store (store_name)\n each_store do |regex, s_name, store|\n return store if s_name == store_name\n end\n nil\n end",
"def fi... | [
"0.7261076",
"0.72075164",
"0.65297616",
"0.63859236",
"0.6372048",
"0.636834",
"0.6183006",
"0.60895056",
"0.6031126",
"0.6001962",
"0.59912425",
"0.59470797",
"0.58620614",
"0.5851574",
"0.58447134",
"0.5805792",
"0.5805717",
"0.57998055",
"0.5781565",
"0.57580084",
"0.5709... | 0.82268745 | 0 |
Creates a new RDoc::Markup::Formatter. If a formatter is given with f, use it. If we're outputting to a pager, use bs, otherwise ansi. | def formatter(io)
if @formatter_klass then
@formatter_klass.new
elsif paging? or !io.tty? then
RDoc::Markup::ToBs.new
else
RDoc::Markup::ToAnsi.new
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_formatter(params)\n # parameters disabled by default\n inline = as_boolean params.fetch(:inline, false)\n line_numbers = as_boolean params.fetch(:line_numbers, false)\n\n # parameters enabled by default\n wrapped = as_boolean params.fetch(:wrap, true)\n line_table = as_boolean ... | [
"0.5747265",
"0.5539976",
"0.5498361",
"0.54905146",
"0.54528",
"0.54224575",
"0.54193026",
"0.5415165",
"0.53432566",
"0.5294786",
"0.52779114",
"0.5274366",
"0.52304065",
"0.52229387",
"0.52024317",
"0.5183765",
"0.51697123",
"0.5124223",
"0.5124223",
"0.50888366",
"0.50843... | 0.6363081 | 0 |
Runs ri interactively using Readline if it is available. | def interactive
puts "\nEnter the method name you want to look up."
if defined? Readline then
Readline.completion_proc = method :complete
puts "You can use tab to autocomplete."
end
puts "Enter a blank line to exit.\n\n"
loop do
name = if defined? Readline then
Re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def console\n repo = Repo.new\n repo.attach\n\n unless repo.has_repository?\n abort \"Cannot launch console: ripe repo not initialized\"\n end\n\n # Do not send arguments to the REPL\n ARGV.clear\n\n Ripl.config[:prompt] = proc do\n # This is the only place I could ... | [
"0.6527841",
"0.649022",
"0.64631146",
"0.63540035",
"0.6332323",
"0.62646395",
"0.6068642",
"0.6009574",
"0.588771",
"0.5887263",
"0.58835423",
"0.5867123",
"0.5793631",
"0.57855815",
"0.5766979",
"0.5762358",
"0.5749137",
"0.5738095",
"0.57182735",
"0.56648564",
"0.56639284... | 0.5743974 | 17 |
Is +file+ in ENV['PATH']? | def in_path? file
return true if file =~ %r%\A/% and File.exist? file
ENV['PATH'].split(File::PATH_SEPARATOR).any? do |path|
File.exist? File.join(path, file)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command_in_path?(command)\n found = ENV['PATH'].split(File::PATH_SEPARATOR).map do |p|\n File.exist?(File.join(p, command))\n end\n found.include?(true)\n end",
"def command_in_path?(command)\n found = ENV['PATH'].split(File::PATH_SEPARATOR).map do |p|\n File.exist?(File.... | [
"0.776053",
"0.776053",
"0.7652267",
"0.7649931",
"0.73581797",
"0.72746855",
"0.7203009",
"0.71346295",
"0.7117725",
"0.7076537",
"0.70578825",
"0.7013267",
"0.7004939",
"0.69985205",
"0.6993523",
"0.6992925",
"0.69722486",
"0.69616973",
"0.6937823",
"0.6909624",
"0.6869433"... | 0.75806177 | 4 |
Lists classes known to ri starting with +names+. If +names+ is empty all known classes are shown. | def list_known_classes names = []
classes = []
stores.each do |store|
classes << store.module_names
end
classes = classes.flatten.uniq.sort
unless names.empty? then
filter = Regexp.union names.map { |name| /^#{name}/ }
classes = classes.grep filter
end
page do |io|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_known_classes names = []\n classes = []\n stores.each do |store|\n classes << store.modules\n end\n classes = classes.flatten.uniq.sort\n unless names.empty? then\n filter = Regexp.union names.map { |name| /^#{name}/ }\n classes = classes.grep filter\n end\n puts classe... | [
"0.74043274",
"0.6286097",
"0.6188171",
"0.60888886",
"0.60871065",
"0.60641664",
"0.5936978",
"0.58895177",
"0.5828732",
"0.57561815",
"0.57272494",
"0.55442274",
"0.55402446",
"0.5513819",
"0.5458816",
"0.5396759",
"0.5376558",
"0.5375049",
"0.53735626",
"0.5349403",
"0.533... | 0.77926373 | 0 |
Returns an Array of methods matching +name+ | def list_methods_matching name
found = []
find_methods name do |store, klass, ancestor, types, method|
if types == :instance or types == :both then
methods = store.instance_methods[ancestor]
if methods then
matches = methods.grep(/^#{Regexp.escape method.to_s}/)
matc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n methods = []\n\n methods << load_method(store, :class_methods, ancestor, '::', method) if\n [:class, :both].include? types\n\n methods << load_method(store, :instance_methods,... | [
"0.72455037",
"0.7190654",
"0.70327973",
"0.6982808",
"0.68827385",
"0.6853408",
"0.6815224",
"0.68122673",
"0.67798024",
"0.6733137",
"0.6686035",
"0.66760504",
"0.6601874",
"0.6469976",
"0.6430577",
"0.6419469",
"0.64167833",
"0.6415226",
"0.63233894",
"0.6314158",
"0.62947... | 0.75469977 | 0 |
Loads RI data for method +name+ on +klass+ from +store+. +type+ and +cache+ indicate if it is a class or instance method. | def load_method store, cache, klass, type, name
methods = store.public_send(cache)[klass]
return unless methods
method = methods.find do |method_name|
method_name == name
end
return unless method
store.load_method klass, "#{type}#{method}"
rescue RDoc::Store::MissingFileError => e
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_method store, cache, klass, type, name\n methods = store.send(cache)[klass]\n return unless methods\n method = methods.find do |method_name|\n method_name == name\n end\n return unless method\n store.load_method klass, \"#{type}#{method}\"\n end",
"def create_cache_for(klassname,... | [
"0.7909577",
"0.5927697",
"0.5846796",
"0.5560211",
"0.54752004",
"0.5434406",
"0.5430336",
"0.5341136",
"0.5328056",
"0.530494",
"0.52935976",
"0.5212285",
"0.5178825",
"0.51758826",
"0.51109415",
"0.5109263",
"0.50828975",
"0.50773835",
"0.5066294",
"0.5063085",
"0.5012108"... | 0.718096 | 1 |
Returns an Array of RI data for methods matching +name+ | def load_methods_matching name
found = []
find_methods name do |store, klass, ancestor, types, method|
methods = []
methods << load_method(store, :class_methods, ancestor, '::', method) if
[:class, :both].include? types
methods << load_method(store, :instance_methods, ancestor, '#'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def methods(name = nil)\n NodeCache.find_children_of_type(self, \"Method\", name)\n end",
"def get_all(name=nil)\n if name.class == String && !block_given?\n return @j_del.java_method(:getAll, [Java::java.lang.String.java_class]).call(name).to_a.map { |elt| elt }\n end\n raise Argum... | [
"0.61329806",
"0.61008155",
"0.5983723",
"0.597209",
"0.59477174",
"0.59192675",
"0.585655",
"0.58549225",
"0.58101815",
"0.58050805",
"0.5755047",
"0.57048774",
"0.56329966",
"0.5624619",
"0.5511794",
"0.54921395",
"0.54757416",
"0.54706377",
"0.54677206",
"0.5451575",
"0.54... | 0.60064614 | 2 |
Returns a filtered list of methods matching +name+ | def lookup_method name
found = load_methods_matching name
if found.empty?
if check_did_you_mean
methods = []
_, _, method_name = parse_name name
find_methods name do |store, klass, ancestor, types, method|
methods.push(*store.class_methods[klass]) if [:class, :both].incl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_methods found, name\n regexp = name_regexp name\n\n filtered = found.find_all do |store, methods|\n methods.any? { |method| method.full_name =~ regexp }\n end\n\n return filtered unless filtered.empty?\n\n found\n end",
"def filter_methods found, name\n regexp = name_regexp nam... | [
"0.78670895",
"0.7825226",
"0.7539995",
"0.71527547",
"0.6862953",
"0.6724734",
"0.6667421",
"0.6514775",
"0.64948833",
"0.64848346",
"0.64383876",
"0.6186708",
"0.6135536",
"0.607636",
"0.60069627",
"0.60030246",
"0.59657484",
"0.5954727",
"0.5903799",
"0.58664703",
"0.58143... | 0.50373876 | 89 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.