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 |
|---|---|---|---|---|---|---|
Renders a complete HTML page for this object. | def render aOpts = {}
aOpts[:@target] = self
aOpts[:@title] = self.name
aOpts[:@content] = self.to_html(aOpts)
html = HTML_TEMPLATE.render_with(aOpts)
# make implicit relative paths into explicit ones
pathPrefix = '../' * self.url.scan(%r{/+}).length
html.gsub! %r{((?... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page\n html = String.new\n html << (model.page_header_for(type, request) || tabs)\n html << \"<div id='autoforme_content' data-url='#{url_for('')}'>\"\n html << yield.to_s\n html << \"</div>\"\n html << model.page_footer_for(type, request).to_s\n html\n end",
"def to_htm... | [
"0.7032891",
"0.6754103",
"0.67254204",
"0.6688118",
"0.6685251",
"0.66423446",
"0.6598444",
"0.6582221",
"0.65744126",
"0.65741116",
"0.65034187",
"0.64932376",
"0.649037",
"0.6486485",
"0.6486485",
"0.64531016",
"0.6443213",
"0.6440096",
"0.6430135",
"0.6422723",
"0.6392961... | 0.0 | -1 |
Returns a relative link to this object, customized by the following options: frag:: a URI fragment that is appended to the URL, if given. body:: sets the body of the link (the tag), if given. nbsp:: makes spaces in the link body nonbreaking, if true. | def to_link aOpts = {}
frag = aOpts[:frag]
frag = frag.uri_fragment if frag.respond_to? :uri_fragment
addr = [self.url, frag].compact.join('#')
body = aOpts[:body] || self.name
body = body.gsub(/\s/, ' ') if aOpts[:nbsp]
body = body.to_inline_html
# reveal default link ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def link_to(title, path, opts={}, base=true)\n unless is_uri?(path) || base == false\n path = url(path)\n end\n \n return \"<a href=\\\"#{path}\\\"#{parse_options(opts)}>#{title}</a>\"\n end",
"def as_href(from_path)\n RDoc::Markup::ToHtml.gen_relative_url from_path, ... | [
"0.67150044",
"0.66196656",
"0.65344733",
"0.65138835",
"0.64153844",
"0.64016205",
"0.6229087",
"0.6220589",
"0.6214146",
"0.61833304",
"0.612483",
"0.6112902",
"0.6077375",
"0.60613364",
"0.6026358",
"0.6024957",
"0.59929514",
"0.5967031",
"0.5966457",
"0.5962949",
"0.59612... | 0.73770285 | 0 |
aData:: the content of this Entry | def initialize aData = {}
merge! aData
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data\n @datas\n end",
"def data\n @content\n end",
"def data\r\n @data\r\n end",
"def entries\n data[:entries]\n end",
"def data\n attributes.fetch(:data)\n end",
"def data\n attributes.fetch(:data)\n end",
"def data\... | [
"0.60987496",
"0.6087521",
"0.6042918",
"0.6004307",
"0.5980786",
"0.5980786",
"0.59670264",
"0.59135944",
"0.5889066",
"0.5889066",
"0.5889066",
"0.58889586",
"0.5859061",
"0.5859061",
"0.5859061",
"0.5859061",
"0.5859061",
"0.5859061",
"0.5859061",
"0.5859061",
"0.5859061",... | 0.0 | -1 |
Returns true if this entry is hidden (the 'hide' parameter is enabled). | def hide?
@hide
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hidden?\n false\n end",
"def hidden?\n false\n end",
"def hidden?()\n not visible?()\n end",
"def hidden?\n not visible\n end",
"def hidden?\n false\n end",
"def hidden?\n return @hidden\n end",
"def is_hidden?\n\t\tself.hidden... | [
"0.8128223",
"0.8128223",
"0.81122494",
"0.8080155",
"0.80765045",
"0.80419064",
"0.79977065",
"0.78952694",
"0.7819306",
"0.7773102",
"0.7755385",
"0.7662032",
"0.7662032",
"0.7662032",
"0.7594619",
"0.7575715",
"0.748913",
"0.7475273",
"0.7286034",
"0.7286034",
"0.7247009",... | 0.8189853 | 0 |
Returns the summarized HTML content of this blog entry. If there is no summary or summarization is not possible, then returns nil. | def summary
if key? 'summary'
self['summary'].to_s.thru_erb.to_html
else
case html.gsub(%r{<(h\d).*?>.*?</\1>}m, '') # omit headings from summary
# the first HTML block-level element
when %r{\A\s*<(\w+).*?>.*?</\1>}m
$&
# the first paragraph (a run of text... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def summary\n content, id = self.get_page_content\n line_limit = self.context['site']['config']['posts']['summary_lines'].to_i rescue nil\n line_limit ||= 20\n line_count = 0\n line_breakpoint = content.lines.count\n\n content.lines.each_with_index do |line, i|\n ... | [
"0.70626473",
"0.69070625",
"0.6866548",
"0.6731288",
"0.6731288",
"0.6704314",
"0.6623285",
"0.6585572",
"0.64795864",
"0.64443374",
"0.6427546",
"0.6346211",
"0.6176787",
"0.6176787",
"0.6176787",
"0.61453474",
"0.61277324",
"0.61277324",
"0.61232316",
"0.6063969",
"0.60145... | 0.7060174 | 1 |
Returns the absolute URL to this entry. | def absolute_url
File.join(BLOG.url, url)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def absolute_url(href)\n Addressable::URI.join(self.class::DOMAIN, href).to_s\n end",
"def url\n @url.to_s\n end",
"def absolute_url\n\t\treturn \"#{$domain}/#{self.photo.url}\"\n\tend",
"def absolute_url\n domain + path\n end",
"def absolute_url\n return unless fileable?\n Ra... | [
"0.73445904",
"0.7221648",
"0.7197374",
"0.7174187",
"0.71399057",
"0.71200895",
"0.7012464",
"0.7010453",
"0.7010453",
"0.70035064",
"0.696055",
"0.6949142",
"0.6941262",
"0.6920379",
"0.69105023",
"0.6896042",
"0.68562967",
"0.68538576",
"0.6834113",
"0.6816076",
"0.6812467... | 0.7521121 | 0 |
Transforms the content of this entry into HTML and returns it. | def html
@html ||= Template.new("#{@input_file}:body", @body).
render_with(template_ivar => self).to_html
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n Utils::Escape.html(@content)\n end",
"def transform\n renderer.convert(content)\n end",
"def formatted_content\n formatted_content = public_content\n return formatted_content unless formatted_content\n\n # formatted_content = formatted_content.gsub(/<img (.*?)\\/?>/i... | [
"0.71492773",
"0.7060133",
"0.69303495",
"0.6833068",
"0.67131025",
"0.6705636",
"0.67040765",
"0.66787297",
"0.6676079",
"0.66388303",
"0.66194123",
"0.66194123",
"0.66127586",
"0.65937006",
"0.6569643",
"0.652173",
"0.6514927",
"0.6480545",
"0.64507383",
"0.6413161",
"0.641... | 0.0 | -1 |
Returns a URL for submiting comments about this entry. | def comment_url
BLOG.email.to_url(name, File.join(BLOG.url, url))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url\n new? ? '#' : post.url + \"#comment-#{id}\"\n end",
"def commentable_url(comment)\n url_for(comment.commentable)\n end",
"def comments_url\n configatron.urls.hacker_news_item + reference_number if reference_number\n end",
"def get_comment_url(tds)\n COMMENT_URL_PREFIX + CGI::escape(... | [
"0.6965854",
"0.68191916",
"0.6613297",
"0.63603663",
"0.63603663",
"0.6359051",
"0.6359051",
"0.6070193",
"0.60611886",
"0.593107",
"0.59192544",
"0.5881285",
"0.5874752",
"0.58402634",
"0.5830295",
"0.58168924",
"0.5812645",
"0.57961065",
"0.5763021",
"0.57521343",
"0.56947... | 0.73299193 | 0 |
Path (relative to the output/ directory) to the HTML output file of this object. | def url
make_file_name('html', @chapter.name, name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output_path; end",
"def output_path\n File.join(Musako.destination_path, @url)\n end",
"def output_path\n settings[:output]\n end",
"def out_path\n @out_path ||= File.join out_base, node.file_name\n end",
"def output_dir(options = {})\n options[:dir] = \"generate\"\n ... | [
"0.7647411",
"0.75455",
"0.75042796",
"0.7099642",
"0.7022668",
"0.69529396",
"0.69134957",
"0.69116294",
"0.68253106",
"0.68032867",
"0.6714963",
"0.6654575",
"0.6627577",
"0.65837014",
"0.6567232",
"0.6566964",
"0.6564289",
"0.6532504",
"0.6484634",
"0.6484634",
"0.6443532"... | 0.59860307 | 64 |
Allows you to access a section using its name or through the usual Ruby array access idioms. | def [] aName, *args
if aName.is_a? Integer or aName.is_a? Range
super(aName, *args)
else
@cache[aName.to_s]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def section_by_name(section_name); end",
"def section(name)\n self[section_index(name)]\n end",
"def [](name)\n name = name.to_s\n each_section do |section|\n return section if section.name == name\n end\n nil\n end",
"def section(name)\n sections.find { |... | [
"0.8300014",
"0.82554847",
"0.7977276",
"0.79042685",
"0.7794681",
"0.7501374",
"0.7484658",
"0.7408344",
"0.7398622",
"0.7331318",
"0.72645015",
"0.7202366",
"0.7141856",
"0.6810438",
"0.6808517",
"0.6800714",
"0.6796315",
"0.6766354",
"0.67398787",
"0.6710538",
"0.66910815"... | 0.0 | -1 |
hooks up the given entry with the given section (by name) and chapter. then returns the section object. | def hookup aEntry, aSectionByName, aName, aChapter #:nodoc:
unless s = aSectionByName[aName]
s = Section.new(aName, aChapter)
aChapter << s
aSectionByName[aName] = s
end
s << aEntry
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_section(section_name, doc)\n entries = doc.xpath(@sections[section_name])\n if(entries.size == 0)\n return\n end\n @ccr_hash[section_name] = []\n entries.each do | e |\n entry = QME::Importer::Entry.new\n process_codes(e, entry)\n @ccr_hash[section_n... | [
"0.61740285",
"0.6052792",
"0.5947567",
"0.56710434",
"0.5547477",
"0.55169666",
"0.5494493",
"0.54833204",
"0.54223883",
"0.5370371",
"0.5342831",
"0.5330277",
"0.53115374",
"0.52972937",
"0.52855873",
"0.5246582",
"0.52108",
"0.51923347",
"0.51730806",
"0.51723754",
"0.5141... | 0.7275658 | 0 |
Retrieve the user from the DB using the perishable token if still valid | def load_user_using_perishable_token
@user = User.find_using_perishable_token(params[:id])
unless @user
@bad_perishable_token = true
render :action => :new and return
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_user_from_auth_token\n @user = decode_auth_token ? User.find(decode_auth_token['user_id']) : nil\n errors.add(:token, 'invalid token') if @user.nil?\n @user\n end",
"def get_user_by_token(token)\n decoded = JWT.decode(token, 'somesecrethere')\n now = Time.now().to_i\n\n if (decoded[0... | [
"0.8195115",
"0.7756078",
"0.7739607",
"0.772572",
"0.7689871",
"0.7647125",
"0.76449734",
"0.7563019",
"0.7443056",
"0.73916954",
"0.73639876",
"0.73639876",
"0.7285197",
"0.7222364",
"0.7214749",
"0.7178927",
"0.7178308",
"0.7141023",
"0.71152973",
"0.70714337",
"0.7062535"... | 0.77492684 | 2 |
Returns the version of the IP packet. | def version
self[:ip_vhl] >> 4
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version; PACKET_VERSION; end",
"def ip_version\n cidr.version\n end",
"def protocol_version\n @protocol_version\n end",
"def version\n network(hex: true) + 1\n end",
"def server_version\n check_connection\n @protocol.server_version\n end",
"def version\n se... | [
"0.7466745",
"0.7433202",
"0.67581993",
"0.6559274",
"0.6502995",
"0.64158815",
"0.6414415",
"0.6362477",
"0.6325559",
"0.62454474",
"0.6197025",
"0.6183531",
"0.6169209",
"0.61671567",
"0.61562294",
"0.61562294",
"0.61562294",
"0.61562294",
"0.61562294",
"0.61562294",
"0.615... | 0.7892621 | 0 |
Returns the header length of the packet. | def header_length
self[:ip_vhl] & 0x0f
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def header_len\n (@binhdr[12, 1].unpack(\"C\").pop >> 4) << 2\n end",
"def header_size(header)\n header.unpack(\"N\").first\n end",
"def len_header\n return @len_header unless @len_header.nil?\n _pos = @_io.pos\n @_io.seek(88)\n @len_header = @_io.read_u8le\n @_io.seek(_pos)\... | [
"0.843737",
"0.7956628",
"0.78552645",
"0.727887",
"0.7197506",
"0.7196826",
"0.71602297",
"0.7089711",
"0.7024282",
"0.6911056",
"0.68696195",
"0.6829105",
"0.6685639",
"0.66786116",
"0.6620939",
"0.66098994",
"0.6608129",
"0.66039675",
"0.6460643",
"0.6450679",
"0.6435383",... | 0.8088883 | 1 |
Returns the Type of Service (TOS). | def tos
self[:ip_tos]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _service_type\n self.class.service_type\n end",
"def service_type\n return nil unless self.service_type_id \n ServiceType.find(self.service_type_id)\n end",
"def service_types\n get_info :service_types\n end",
"def get_service_types\n if @servicetypes.any?\n @servicetyp... | [
"0.73146904",
"0.6793604",
"0.63220793",
"0.6254808",
"0.6161524",
"0.5967197",
"0.5924514",
"0.5827057",
"0.57560194",
"0.5697586",
"0.5647948",
"0.5633168",
"0.555135",
"0.5546655",
"0.55315435",
"0.551994",
"0.55070883",
"0.54921025",
"0.54693866",
"0.5467438",
"0.54660535... | 0.5668198 | 10 |
Returns the total packet length. | def packet_length
self[:ip_len]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def length\n Integer(connection.write(\"get_length\", false))\n rescue ArgumentError\n 0\n end",
"def length\n Integer(connection.write(\"get_length\", false))\n rescue ArgumentError\n 0\n end",
"def length\n Integer(connection.write(\"get_length\", false)... | [
"0.7104928",
"0.7104928",
"0.7104928",
"0.7062208",
"0.7057497",
"0.7046883",
"0.7046883",
"0.7031468",
"0.68578047",
"0.6836138",
"0.6802079",
"0.6748433",
"0.6660093",
"0.66273385",
"0.65870744",
"0.65693796",
"0.654495",
"0.6514624",
"0.6502621",
"0.6502291",
"0.6498278",
... | 0.78762454 | 0 |
Returns the packet id. | def id
self[:ip_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_packet_id\n self.class.current_id ||= 0\n self.class.current_id += 1\n end",
"def type_id\n index = MQTT::PACKET_TYPES.index(self.class)\n raise \"Invalid packet type: #{self.class}\" if index.nil?\n index\n end",
"def get_id()\n return @id\n end"... | [
"0.69963694",
"0.6779125",
"0.6275571",
"0.6261485",
"0.62468344",
"0.6169109",
"0.6166459",
"0.60912645",
"0.6040961",
"0.6014464",
"0.6013426",
"0.60022557",
"0.5967078",
"0.5967078",
"0.5967078",
"0.5967078",
"0.59268445",
"0.5919175",
"0.59151685",
"0.5905992",
"0.587299"... | 0.61334074 | 7 |
Returns the fragment offset. | def offset
self[:ip_off]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def offset\n (current_page * size) - size\n end",
"def view_offset\n @position + @view.position\n end",
"def get_offset\n @offset\n end",
"def offset\n\t\t\t@position + @offset\n\t\tend",
"def offset()\n @offset__\n end",
"def b_offset\n @last_4[1].to_i\n end",
"def offs... | [
"0.6750892",
"0.6685029",
"0.6626424",
"0.65203136",
"0.6491382",
"0.64660406",
"0.6355801",
"0.62819606",
"0.6263783",
"0.6246135",
"0.61330456",
"0.60973036",
"0.6067644",
"0.6059009",
"0.59862524",
"0.5983053",
"0.5971651",
"0.5940839",
"0.59068966",
"0.5850204",
"0.585020... | 0.607162 | 12 |
Returns the Time to Live (TTL). | def ttl
self[:ip_ttl]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lease_time\n return (0.667 * @ttl).to_i\n end",
"def get_ttl\n return @resource[:ttl]\n end",
"def ttl_duration\n 900\n end",
"def ttl()\n Store.db.ttl(db_id)\n end",
"def ttl\n max_age - age if max_age\n end",
"def ttl_in_seconds= value\n ... | [
"0.7524484",
"0.74343556",
"0.73954004",
"0.7076636",
"0.70459",
"0.6798415",
"0.67959905",
"0.67437696",
"0.6703817",
"0.6671881",
"0.66232556",
"0.66232556",
"0.66232556",
"0.6610697",
"0.658446",
"0.6569385",
"0.6546242",
"0.65368164",
"0.6526515",
"0.6494644",
"0.6426076"... | 0.7623927 | 0 |
Returns the protocol number. | def protocol
self[:ip_p]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def protocol\n v = @head.fetch[1]\n raise \"Invalid protocol version name '#{v}'\" unless v =~ /^[0-9]+$/\n v.to_i\n end",
"def protocol\n response = get(:protocol)\n version = response.body\n version.to_i rescue 0\n end",
"def protocol\n @protocol ||= @raw_protocol[0..-4... | [
"0.8701184",
"0.81744933",
"0.75765765",
"0.74599093",
"0.7416444",
"0.7365382",
"0.69894916",
"0.68934155",
"0.6751485",
"0.6636093",
"0.6488503",
"0.64474225",
"0.6422019",
"0.64109266",
"0.63959086",
"0.6394856",
"0.61540544",
"0.6089193",
"0.60580635",
"0.60509014",
"0.60... | 0.6832018 | 8 |
Returns the packet checksum. | def checksum
self[:ip_sum]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checksum\n fil_header[:checksum]\n end",
"def calc_checksum\n # Checksum is only on header, so cannot use IP.sum16,\n # which also calculates checksum on #body.\n nb_words = ihl * 2\n self.checksum = 0\n checksum = to_s.unpack(\"n#{nb_words}\").sum\n self[:checks... | [
"0.74478585",
"0.708985",
"0.7017423",
"0.69719434",
"0.6909507",
"0.6884917",
"0.6874795",
"0.6818083",
"0.6816681",
"0.6816681",
"0.6757945",
"0.6740782",
"0.666603",
"0.6610971",
"0.6609844",
"0.65967673",
"0.65922344",
"0.65714186",
"0.64307666",
"0.6426133",
"0.63941324"... | 0.707706 | 2 |
Returns the source IP address. | def src
self[:ip_src]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def packet_source_addr\n return nil if !@packet_source_addr_bin\n @packet_source_addr_bin.unpack('C4').join('.')\n end",
"def src_ip\n self[:sender_ip]\n end",
"def get_ip_address\n request.remote_ip\n end",
"def ipsource\n lanconfig[\"ip address source\"].downcase!\n ... | [
"0.7475449",
"0.7419558",
"0.736925",
"0.73490864",
"0.7231043",
"0.7221045",
"0.7216424",
"0.7213811",
"0.70979404",
"0.70760995",
"0.7054092",
"0.7054092",
"0.7054092",
"0.7054092",
"0.7054092",
"0.7054092",
"0.7042318",
"0.70391107",
"0.7016455",
"0.7015094",
"0.7008086",
... | 0.73954403 | 2 |
Returns the destination IP address. | def dest
self[:ip_dest]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dest_ip\n self[:dest_ip]\n end",
"def arp_dest_ip; self[:arp_dest_ip].to_s; end",
"def remote_ip\n get_peername[2,6].unpack('nC4')[1..4].join('.')\n end",
"def get_ip_address\n request.remote_ip\n end",
"def src_ip\n self[:sender_ip]\n end",
"def ip... | [
"0.8282784",
"0.7187148",
"0.7022128",
"0.69128734",
"0.686062",
"0.67870945",
"0.67849576",
"0.6768676",
"0.66669655",
"0.6655041",
"0.663488",
"0.6623252",
"0.6587535",
"0.65488374",
"0.6543198",
"0.6525965",
"0.65215254",
"0.65162456",
"0.65162456",
"0.65162456",
"0.651624... | 0.78381467 | 1 |
GET params: experiment_id: (optional) experiment_id | def index
validate(
experiment_id: [:optional, :security_default]
)
render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exper... | [
"0.78376013",
"0.7038783",
"0.7038783",
"0.67299116",
"0.66763973",
"0.66763973",
"0.66763973",
"0.6572089",
"0.6482811",
"0.6482313",
"0.6414276",
"0.63255453",
"0.6276243",
"0.62728244",
"0.6248821",
"0.6245731",
"0.6224751",
"0.6167839",
"0.61558104",
"0.6127712",
"0.60920... | 0.71113646 | 1 |
Get Simulation Manager nodes for Infrastructure Tree for given infrastructure and current user. GET params: infrastructure_name: name of Infrastructure experiment_id: (optional) experiment_id infrastructure_params: (optional) hash with special params for infrastructure (e.g. filtering options) | def simulation_manager_records
begin
facade = InfrastructureFacadeFactory.get_facade_for(params[:infrastructure_name])
hash = facade.sm_record_hashes(current_user.id, params[:experiment_id], (params[:infrastructure_params] or {}))
render json: hash
rescue NoSuchInfrastructureError => e
R... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodes\r\n params = {\r\n method: :get,\r\n url: '/project/nodes',\r\n params: { prjUUID: @uuid }\r\n }\r\n @session.request(**params).perform!['nodes']\r\n end",
"def get_running_simulation_managers(user, experiment = nil)\n AmazonVm.find_all_by_user_id(user.id).map ... | [
"0.5509777",
"0.49817002",
"0.49540865",
"0.49299693",
"0.4735673",
"0.4667391",
"0.46067202",
"0.46059614",
"0.4590138",
"0.45525274",
"0.4521831",
"0.4494398",
"0.44863883",
"0.44526455",
"0.44377708",
"0.44320893",
"0.442369",
"0.44099158",
"0.4395091",
"0.43878025",
"0.43... | 0.63234836 | 0 |
POST JSON params: experiment_id infrastructure_name short name of infrastructure job_counter | def schedule_simulation_managers
validate(
infrastructure_name: [:security_default],
experiment_id: [:security_default],
job_counter: [:security_default, :integer, :positive],
time_limit: [:optional, :integer, :positive]
) #:queue
infrastructure = nil
infrastructure_name ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def experiment_params\n params.require(:experiment).permit(:name, :metric, :estimated_result_date, :bet_by_date, :result)\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n \n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experimen... | [
"0.58824563",
"0.5730526",
"0.5729691",
"0.55814666",
"0.5545638",
"0.5527272",
"0.5493001",
"0.54607373",
"0.54607373",
"0.54566324",
"0.5380654",
"0.5351415",
"0.5331697",
"0.53015333",
"0.52837795",
"0.52698725",
"0.5269029",
"0.52586526",
"0.52231526",
"0.51896125",
"0.51... | 0.51113194 | 23 |
POST params (in JSON): infrastructure_name | def add_infrastructure_credentials
infrastructure_name = params[:infrastructure_name]
credentials = nil
begin
infrastructure = InfrastructureFacadeFactory.get_facade_for(infrastructure_name)
if current_user.banned_infrastructure?(infrastructure_name)
return render json: {
st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infrastructure_params\n params.require(:infrastructure).permit(:nombre, :detalle)\n end",
"def post_inventories(name,description, organization=1,variables='')\n dprint \"/api/v1/hosts\"\n resp = @rest['/api/v1/hosts'].post({\n :name => name,\n :description => description,\n ... | [
"0.69751006",
"0.59148973",
"0.58227223",
"0.5793144",
"0.5793144",
"0.56940216",
"0.56914705",
"0.5636851",
"0.56235623",
"0.558682",
"0.55599004",
"0.55520594",
"0.5544015",
"0.5540583",
"0.550806",
"0.5481998",
"0.5477464",
"0.5469026",
"0.5451895",
"0.54100186",
"0.540972... | 0.5787161 | 5 |
POST params (in JSON): infrastructure_name record_id credential_type (optional) | def remove_credentials
validate(
infrastructure_name: :security_default,
record_id: :security_default,
credential_type: [:optional, :security_default]
)
begin
facade = InfrastructureFacadeFactory.get_facade_for(params[:infrastructure_name])
facade.remove_credentials(para... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_infrastructure_credentials\n infrastructure_name = params[:infrastructure_name]\n credentials = nil\n begin\n infrastructure = InfrastructureFacadeFactory.get_facade_for(infrastructure_name)\n\n if current_user.banned_infrastructure?(infrastructure_name)\n return render json: {\n ... | [
"0.6082951",
"0.59544796",
"0.5800278",
"0.5740936",
"0.5717137",
"0.57048386",
"0.56440663",
"0.5619762",
"0.5604417",
"0.5536655",
"0.55074424",
"0.5506829",
"0.5460485",
"0.5450264",
"0.54392016",
"0.5431573",
"0.5426065",
"0.54235834",
"0.5408714",
"0.54053503",
"0.539042... | 0.5578436 | 9 |
TODO: WARNING: DEPRECATED this method will be removed both from GUI and API GET params infrastructure_name All params will be passed to simulation_managers_info in view | def simulation_managers_summary
render html: 'Please use Computational Resources Summary in Experiment view.'
#validate(
# infrastructure_name: :security_default
#)
#infrastructure_name = params[:infrastructure_name]
#facade = InfrastructureFacadeFactory.get_facade_for(infrastructure_name)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simulation_manager_records\n begin\n facade = InfrastructureFacadeFactory.get_facade_for(params[:infrastructure_name])\n hash = facade.sm_record_hashes(current_user.id, params[:experiment_id], (params[:infrastructure_params] or {}))\n render json: hash\n rescue NoSuchInfrastructureError =>... | [
"0.64636064",
"0.6356515",
"0.58386916",
"0.5814965",
"0.57054317",
"0.56673753",
"0.54237926",
"0.54136515",
"0.5349328",
"0.53087294",
"0.52567154",
"0.522008",
"0.51943576",
"0.5117859",
"0.5117859",
"0.5117859",
"0.5090024",
"0.5073098",
"0.5031335",
"0.4954553",
"0.49448... | 0.6638695 | 0 |
Mandatory GET params: infrastructure_name record_id | def get_sm_dialog
begin
infrastructure_name = params[:infrastructure_name]
facade = InfrastructureFacadeFactory.get_facade_for(infrastructure_name)
group_name = InfrastructureFacadeFactory.get_group_for(infrastructure_name)
render inline: render_to_string(partial: 'sm_dialog', locals: {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }\n end",
"def set_record_id\n @record_id = params[:record_id] || params[:recordId] || params[:id]\n end",
"def find_record\n ... | [
"0.5937899",
"0.5848013",
"0.57950336",
"0.56517965",
"0.5594343",
"0.5594343",
"0.55631244",
"0.54884565",
"0.5482344",
"0.54690164",
"0.5336622",
"0.5286825",
"0.52856416",
"0.5241274",
"0.52266175",
"0.5219449",
"0.5201287",
"0.5172559",
"0.51705974",
"0.5164196",
"0.51600... | 0.0 | -1 |
GET params: experiment_id (optional) infrastructure_name (optional) infrastructure_params (optional) Hash with additional parameters, e.g. PLGrid scheduler | def get_booster_dialog
validate(
experiment_id: [:optional, :security_default],
infrastructure_name: [:optional, :security_default]
)
infrastructure_name = params[:infrastructure_name]
group_name = InfrastructureFacadeFactory.get_group_for(infrastructure_name)
render inline: render... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }\n end",
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(R... | [
"0.69407374",
"0.5978798",
"0.5952757",
"0.5945628",
"0.5738424",
"0.5617199",
"0.55139965",
"0.5498341",
"0.54613197",
"0.53946185",
"0.53882426",
"0.53808624",
"0.53808624",
"0.5371066",
"0.5357592",
"0.5343933",
"0.529157",
"0.52892137",
"0.5274541",
"0.52517265",
"0.52366... | 0.0 | -1 |
TODO: check values like enums GET params: infrastructure_name other_params Hash | def get_booster_partial
validate(
infrastructure_name: :security_default
)
infrastructure_name = params[:infrastructure_name]
group_name = InfrastructureFacadeFactory.get_group_for(infrastructure_name)
facade = InfrastructureFacadeFactory.get_facade_for(infrastructure_name)
partial_name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infrastructure_params\n params.require(:infrastructure).permit(:nombre, :detalle)\n end",
"def cabinet_infrastructure_type_params\n params.require(:infrastructure_type).permit(InfrastructureType.globalize_attribute_names)\n end",
"def request_parameters; end",
"def get_resource_params\n ... | [
"0.62996006",
"0.6151246",
"0.5820187",
"0.5759255",
"0.5742293",
"0.55179447",
"0.55171007",
"0.55171007",
"0.5514588",
"0.54763895",
"0.5466877",
"0.54437476",
"0.542822",
"0.542468",
"0.5420811",
"0.541633",
"0.54114586",
"0.5411441",
"0.54089254",
"0.54011506",
"0.5375048... | 0.0 | -1 |
GET params infrastructure_name record_id | def get_resource_status
validate(
infrastructure_name: :security_default,
record_id: :security_default
)
begin
facade = InfrastructureFacadeFactory.get_facade_for(params[:infrastructure_name])
record = get_sm_record(params[:record_id], facade)
facade.yield_simulation_manag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_record\n record_id = params[:record_id] || params[:id]\n @record = Record.where(medical_record_number: record_id).first\n raise RequestError.new(404) if @record.nil?\n end",
"def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/in... | [
"0.5921797",
"0.5877615",
"0.5814029",
"0.5814029",
"0.5788836",
"0.5733571",
"0.57115686",
"0.5689227",
"0.5675984",
"0.55274266",
"0.5512674",
"0.5478737",
"0.54640037",
"0.54630816",
"0.54583144",
"0.5449484",
"0.5442538",
"0.543541",
"0.543317",
"0.5414969",
"0.54084146",... | 0.0 | -1 |
Get single SimulationManagerRecord with priviliges check | def get_sm_record(record_id, facade)
record = facade.get_sm_record_by_id(record_id)
raise NoSuchSimulationManagerError if record.nil?
raise AccessDeniedError if record.user_id.to_s != current_user.id.to_s
record
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_logged_in_manager\n\n return success unless is_logged_in_manager?\n\n @manager_obj = Manager.where(id: @manager_id).first\n\n return validation_error(\n 'dm_sdav_4',\n 'invalid_api_params',\n ['invalid_manager_id'],\n GlobalConstant::ErrorAction.default\n )... | [
"0.5825718",
"0.5747808",
"0.5747808",
"0.55165696",
"0.54068846",
"0.5329063",
"0.53263617",
"0.52805907",
"0.527766",
"0.52296764",
"0.5225339",
"0.5153242",
"0.51461625",
"0.51203054",
"0.5038733",
"0.5035696",
"0.5029908",
"0.5029163",
"0.50256115",
"0.50206494",
"0.49818... | 0.70084566 | 0 |
Yield single SimulationManager with priviliges check This method automatically clean up infrastructure facade resources | def yield_simulation_manager(record_id, infrastructure_name, &block)
facade = InfrastructureFacadeFactory.get_facade_for(infrastructure_name)
facade.yield_simulation_manager(get_sm_record(record_id, facade)) {|sm| yield sm}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manager_out\n forget(current_manager)\n session.delete(:manager_id)\n @current_manager = nil\n end",
"def teardown\n @expert.teardown\n @organizer.teardown\n Maadi::post_message(:Less, 'Generator is NO longer ready')\n end",
"def finalize()\n # below function is not y... | [
"0.56122315",
"0.55165935",
"0.54488367",
"0.53130585",
"0.52867705",
"0.51816744",
"0.517061",
"0.5147754",
"0.5059268",
"0.5011697",
"0.49993324",
"0.49993324",
"0.49873608",
"0.49802694",
"0.49666938",
"0.49466288",
"0.49281105",
"0.49028185",
"0.49028185",
"0.48987624",
"... | 0.6454154 | 0 |
takes the name of directory and the content of the file | def initialize(nod, c)
splitDirectory(nod)
self.content = c
self.description = "-Creating a file: '#{name_of_subject}'"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_content_from_file(file_path)\n names = file_path.split('/')\n file_name = names.pop\n directory = self.mkdir(names.join('/'))\n directory.children[file_name].content\n end",
"def read_content(dir, magic_dir, matcher); end",
"def add_content_to_file(file_path, content)\n names = file_pa... | [
"0.747005",
"0.6840634",
"0.682676",
"0.6521111",
"0.6502787",
"0.6478123",
"0.64656895",
"0.64656895",
"0.6451111",
"0.6389381",
"0.63814205",
"0.637515",
"0.6373868",
"0.62613255",
"0.62472653",
"0.62056845",
"0.6197483",
"0.617028",
"0.6168788",
"0.6161104",
"0.6150913",
... | 0.0 | -1 |
if the file already exists, we do not make another. Otherwise we will write a new file with the given content | def execute
if File.exist?(filePath)
puts "-#{name_of_subject} already exists in this directory"
else
File.open(filePath, "w+") do |n|
n.write(content)
end
puts "-File '#{name_of_subject}' has been created in directory '#{parent_directory}' \n"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write( filename, contents )\n if File.exists? filename\n puts \"#{filename} already exists\"\n else\n puts \"Creating #{filename}\"\n ::File.open( filename, \"w\" ){ |f| f.write contents }\n end\nend",
"def write_file(path, content)\n file_exists = File.exists?(path)\n if file_exists an... | [
"0.75198674",
"0.7245395",
"0.7203679",
"0.68912715",
"0.6835485",
"0.6835485",
"0.6806629",
"0.678289",
"0.67454875",
"0.67290837",
"0.67186826",
"0.67068475",
"0.6676223",
"0.6671097",
"0.6647875",
"0.66371435",
"0.6580245",
"0.6563042",
"0.65375113",
"0.6491968",
"0.648875... | 0.6155477 | 50 |
if the file exists we will delete it, otherwise we spit out an error message | def undo
if File.exist?(filePath)
File.delete(filePath)
puts "-'#{name_of_subject}' was deleted \n"
else
puts "-'#{name_of_subject}' does not exist in this directory \n"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy_file\n File.delete full_file_path\n rescue\n end",
"def delete\n begin\n uy_connection.delete(@path)\n true\n rescue Exception => e\n # If the file's not there, don't panic\n nil\n end\n end",
"def delete\n ... | [
"0.77559763",
"0.7755643",
"0.77148205",
"0.7653602",
"0.7624905",
"0.7615956",
"0.7572424",
"0.75126797",
"0.7469347",
"0.74661595",
"0.7430867",
"0.74240214",
"0.74137414",
"0.74135387",
"0.7405977",
"0.74024516",
"0.7399449",
"0.7343033",
"0.7305251",
"0.73002845",
"0.7266... | 0.0 | -1 |
GET /legal_record_types GET /legal_record_types.json | def index
@legal_record_types = LegalRecordType.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_record_types\n get_records_with_filter {|records, record_type, offset, ptr| records.push(ptr[0])}\n end",
"def get_resource_types\n Occi::Log.debug(\"Getting resource types ...\")\n collection = @model.get Occi::Core::Resource.kind\n collection.kinds.collect { |kind| kind.t... | [
"0.64690065",
"0.6433622",
"0.64201516",
"0.6412093",
"0.6396286",
"0.6239222",
"0.6164285",
"0.61379015",
"0.6126607",
"0.6125973",
"0.60934",
"0.6079893",
"0.60689515",
"0.6051791",
"0.60053563",
"0.5999913",
"0.5993356",
"0.59728247",
"0.5969534",
"0.59680253",
"0.5963951"... | 0.7730973 | 0 |
GET /legal_record_types/1 GET /legal_record_types/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @legal_record_types = LegalRecordType.all\n end",
"def set_legal_record_type\n @legal_record_type = LegalRecordType.find(params[:id])\n end",
"def index\n @crate_types = CrateType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json ... | [
"0.7607801",
"0.6543013",
"0.6346124",
"0.632686",
"0.6289297",
"0.628065",
"0.622444",
"0.6195684",
"0.6066636",
"0.60597587",
"0.60494953",
"0.6023342",
"0.6013635",
"0.59815985",
"0.5978512",
"0.5970657",
"0.5968776",
"0.5939718",
"0.5918198",
"0.5910464",
"0.5908072",
"... | 0.0 | -1 |
POST /legal_record_types POST /legal_record_types.json | def create
@legal_record_type = LegalRecordType.new(legal_record_type_params)
respond_to do |format|
if @legal_record_type.save
format.html { redirect_to @legal_record_type, notice: 'Legal record type was successfully created.' }
format.json { render :show, status: :created, location: @le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def legal_record_type_params\n params.require(:legal_record_type).permit(:name, :code, :options)\n end",
"def index\n @legal_record_types = LegalRecordType.all\n end",
"def awon_record_type_params\n params.require(:awon_record_type).permit(:rec_id, :rec_name)\n end",
"def set_legal_record... | [
"0.7142091",
"0.67765296",
"0.65265626",
"0.6492238",
"0.63019085",
"0.61627233",
"0.61096114",
"0.60769385",
"0.60769385",
"0.60156435",
"0.59872204",
"0.59872204",
"0.5972166",
"0.5902328",
"0.5891779",
"0.5886836",
"0.58591795",
"0.5851177",
"0.5840695",
"0.58352166",
"0.5... | 0.7228838 | 0 |
PATCH/PUT /legal_record_types/1 PATCH/PUT /legal_record_types/1.json | def update
respond_to do |format|
if @legal_record_type.update(legal_record_type_params)
format.html { redirect_to @legal_record_type, notice: 'Legal record type was successfully updated.' }
format.json { render :show, status: :ok, location: @legal_record_type }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update \t\n record = AssetType.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"def update\n @breadcrumb = 'update'\n @contracting_request_document_type... | [
"0.69720304",
"0.6636027",
"0.6541959",
"0.65196925",
"0.64751697",
"0.6414607",
"0.64098215",
"0.63575417",
"0.6350194",
"0.6348164",
"0.6309703",
"0.6292525",
"0.623332",
"0.6200808",
"0.61963755",
"0.6194669",
"0.6174674",
"0.6174488",
"0.6151287",
"0.6135981",
"0.6131923"... | 0.730076 | 0 |
DELETE /legal_record_types/1 DELETE /legal_record_types/1.json | def destroy
@legal_record_type.destroy
respond_to do |format|
format.html { redirect_to legal_record_types_url, notice: 'Legal record type was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @awon_record_type.destroy\n respond_to do |format|\n format.html { redirect_to awon_record_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crate_type = CrateType.find(params[:id])\n @crate_type.destroy\n\n respond_to do |format|\n forma... | [
"0.7403236",
"0.7318641",
"0.71058375",
"0.70556456",
"0.7043802",
"0.7038452",
"0.7025631",
"0.6968415",
"0.69559425",
"0.6945333",
"0.6938919",
"0.6933025",
"0.6930625",
"0.69260967",
"0.68995935",
"0.68994313",
"0.6882049",
"0.6881101",
"0.68711996",
"0.6865448",
"0.686071... | 0.7811786 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_legal_record_type
@legal_record_type = LegalRecordType.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def legal_record_type_params
params.require(:legal_record_type).permit(:name, :code, :options)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6981537",
"0.67835593",
"0.6748275",
"0.67436063",
"0.6736311",
"0.65937173",
"0.6503359",
"0.6498499",
"0.6482832",
"0.6478776",
"0.645703",
"0.6439998",
"0.63802195",
"0.6377008",
"0.6366287",
"0.632018",
"0.63016284",
"0.63011277",
"0.62932974",
"0.62919617",
"0.6290564... | 0.0 | -1 |
Handles errors by putting a requestion on the error handler Task. | def handle_error(e)
handler = error_handler()
if handler.nil?
puts "** [#{full_name()}] #{e.class}: #{e.message}"
e.backtrace.each { |line| puts " #{line}" }
else
handler.receive(nil, Box.new([e, full_name()]))
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_handler()\n return @error_handler unless @error_handler.nil?\n eh = find_task(:error)\n return eh unless eh.nil?\n @env.error_handler\n end",
"def error_handler()\n @error_handler\n end",
"def scrapping_error_handler(task, job_id)\n -> (uri, ex) do\n Api... | [
"0.71128863",
"0.6844246",
"0.67631876",
"0.6712967",
"0.6602112",
"0.64644665",
"0.6463499",
"0.64547074",
"0.64163864",
"0.6415758",
"0.6401356",
"0.63803184",
"0.63572145",
"0.6262365",
"0.62436455",
"0.62290835",
"0.62261033",
"0.62174004",
"0.61419064",
"0.61419064",
"0.... | 0.5472971 | 86 |
We're going to build a `BankAccount` class where one instance of the class can transfer money to another instance through a `Transfer` class. | def initialize(name)
@name = name
@balance = 1000
@status = "open"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transfer_to(account, amount)\n # `account.name` is accessing the name of the account we are transfering to\n debit amount, \"Transfer to #{account.name}\"\n account.credit amount, \"Transfer from #{@name}\"\n end",
"def transfer(amount, other)\n @balance -= amount\n other.balance += amount\n ... | [
"0.6887447",
"0.67987514",
"0.67177755",
"0.66705966",
"0.66207945",
"0.66170806",
"0.65294397",
"0.6528831",
"0.652276",
"0.64498603",
"0.6376063",
"0.6371873",
"0.63602746",
"0.6328354",
"0.6322569",
"0.6319879",
"0.6280065",
"0.62634474",
"0.6258798",
"0.62579244",
"0.6218... | 0.0 | -1 |
Calls wait repeatedly while the given block yields a truthy value. | def wait_while
while yield
wait
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_while\n while yield\n\twait\n end\n end",
"def wait_while\n while yield\n wait\n end\n end",
"def wait_until\n until yield\n wait\n end\n end",
"def wait_until\n until yield\n\twait\n end\n end"... | [
"0.7943674",
"0.77922505",
"0.7699469",
"0.76607347",
"0.75914925",
"0.75824225",
"0.7288072",
"0.7137232",
"0.70308703",
"0.6998008",
"0.6996827",
"0.6959322",
"0.6846315",
"0.6835431",
"0.6834622",
"0.678566",
"0.67743385",
"0.67576814",
"0.6748429",
"0.66820675",
"0.665181... | 0.79539734 | 0 |
Calls wait repeatedly until the given block yields a truthy value. | def wait_until
until yield
wait
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_until\n until yield\n\twait\n end\n end",
"def wait_until\n until yield\n wait\n end\n end",
"def wait_until(timeout=10, &block)\n time = Time.now\n success = false\n until success\n if (Time.now - time) >= ... | [
"0.7835417",
"0.7740102",
"0.7686936",
"0.7526792",
"0.7494904",
"0.7387763",
"0.73210543",
"0.7316543",
"0.7051393",
"0.70062757",
"0.6978899",
"0.69396657",
"0.6887059",
"0.68666446",
"0.6849211",
"0.6813354",
"0.6797292",
"0.67702025",
"0.67153686",
"0.6685318",
"0.6668333... | 0.7878745 | 0 |
Wakes up the first thread in line waiting for this lock. | def signal
@monitor.mon_check_owner
@cond.signal
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signal_next\n begin\n next_waiting_thread = @waiting_threads.shift\n next_waiting_thread.run if next_waiting_thread\n rescue ThreadError\n # Thread must be dead\n redo\n end\n nil\n end",
"def wait\n @thread.join\n end",
"def join()\r\n @watchThread... | [
"0.62270904",
"0.61107767",
"0.61030346",
"0.60308707",
"0.5998809",
"0.59979415",
"0.5975046",
"0.5970752",
"0.59520656",
"0.59391713",
"0.5877168",
"0.5822253",
"0.5819532",
"0.5816068",
"0.5797966",
"0.5769011",
"0.57287604",
"0.57284796",
"0.5716272",
"0.57113576",
"0.567... | 0.0 | -1 |
Wakes up all threads waiting for this lock. | def broadcast
@monitor.mon_check_owner
@cond.broadcast
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wake()\n\t\t\t\tThread.exlusive {\n\t\t\t\t\t@workers.each do |w|\n\t\t\t\t\t\tbreak if w.wake()\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend",
"def unlock\n\t\t\treturn unless @locked\n\t\t\tif @nested_locks > 0\n\t\t\t\t@nested_locks -= 1\n\t\t\telse\n\t\t\t\tThread.critical = true\n\t\t\t\t@locked = false\n\t\t\t... | [
"0.6910114",
"0.6455148",
"0.62084466",
"0.61514497",
"0.61475056",
"0.6117282",
"0.611689",
"0.6106348",
"0.60961545",
"0.606584",
"0.59927285",
"0.59855336",
"0.59739774",
"0.5970269",
"0.5943248",
"0.5939495",
"0.59340763",
"0.5932705",
"0.58972853",
"0.5884525",
"0.587817... | 0.0 | -1 |
Attempts to enter exclusive section. Returns +false+ if lock fails. | def mon_try_enter
@mon_data.try_enter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def try_lock\n if locked_out?\n false\n else\n lock\n true\n end\n end",
"def try_enter\n raise 'Already locked' if @locked\n enter_primitive ? @locked = true : false\n end",
"def try_lock\n puts \"I couldn't get a lock.\" unless \n open_lock('contested',... | [
"0.7450879",
"0.69623774",
"0.69530964",
"0.68002725",
"0.6768322",
"0.67225504",
"0.6648941",
"0.6639862",
"0.6618569",
"0.6611611",
"0.6563691",
"0.65349734",
"0.65238017",
"0.65238017",
"0.64964646",
"0.6474038",
"0.6442541",
"0.6413623",
"0.6406221",
"0.6404843",
"0.63908... | 0.0 | -1 |
Returns true if this monitor is locked by any thread | def mon_locked?
@mon_data.mon_locked?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locked?\n @mutex.locked?\n end",
"def has_lock?\n @has_lock || false\n end",
"def mon_locked?\n (defined?(@mon_data) ? @mon_data : use_monitor_core).locked?\n end",
"def is_locked?\n return true if have_lock?\n begin\n return true unless acquire_lock\n ensure\n ... | [
"0.75707895",
"0.72808236",
"0.7149043",
"0.7102148",
"0.70453733",
"0.7040297",
"0.7035886",
"0.7026846",
"0.7004235",
"0.69379336",
"0.69212186",
"0.6898244",
"0.6893488",
"0.6892385",
"0.6890932",
"0.6879711",
"0.68790925",
"0.68790925",
"0.68790925",
"0.68790925",
"0.6840... | 0.69887924 | 9 |
Returns true if this monitor is locked by current thread. | def mon_owned?
@mon_data.mon_owned?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locked?\n @mutex.locked?\n end",
"def is_locked?\n return true if have_lock?\n begin\n return true unless acquire_lock\n ensure\n release_lock\n end\n false\n end",
"def locked?\n locksmith.locked?\n end",
"def our_lock?(current_lock)\n ret... | [
"0.79255575",
"0.7540822",
"0.7382909",
"0.7351718",
"0.731993",
"0.7317589",
"0.7297748",
"0.7294507",
"0.72939897",
"0.7269678",
"0.72349936",
"0.7229019",
"0.71920294",
"0.71625066",
"0.71625066",
"0.71625066",
"0.71625066",
"0.71473974",
"0.71094525",
"0.710659",
"0.70768... | 0.0 | -1 |
Enters exclusive section and executes the block. Leaves the exclusive section automatically when the block exits. See example under +MonitorMixin+. | def mon_synchronize(&b)
@mon_data.synchronize(&b)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mon_synchronize\n mon_enter\n begin\n yield\n ensure\n mon_exit\n end\n end",
"def mon_synchronize\n mon_enter\n begin\n yield\n ensure\n mon_exit\n end\n end",
"def mon_synch... | [
"0.63079166",
"0.62859124",
"0.6283029",
"0.6050442",
"0.58855504",
"0.5865685",
"0.5816433",
"0.5794667",
"0.5768792",
"0.57487196",
"0.573943",
"0.5721496",
"0.5711356",
"0.57112503",
"0.5708981",
"0.56598336",
"0.56598336",
"0.5657373",
"0.56544024",
"0.562572",
"0.5621791... | 0.0 | -1 |
Creates a new MonitorMixin::ConditionVariable associated with the Monitor object. | def new_cond
unless defined?(@mon_data)
mon_initialize
@mon_initialized_by_new_cond = true
end
return ConditionVariable.new(@mon_data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_cond\n return ConditionVariable.new(self)\n end",
"def new_cond\n return ConditionVariable.new(self)\n end",
"def new_cond\n return ConditionVariable.new(self)\n end",
"def new_cond\n FiberedConditionVariable.new(self)\n end",
"def condition(condition)\n ... | [
"0.76188225",
"0.7474942",
"0.7430136",
"0.72488457",
"0.5363207",
"0.5272172",
"0.5250856",
"0.5201172",
"0.5201172",
"0.51762027",
"0.5154889",
"0.51113045",
"0.50905496",
"0.50693876",
"0.5022179",
"0.49857295",
"0.49655747",
"0.49480045",
"0.49480045",
"0.49480045",
"0.49... | 0.7541108 | 1 |
Use extend MonitorMixin or include MonitorMixin instead of this constructor. Have look at the examples above to understand how to use this module. | def initialize(...)
super
mon_initialize
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance\n Monitor.instance\n end",
"def monitor\n raise NotImplementedError\n end",
"def initialize(*args)\n super\n mon_initialize\n end",
"def monitor; end",
"def start_monitor\n self.monitor = monitor_thread if not self.monitor\n end",
"def initial... | [
"0.6672591",
"0.66516453",
"0.61974424",
"0.59795403",
"0.5808059",
"0.57367533",
"0.5688208",
"0.56585854",
"0.56269246",
"0.5618194",
"0.5586193",
"0.5520587",
"0.5487475",
"0.54441434",
"0.5437114",
"0.5436014",
"0.5432358",
"0.5399025",
"0.5377652",
"0.5331059",
"0.532675... | 0.5891941 | 4 |
Initializes the MonitorMixin after being included in a class or when an object has been extended with the MonitorMixin | def mon_initialize
if defined?(@mon_data)
if defined?(@mon_initialized_by_new_cond)
return # already initialized.
elsif @mon_data_owner_object_id == self.object_id
raise ThreadError, "already initialized"
end
end
@mon_data = ::Monitor.new
@mon_data_owner_object_id = sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(*args)\n super\n mon_initialize\n end",
"def pre_initialize( *args, & block )\n # call to super in case we extend Class or Module, so we can stack calls to pre_initialize\n super if defined?( super )\n # nothing here - subclasses define\n end",
"def initial... | [
"0.64419717",
"0.6413967",
"0.6329963",
"0.6270992",
"0.6242087",
"0.6104179",
"0.607806",
"0.58144253",
"0.5780451",
"0.5779902",
"0.5753945",
"0.5682185",
"0.56707585",
"0.5630943",
"0.55961925",
"0.5588572",
"0.55656785",
"0.55345654",
"0.55330664",
"0.5519202",
"0.5507654... | 0.61939967 | 5 |
This method is called when weak warning is produced by the parser. +fmt+ and +args+ is printf style. | def warn(fmt, *args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning(fmt, *args)\n end",
"def bold_warning(*args); end",
"def warning(*args); end",
"def warn(*args); end",
"def warn(*args); end",
"def warn(*args); say $terminal.color(format(*args), :magenta); end",
"def warn *args\n @invoked = { name: :warn, args: args }\n end",
"def warning(*args... | [
"0.83018994",
"0.77762747",
"0.7754581",
"0.75655115",
"0.75655115",
"0.7238512",
"0.7216363",
"0.72047436",
"0.7101225",
"0.7017673",
"0.69378567",
"0.690989",
"0.68738145",
"0.68738145",
"0.6860807",
"0.68073833",
"0.68073833",
"0.6807095",
"0.6784719",
"0.6783854",
"0.6770... | 0.8020986 | 1 |
This method is called when strong warning is produced by the parser. +fmt+ and +args+ is printf style. | def warning(fmt, *args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bold_warning(*args); end",
"def warn(fmt, *args)\n end",
"def warning(*args); end",
"def warn(*args); end",
"def warn(*args); end",
"def warn(*args); say $terminal.color(format(*args), :magenta); end",
"def warning(*args)\n color(33, *args)\n end",
"def bold_warning(*args)\n color('... | [
"0.8008008",
"0.79357576",
"0.7710648",
"0.7482967",
"0.7482967",
"0.7418555",
"0.7235702",
"0.7116658",
"0.7006323",
"0.7006323",
"0.68855",
"0.68817747",
"0.68719167",
"0.68719167",
"0.6862216",
"0.68359613",
"0.68359613",
"0.681929",
"0.67804843",
"0.67272615",
"0.6721254"... | 0.8352037 | 0 |
This method is called when the parser found syntax error. | def compile_error(msg)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exception_on_syntax_error; end",
"def syntax_error(state, event, legal_events, line)\n end",
"def exception_on_syntax_error=(_arg0); end",
"def handle_error(aParsing)\n # Retrieve the first empty state set\n pos = aParsing.chart.state_sets.find_index(&:empty?)\n lexeme_at_pos = ... | [
"0.8196668",
"0.7873343",
"0.7412636",
"0.7334195",
"0.7281836",
"0.7281836",
"0.7281836",
"0.7281836",
"0.7142162",
"0.71094173",
"0.70694",
"0.6899365",
"0.6860353",
"0.6842349",
"0.68250954",
"0.6792311",
"0.6715902",
"0.6680956",
"0.6677749",
"0.6655654",
"0.6655654",
"... | 0.56508255 | 77 |
parse the code and returns elements including errors. | def scan(**kw)
result = (parse(**kw) + errors + @stack.flatten).uniq.sort_by {|e| [*e.pos, (e.message ? -1 : 0)]}
result.each_with_index do |e, i|
if e.event == :on_parse_error and e.tok.empty? and (pre = result[i-1]) and
pre.pos[0] == e.pos[0] and (pre.pos[1] + pre.tok.size) == e.pos[1]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(code)\n class_and_fields = split_by_line(code, 0)[:line]\n # input result to fields array\n return class_and_fields\n end",
"def parse_error!; raise ParseError, \"Error while parsing %s:\\n %s\" % [self.class.to_s, html]; end",
"def parse_codespan; end",
"def parse_codeblocks(html... | [
"0.6376709",
"0.6138219",
"0.60722256",
"0.6032446",
"0.6014486",
"0.59552693",
"0.5915585",
"0.590737",
"0.58930767",
"0.5857824",
"0.5836213",
"0.58196527",
"0.58196527",
"0.58196527",
"0.5777064",
"0.5775463",
"0.5757775",
"0.5757775",
"0.5746375",
"0.57136524",
"0.5706018... | 0.52040523 | 76 |
The file name of the input. | def filename
@__lexer.filename
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filename\n @file.basename.to_s\n end",
"def file_name\n name.underscore\n end",
"def name\n filename\n end",
"def name\n filename\n end",
"def file_name\n return @file_name\n end",
"def file_name\n return @file_name\n ... | [
"0.80282193",
"0.78855795",
"0.7835878",
"0.7835878",
"0.7818252",
"0.7818252",
"0.77885795",
"0.7731884",
"0.77067494",
"0.769026",
"0.76861316",
"0.7682475",
"0.76745236",
"0.766792",
"0.7637377",
"0.76228106",
"0.75577086",
"0.7556795",
"0.75527483",
"0.75264466",
"0.74954... | 0.0 | -1 |
The line number of the current token. This value starts from 1. This method is valid only in event handlers. | def lineno
@__line
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_line_number; end",
"def get_lineno\n RubyVM::Frame.get(1).source_location[0]\n end",
"def lineno\n @source.lineno\n end",
"def lineno\n @_st_lineno\n end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def line_number\n $curwin.cursor.first\n end",
"def lin... | [
"0.7984088",
"0.79189855",
"0.77729785",
"0.77079034",
"0.7680406",
"0.762646",
"0.76082903",
"0.7583205",
"0.74881923",
"0.74738085",
"0.7463082",
"0.7404854",
"0.7404854",
"0.7404854",
"0.7404854",
"0.7404854",
"0.7404854",
"0.7404854",
"0.7402989",
"0.7402989",
"0.73991895... | 0.7909613 | 2 |
The column number of the current token. This value starts from 0. This method is valid only in event handlers. | def column
@__col
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def column\n\t return -1 if @inputStack.empty? # only if initialize() arg is bogus\n\n\t input = @inputStack[0] # not @inputStack.last\n\t currLineStart = input.string.rindex(\"\\n\", input.pos)\n\t return input.pos + 1 if currLineStart.nil?\n\t return input.pos - currLineStart + 1\n\tend",
"def c... | [
"0.75148207",
"0.74125266",
"0.74125266",
"0.7161211",
"0.7151933",
"0.7065427",
"0.6896257",
"0.6804713",
"0.6634959",
"0.6586108",
"0.65591365",
"0.6519724",
"0.6505881",
"0.64910567",
"0.64730257",
"0.64725304",
"0.64396816",
"0.64171594",
"0.6412098",
"0.6334705",
"0.6328... | 0.61526114 | 28 |
The scanner's state of the current token. This value is the bitwise OR of zero or more of the +Ripper::EXPR_+ constants. | def state
@__state
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_op\n case @scanner\n when RPAREN\n while not LPAREN === @opstack[-1]\n raise \"Mismatched parens\" if @opstack.empty?\n @outarr << OpValMap[@opstack.pop]\n end\n @opstack.pop\n :state_op\n when OP\n op = @scanner.matched\n while is_lower(@opstack[-1], ... | [
"0.6565337",
"0.61942565",
"0.61550933",
"0.60513085",
"0.59651554",
"0.58942777",
"0.57622457",
"0.57471746",
"0.57362646",
"0.5735885",
"0.56557065",
"0.5639741",
"0.5634056",
"0.56150633",
"0.5559705",
"0.5554861",
"0.5516394",
"0.55141646",
"0.55023474",
"0.55003184",
"0.... | 0.0 | -1 |
Starts the parser. +init+ is a data accumulator and is passed to the next event handler (as of Enumerableinject). | def parse(init = nil)
data = init
@__lexer.lex.each do |pos, event, tok, state|
@__line, @__col = *pos
@__state = state
data = if respond_to?(event, true)
then __send__(event, tok, data)
else on_default(event, tok, data)
end
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parser_init\n @http = Http::Parser.new\n @http.on_headers_complete = proc do\n p @http.headers\n end\n @http.on_body = proc do |chunk|\n # One chunk of the body\n p chunk\n end\n\n @http.on_message_complete = proc do |env|\n # Headers and body is all pa... | [
"0.6576145",
"0.6439564",
"0.6415158",
"0.6092884",
"0.60393804",
"0.6039217",
"0.5953144",
"0.5910311",
"0.58351207",
"0.5805716",
"0.5785755",
"0.5785755",
"0.57723546",
"0.5722018",
"0.568632",
"0.5680934",
"0.5648096",
"0.5619664",
"0.5615434",
"0.5601664",
"0.5586082",
... | 0.7637443 | 0 |
This method is called when some event handler is undefined. +event+ is :on_XXX, +token+ is the scanned token, and +data+ is a data accumulator. The return value of this method is passed to the next event handler (as of Enumerableinject). | def on_default(event, token, data)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_event(event, data)\n if state_of_ignore?\n state[:ignore] = false\n puts \"Ignoring (#{event}, #{data}), because !.\"\n return\n end\n\n if event == :garbage_closed || event == :next_char_ignored\n puts \"Processing (#{event}, #{data}).\"\n self.send(event) and return\... | [
"0.6294077",
"0.6021637",
"0.5897999",
"0.581677",
"0.57442033",
"0.572676",
"0.5644346",
"0.5607515",
"0.5530994",
"0.5441699",
"0.5428947",
"0.53768647",
"0.5374935",
"0.5324393",
"0.52704066",
"0.52395016",
"0.519797",
"0.51901305",
"0.5173646",
"0.51730174",
"0.5154719",
... | 0.63870597 | 0 |
Temporarily turn off warnings. Intended for tests only. | def skip_during
Gem::Deprecate.skip, original = true, Gem::Deprecate.skip
yield
ensure
Gem::Deprecate.skip = original
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def silence_warnings(&block)\n with_warnings(nil, &block)\n end",
"def disabled_warnings; end",
"def silence_deprecations; end",
"def treat_errors_as_warnings\n @treat_errors_as_warnings ||= true\n end",
"def silence_warnings\n old_verbose, $VERBOSE = $VERBOSE, nil\n yield\nensure\n $VERBOSE... | [
"0.79080427",
"0.76914495",
"0.75789714",
"0.73848414",
"0.7334751",
"0.7334751",
"0.73347026",
"0.73347026",
"0.73347026",
"0.73347026",
"0.7329914",
"0.7322739",
"0.7250174",
"0.7245227",
"0.724285",
"0.72064006",
"0.7200789",
"0.71540195",
"0.714373",
"0.71319145",
"0.7131... | 0.0 | -1 |
Simple deprecation method that deprecates +name+ by wrapping it up in a dummy method. It warns on each call to the dummy method telling the user of +repl+ (unless +repl+ is :none) and the year/month that it is planned to go away. | def deprecate(name, repl, year, month)
class_eval do
old = "_deprecated_#{name}"
alias_method old, name
define_method name do |*args, &block|
klass = self.kind_of? Module
target = klass ? "#{self}." : "#{self.class}#"
msg = [ "NOTE: #{target}#{name} is deprecated",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deprecate(name, repl, year, month)\n class_eval do\n old = \"_deprecated_#{name}\"\n alias_method old, name\n define_method name do |*args, &block|\n klass = self.kind_of? Module\n target = klass ? \"#{self}.\" : \"#{self.class}#\"\n msg = [ \"NOTE: #{target}#{name} is de... | [
"0.7803016",
"0.7358219",
"0.72386485",
"0.68016696",
"0.6308054",
"0.62781006",
"0.6273713",
"0.62269413",
"0.60431325",
"0.60208654",
"0.59712905",
"0.5915642",
"0.5900806",
"0.58967197",
"0.588784",
"0.57602715",
"0.5728558",
"0.5697367",
"0.56542385",
"0.5608339",
"0.5588... | 0.7717672 | 1 |
Simple deprecation method that deprecates +name+ by wrapping it up in a dummy method. It warns on each call to the dummy method telling the user of +repl+ (unless +repl+ is :none) and the Rubygems version that it is planned to go away. | def rubygems_deprecate(name, replacement=:none)
class_eval do
old = "_deprecated_#{name}"
alias_method old, name
define_method name do |*args, &block|
klass = self.kind_of? Module
target = klass ? "#{self}." : "#{self.class}#"
msg = [ "NOTE: #{target}#{name} is deprecated",... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deprecate(name, repl, year, month)\n class_eval do\n old = \"_deprecated_#{name}\"\n alias_method old, name\n define_method name do |*args, &block|\n klass = self.kind_of? Module\n target = klass ? \"#{self}.\" : \"#{self.class}#\"\n msg = [ \"NOTE: #{target}#{name} is de... | [
"0.7397118",
"0.73558384",
"0.7346467",
"0.69737536",
"0.6756128",
"0.651227",
"0.64802533",
"0.6458092",
"0.62660325",
"0.6240183",
"0.61810756",
"0.607354",
"0.60628843",
"0.6051789",
"0.6022408",
"0.59912527",
"0.5981145",
"0.5964968",
"0.5959262",
"0.59430444",
"0.5938956... | 0.7562993 | 0 |
Deprecation method to deprecate Rubygems commands | def rubygems_deprecate_command
class_eval do
define_method "deprecated?" do
true
end
define_method "deprecation_warning" do
msg = [ "#{self.command} command is deprecated",
". It will be removed in Rubygems #{Gem::Deprecate.next_rubygems_major_version}.\n",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _warn_deprecated_command(cmd)\n warn \"\\n'#{cmd}' is deprecated! Please use 'defEvent' and 'onEvent' commands\"\n warn \"Deprecated commands will be removed in future OMF versions\"\n warn \"Moreover, they may not allow the use of some features in this version\"\n end",
"def from_installed... | [
"0.71271914",
"0.6978679",
"0.6778061",
"0.63640755",
"0.62051696",
"0.61596185",
"0.605785",
"0.59854674",
"0.5949398",
"0.5892844",
"0.5892844",
"0.5874589",
"0.5805417",
"0.5790156",
"0.57743514",
"0.5766286",
"0.5765496",
"0.57122",
"0.5706315",
"0.56979764",
"0.5656256",... | 0.80230683 | 0 |
append a platform to the list of mismatched platforms. Platforms are added via this instead of injected via the constructor so that we can loop over a list of mismatches and just add them rather than perform some kind of calculation mismatch summary before creation. | def add_platform(platform)
@platforms << platform
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_platforms\n updated_lines = updated.lines\n\n # Find last line of GEM\n last_section_of_gem_index = updated.lines.index { |line| line != \"G\" && line.chr == \"\\n\" }\n\n # PLATFORMS should be added after GEM section\n add_platforms_index = last_section_of_gem_index + 1\... | [
"0.6304852",
"0.583059",
"0.5752206",
"0.55711263",
"0.55046487",
"0.54869896",
"0.5485604",
"0.54331523",
"0.5335251",
"0.5294129",
"0.5293656",
"0.5189585",
"0.5188042",
"0.5161056",
"0.513413",
"0.5126446",
"0.5125798",
"0.51004237",
"0.50658035",
"0.50493103",
"0.50242287... | 0.7192531 | 0 |
A wordy description of the error. | def wordy
"Found %s (%s), but was for platform%s %s" %
[@name,
@version,
@platforms.size == 1 ? '' : 's',
@platforms.join(' ,')]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_description\n end",
"def error_msg\n name\n end",
"def error_message; end",
"def error_message\n error.message\n end",
"def error_message\n @response.reason_phrase\n end",
"def error_string\n # This method should be overridden\n end",
"def error\n ... | [
"0.82772136",
"0.7764091",
"0.7710183",
"0.76718736",
"0.7588956",
"0.7566488",
"0.7523116",
"0.730793",
"0.72107786",
"0.71353805",
"0.71335286",
"0.70925266",
"0.7012987",
"0.7012005",
"0.69918424",
"0.69574535",
"0.6930434",
"0.6929304",
"0.6912396",
"0.68828493",
"0.68777... | 0.0 | -1 |
An English description of the error. | def wordy
"Unable to download data from #{Gem::Uri.new(@source.uri).redacted} - #{@error.message}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_description\n end",
"def error_msg\n name\n end",
"def error_message; end",
"def error_message\n error.message\n end",
"def message\n \"Telphin returned an error #{@error_code}: '#{@error_msg}'\"\n end",
"def error_message\n @response.reason_phrase\n end",
"de... | [
"0.801586",
"0.7682395",
"0.7569112",
"0.75581485",
"0.74556667",
"0.7434735",
"0.73645633",
"0.7200619",
"0.71798605",
"0.7136127",
"0.7068452",
"0.70540124",
"0.701388",
"0.6968213",
"0.6918726",
"0.6832036",
"0.68065363",
"0.6802779",
"0.67971766",
"0.6797156",
"0.6796778"... | 0.0 | -1 |
Creates a new SystemExitException with the given +exit_code+ | def initialize(exit_code)
@exit_code = exit_code
super exit_code, "Exiting RubyGems with exit_code #{exit_code}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exit_now!(message,exit_code)\n raise CustomExit.new(message,exit_code)\n end",
"def exit_process(exit_code)\n exit exit_code\n end",
"def exit_with code\n ExitCodeMatcher.new(code)\n end",
"def exit_code(code)\n @exit_code = code\n end",
"def exit_code=(value)\... | [
"0.7332938",
"0.6931552",
"0.6898708",
"0.6810538",
"0.6526202",
"0.64559567",
"0.6292229",
"0.62345755",
"0.61945325",
"0.6004653",
"0.59937465",
"0.59838784",
"0.59408164",
"0.5939131",
"0.59215784",
"0.5920645",
"0.59198135",
"0.5869461",
"0.5869461",
"0.58585596",
"0.5798... | 0.6732434 | 4 |
The name of the unresolved dependency | def name
@dependency.name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name_for(dependency)\n dependency.name\n end",
"def name_for(dependency)\n dependency.name\n end",
"def name_for(dependency)\n dependency.name\n end",
"def name_for(dependency)\n dependency.to_s\n end",
"def dependency_name\n name.to_s.sub(/_factory$/, '').to_sym\... | [
"0.76625663",
"0.76625663",
"0.76625663",
"0.7430919",
"0.74106455",
"0.685756",
"0.6626498",
"0.6577599",
"0.6448321",
"0.6348911",
"0.626082",
"0.6243345",
"0.6226414",
"0.62174535",
"0.6146624",
"0.6139071",
"0.6126362",
"0.60828924",
"0.6070278",
"0.6070278",
"0.60690165"... | 0.80652446 | 1 |
The Requirement of the unresolved dependency (not Version). | def version
@dependency.requirement
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def requirement\n @dependency.requirement\n end",
"def required_version\n versions.find { |v| dependency.match?(name, v) } ||\n raise(Informative, \"Required version (#{dependency}) not found for `#{name}'.\\nAvailable versions: #{versions.join(', ')}\")\n end",
"def version_required(g... | [
"0.8133482",
"0.7454102",
"0.7436239",
"0.699802",
"0.6926871",
"0.6862546",
"0.6813412",
"0.6794802",
"0.6704338",
"0.664087",
"0.6632473",
"0.660293",
"0.6600856",
"0.65062904",
"0.6494841",
"0.6494841",
"0.64906746",
"0.64815193",
"0.6480466",
"0.64617455",
"0.64200926",
... | 0.78586894 | 1 |
The path to the gem.build_complete file within the extension install directory. | def gem_build_complete_path # :nodoc:
File.join extension_dir, 'gem.build_complete'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_gem_path\n # TODO: This is a heavily used method by gems, so we'll need\n # to aleast just alias it to #gem_dir rather than remove it.\n @full_gem_path ||= find_full_gem_path\n end",
"def full_gem_path\n # TODO: This is a heavily used method by gems, so we'll need\n # to aleast just alia... | [
"0.7521574",
"0.7521574",
"0.70974493",
"0.7020469",
"0.69268256",
"0.68247765",
"0.6781271",
"0.67776126",
"0.6750355",
"0.6702731",
"0.6674988",
"0.6644198",
"0.66362166",
"0.6630363",
"0.6540812",
"0.6525059",
"0.64928985",
"0.6468924",
"0.6460897",
"0.64434034",
"0.643730... | 0.9453267 | 0 |
True when the gem has been activated | def activated?
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activated?\n @activated ||=\n begin\n loaded = Gem.loaded_specs[name]\n loaded && loaded.version == version\n end\n end",
"def activated?\n loaded = Gem.loaded_specs[name]\n loaded && loaded.version == version\n end",
"def activate\n other = Gem.loaded_specs[self.name]\n if... | [
"0.8160236",
"0.77601814",
"0.7557119",
"0.74879277",
"0.71704054",
"0.6888323",
"0.6765913",
"0.6701275",
"0.6650075",
"0.6577055",
"0.6531484",
"0.64610076",
"0.6429871",
"0.63983876",
"0.6372096",
"0.63706696",
"0.6356722",
"0.63517374",
"0.63250995",
"0.6323029",
"0.63205... | 0.6616493 | 10 |
Returns the full path to the base gem directory. eg: /usr/local/lib/ruby/gems/1.8 | def base_dir
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_root\n Pathname.new(__FILE__).dirname.parent.parent.expand_path\n end",
"def base_dir\n return Gem.dir unless loaded_from\n @base_dir ||= if default_gem? then\n File.dirname File.dirname File.dirname loaded_from\n else\n File.dirname Fi... | [
"0.8133968",
"0.8087241",
"0.78792214",
"0.78651905",
"0.78651905",
"0.78212667",
"0.78212667",
"0.78031665",
"0.75980204",
"0.7577008",
"0.7551242",
"0.74649113",
"0.7376797",
"0.73164916",
"0.7168673",
"0.71502316",
"0.71286964",
"0.7074042",
"0.7053033",
"0.6981837",
"0.69... | 0.0 | -1 |
Return true if this spec can require +file+. | def contains_requirable_file?(file)
if @ignored
return false
elsif missing_extensions?
@ignored = true
if Gem::Platform::RUBY == platform || Gem::Platform.local === platform
warn "Ignoring #{full_name} because its extensions are not built. " +
"Try: gem pristine #{name} --ve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_file_satisfied_by?(spec_file)\n file_paths.any? { |gem_file| RPM::Spec.file_satisfies?(spec_file, gem_file) }\n end",
"def has_file_satisfied_by?(spec_file)\n file_paths.any? { |gem_file| RPM::Spec.file_satisfies?(spec_file, gem_file) }\n end",
"def contains_requirable_file? file\n ... | [
"0.7226653",
"0.7204808",
"0.6825683",
"0.66938",
"0.6550371",
"0.64181143",
"0.619028",
"0.61301005",
"0.611767",
"0.6028578",
"0.6027877",
"0.6024072",
"0.59741354",
"0.595773",
"0.59372574",
"0.5923189",
"0.589696",
"0.5878714",
"0.58559364",
"0.58505243",
"0.58443844",
... | 0.6103292 | 9 |
Returns full path to the directory where gem's extensions are installed. | def extension_dir
@extension_dir ||= File.expand_path(File.join(extensions_dir, full_name)).tap(&Gem::UNTAINT)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extensions_dir\n Gem.default_ext_dir_for(base_dir) ||\n File.join(base_dir, 'extensions', Gem::Platform.local.to_s,\n Gem.extension_api_version)\n end",
"def package_path(extension='.gem')\n File.join(package_dir, package_basename(extension))\n end",
"def gem_dir\n director... | [
"0.8275751",
"0.7621205",
"0.7295922",
"0.72051024",
"0.7128292",
"0.7128292",
"0.70072824",
"0.6947603",
"0.688526",
"0.6773436",
"0.6738258",
"0.6614822",
"0.65589917",
"0.65584826",
"0.64751476",
"0.64645386",
"0.64226896",
"0.63525474",
"0.632224",
"0.6272262",
"0.6244591... | 0.7815788 | 1 |
Returns path to the extensions directory. | def extensions_dir
Gem.default_ext_dir_for(base_dir) ||
File.join(base_dir, 'extensions', Gem::Platform.local.to_s,
Gem.extension_api_version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extension_dir\n @extension_dir ||= File.expand_path(File.join(extensions_dir, full_name)).tap(&Gem::UNTAINT)\n end",
"def eponymous_directory_path\n path.sub(ext, '/').sub(/\\/$/, '') + '/'\n end",
"def extensions\n @extensions ||= Dir[File.join(@ext_dir, '*')]\n end",
"def pa... | [
"0.7619814",
"0.70652246",
"0.69178396",
"0.6787858",
"0.6561572",
"0.6540122",
"0.64325774",
"0.6401091",
"0.6393777",
"0.6366235",
"0.6363603",
"0.6345543",
"0.6326613",
"0.63184386",
"0.63183457",
"0.6300488",
"0.628402",
"0.6276625",
"0.6270264",
"0.6216882",
"0.6212723",... | 0.840229 | 0 |
The full path to the gem (install path + full name). | def full_gem_path
# TODO: This is a heavily used method by gems, so we'll need
# to aleast just alias it to #gem_dir rather than remove it.
@full_gem_path ||= find_full_gem_path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_path\n File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))\n end",
"def gem_path\n @path || downloaded_gem_path\n end",
"def gem_path\n `gem environment gemdir`.chomp\nend",
"def gem_path\n @path || downloaded_gem_path\n end",
"def gem_root\n Pathname.n... | [
"0.81270117",
"0.7907437",
"0.77967846",
"0.77788293",
"0.76683843",
"0.7573462",
"0.7557873",
"0.75333077",
"0.7302537",
"0.7302537",
"0.72898674",
"0.72310793",
"0.71877265",
"0.7173709",
"0.7154655",
"0.7142142",
"0.71409035",
"0.7135549",
"0.70652395",
"0.6967151",
"0.695... | 0.8281743 | 1 |
Returns the full name (nameversion) of this Gem. Platform information is included (nameversionplatform) if it is specified and not the default Ruby platform. | def full_name
if platform == Gem::Platform::RUBY or platform.nil?
"#{name}-#{version}".dup.tap(&Gem::UNTAINT)
else
"#{name}-#{version}-#{platform}".dup.tap(&Gem::UNTAINT)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name\n if platform == Gem::Platform::RUBY or platform.nil? then\n \"#{name}-#{version}\".untaint\n else\n \"#{name}-#{version}-#{platform}\".untaint\n end\n end",
"def original_name # :nodoc:\n if platform == Gem::Platform::RUBY or platform.nil?\n \"#{@name}-#{@version}\"\n ... | [
"0.8311851",
"0.7603165",
"0.7196996",
"0.7105326",
"0.69715375",
"0.68838525",
"0.6828744",
"0.6744396",
"0.6690094",
"0.66803706",
"0.6662903",
"0.6602262",
"0.6599846",
"0.65834635",
"0.6576754",
"0.65267366",
"0.6493093",
"0.64557517",
"0.6455102",
"0.64409333",
"0.644028... | 0.77009803 | 1 |
Full paths in the gem to add to $LOAD_PATH when this gem is activated. | def full_require_paths
@full_require_paths ||=
begin
full_paths = raw_require_paths.map do |path|
File.join full_gem_path, path.tap(&Gem::UNTAINT)
end
full_paths << extension_dir if have_extensions?
full_paths
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_gem_paths; end",
"def gem_paths\n @_gem_paths ||= (ENV['GEM_PATH'] || ENV['GEM_HOME']).split(/[:;]/)\n end",
"def add_self_to_load_path\n return if default_gem?\n\n paths = full_require_paths\n\n Gem.add_to_load_path(*paths)\n end",
"def load_paths\n [root.join('lib'), ro... | [
"0.78489095",
"0.7615397",
"0.7567566",
"0.7531814",
"0.7470484",
"0.7190502",
"0.71296936",
"0.7031296",
"0.7031296",
"0.7028999",
"0.69623554",
"0.6946562",
"0.6915876",
"0.6915876",
"0.68840736",
"0.68553674",
"0.68524325",
"0.6851137",
"0.6846588",
"0.6807651",
"0.6765419... | 0.77940995 | 1 |
The path to the data directory for this gem. | def datadir
# TODO: drop the extra ", gem_name" which is uselessly redundant
File.expand_path(File.join(gems_dir, full_name, "data", name)).tap(&Gem::UNTAINT)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_dir\n @datadir\n end",
"def data_directory\n @data_directory\n end",
"def data_root\n File.expand_path(\"spec/data\", Dir.pwd)\n end",
"def data_store_path\n Rails.root.join('data', self.data_dir)\n end",
"def datafile_path(env)\n env[:machine].data_dir.join(\"be... | [
"0.8488484",
"0.8303067",
"0.80273044",
"0.79472744",
"0.78424245",
"0.7640811",
"0.75571424",
"0.7548405",
"0.75000066",
"0.7457266",
"0.7429933",
"0.74015087",
"0.73897475",
"0.73897475",
"0.73897475",
"0.7294233",
"0.72532797",
"0.7193369",
"0.7096205",
"0.70482033",
"0.70... | 0.7724842 | 5 |
Full path of the target library file. If the file is not in this gem, return nil. | def to_fullpath(path)
if activated?
@paths_map ||= {}
@paths_map[path] ||=
begin
fullpath = nil
suffixes = Gem.suffixes
suffixes.find do |suf|
full_require_paths.find do |dir|
File.file?(fullpath = "#{dir}/#{path}#{suf}")
end
end ? fu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def libfile\n libfile = Pathname.new(resource[:lib]).absolute? ? resource[:lib] : \"modules/#{resource[:lib]}\"\n end",
"def library_path\n @library_path ||= nil\n end",
"def libfile\n Pathname.new(resource[:lib]).absolute? ? resource[:lib] : \"modules/#{resource[:lib]}\"\n end",
"def project... | [
"0.75927734",
"0.74864346",
"0.74730563",
"0.73853296",
"0.70783234",
"0.70130295",
"0.69217646",
"0.6903144",
"0.6903144",
"0.6903144",
"0.6830205",
"0.6769426",
"0.67449164",
"0.668387",
"0.66780293",
"0.6621225",
"0.6601875",
"0.65958303",
"0.65919405",
"0.6546601",
"0.652... | 0.0 | -1 |
Returns the full path to this spec's gem directory. eg: /usr/local/lib/ruby/1.8/gems/mygem1.0 | def gem_dir
@gem_dir ||= File.expand_path File.join(gems_dir, full_name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_dir\n directory = File.join(File.dirname(__FILE__), \"..\")\n File.expand_path(directory, File.dirname(__FILE__))\n end",
"def gem_dir\n if File.directory?(dir = File.join(working_dir, 'gems'))\n dir\n end\n end",
"def gem_dir\n if File.directory?(dir = File.join(working_dir... | [
"0.82380825",
"0.8235828",
"0.8235828",
"0.80908227",
"0.7886935",
"0.7879491",
"0.78707016",
"0.7866282",
"0.7866282",
"0.7692851",
"0.76353437",
"0.76100177",
"0.7588973",
"0.7578363",
"0.75441694",
"0.74802417",
"0.7355638",
"0.72779804",
"0.7267974",
"0.72297686",
"0.7215... | 0.8052394 | 4 |
Returns the full path to the gems directory containing this spec's gem directory. eg: /usr/local/lib/ruby/1.8/gems | def gems_dir
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_dir\n if File.directory?(dir = File.join(working_dir, 'gems'))\n dir\n end\n end",
"def gem_dir\n if File.directory?(dir = File.join(working_dir, 'gems'))\n dir\n end\n end",
"def gem_dir\n directory = File.join(File.dirname(__FILE__), \"..\")\n File.expand_path(direct... | [
"0.84699434",
"0.84699434",
"0.82672036",
"0.8036237",
"0.7996347",
"0.7942272",
"0.78868324",
"0.78444046",
"0.78196377",
"0.77129877",
"0.7633804",
"0.7633804",
"0.75997686",
"0.75132674",
"0.7499969",
"0.73224276",
"0.72716683",
"0.7247335",
"0.71927893",
"0.717957",
"0.71... | 0.7291848 | 16 |
Name of the gem | def name
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_name\n \"#{@account}-#{@name}\"\n end",
"def gem_name\n @specification.name\n end",
"def gem_name\n @gem_name ||= \"sprout-#{clean_name}-library\"\n end",
"def gem_name\n @gem_name ||= @source_path.sub_ext(\"\").basename.to_s\n end",
"def file_name\n \"#{full_name}.ge... | [
"0.8622399",
"0.8403745",
"0.8080568",
"0.79612595",
"0.7910769",
"0.75707674",
"0.74227387",
"0.7343389",
"0.7326186",
"0.7326186",
"0.7326186",
"0.7326186",
"0.73196673",
"0.7316266",
"0.7256807",
"0.7134812",
"0.705316",
"0.7014817",
"0.6980019",
"0.6962646",
"0.6946684",
... | 0.0 | -1 |
Platform of the gem | def platform
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform; end",
"def platform; end",
"def platform; end",
"def platform\n @new_platform ||= Gem::Platform::RUBY\n end",
"def platform\n spec.platform\n end",
"def platform\n @spec.platform\n end",
"def platform\n kernel.platform\n end",
"def platform\n backend.platfor... | [
"0.8155662",
"0.8155662",
"0.8155662",
"0.7894529",
"0.7864506",
"0.78462",
"0.7764594",
"0.76642054",
"0.76499397",
"0.763814",
"0.76323134",
"0.75423443",
"0.7526862",
"0.7494673",
"0.7494673",
"0.746945",
"0.7465693",
"0.7465693",
"0.7465693",
"0.7451299",
"0.7445197",
"... | 0.76490337 | 10 |
Paths in the gem to add to $LOAD_PATH when this gem is activated. See also require_paths= If you have an extension you do not need to add "ext" to the require path, the extension build process will copy the extension files into "lib" for you. The default value is "lib" Usage: If all library files are in the root direct... | def require_paths
return raw_require_paths unless have_extensions?
[extension_dir].concat raw_require_paths
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_paths\n [root.join('lib'), root.join('spec')].join(':')\n end",
"def configured_require_paths\n return ['lib'] if directory.empty?\n return [File.join(directory, 'lib')] if config.require_paths.empty?\n config.require_paths.map{|p| File.join(directory, p)}\n end",
"def ad... | [
"0.75511277",
"0.74186116",
"0.740584",
"0.7014783",
"0.6962668",
"0.69466865",
"0.6938615",
"0.6938615",
"0.6921923",
"0.6917788",
"0.68888456",
"0.6856725",
"0.6802537",
"0.6795393",
"0.6756321",
"0.6663252",
"0.6636633",
"0.6583566",
"0.6534269",
"0.6534269",
"0.6523544",
... | 0.73692554 | 3 |
Returns the paths to the source files for use with analysis and documentation tools. These paths are relative to full_gem_path. | def source_paths
paths = raw_require_paths.dup
if have_extensions?
ext_dirs = extensions.map do |extension|
extension.split(File::SEPARATOR, 2).first
end.uniq
paths.concat ext_dirs
end
paths.uniq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def source_paths\n [File.expand_path(File.dirname(__FILE__))]\nend",
"def source_paths\n [File.expand_path(File.dirname(__FILE__))]\nend",
"def source_paths\n [File.expand_path(File.dirname(__FILE__))]\nend",
"def source_paths\n [File.expand_path(File.dirname(__FILE__))]\nend",
"def full_require_paths\... | [
"0.7184769",
"0.7184769",
"0.7184769",
"0.7184769",
"0.7004254",
"0.6983883",
"0.6975085",
"0.6975085",
"0.68428415",
"0.6747681",
"0.6663032",
"0.6652918",
"0.6541693",
"0.6541693",
"0.6541693",
"0.6540895",
"0.6540895",
"0.6540895",
"0.6540895",
"0.6540895",
"0.6540895",
... | 0.6977188 | 6 |
Return all files in this gem that match for +glob+. | def matches_for_glob(glob) # TODO: rename?
glob = File.join(self.lib_dirs_glob, glob)
Dir[glob].map {|f| f.tap(&Gem::UNTAINT) } # FIX our tests are broken, run w/ SAFE=1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def glob(*globs)\n files.find_all do |path|\n globs.any? { |pattern| File.fnmatch(pattern, path, File::FNM_EXTGLOB) }\n end\n end",
"def glob(*pat, &blk)\n regexes = pat.flatten.map {|pat| Bun.convert_glob(pat) }\n enum = self.class.new(@collection) do |yielder|\n self.... | [
"0.78088313",
"0.76597583",
"0.75116",
"0.73397106",
"0.7252498",
"0.72363967",
"0.7232573",
"0.7232573",
"0.7217731",
"0.7213782",
"0.7211691",
"0.7180867",
"0.7152442",
"0.7106917",
"0.708895",
"0.7077475",
"0.70692044",
"0.70359915",
"0.7019786",
"0.70045155",
"0.70002824"... | 0.7763699 | 1 |
Returns the list of plugins in this spec. | def plugins
matches_for_glob("rubygems#{Gem.plugin_suffix_pattern}")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plugins\n @plugin_list\n end",
"def plugins\n @plugins\n end",
"def plugins\n\n\t\tif @plugins.length == 0\n\t\t\treturn []\n\t\tend\n\n\t\treturn @plugins\n\tend",
"def all_plugin_specs\n @plugin_specs.values\n end",
"def plugins\n return @plugins if @plugins... | [
"0.87595403",
"0.8231564",
"0.8172473",
"0.81641316",
"0.80889976",
"0.807113",
"0.78092206",
"0.7773181",
"0.7703248",
"0.76739323",
"0.7605762",
"0.7578597",
"0.7552247",
"0.7493833",
"0.7427783",
"0.7420057",
"0.7254186",
"0.7224286",
"0.7206271",
"0.71946305",
"0.71618325... | 0.6170715 | 57 |
Returns a string usable in Dir.glob to match all requirable paths for this spec. | def lib_dirs_glob
dirs = if self.raw_require_paths
if self.raw_require_paths.size > 1
"{#{self.raw_require_paths.join(',')}}"
else
self.raw_require_paths.first
end
else
"lib" # default value for require_paths for bundler/inline
end
"#{self.full_gem_path}/#{dirs}"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_glob_pattern(file_spec)\n segments = file_spec.split(Repositext::Cli::FILE_SPEC_DELIMITER)\n r = ''\n if segments.all? { |e| e =~ BASE_DIR_NAME_REGEX || e =~ FILE_PATTERN_NAME_REGEX }\n # file_spec consists of named base_dir and/or file_pattern\n bd = segments.det... | [
"0.70870507",
"0.70052534",
"0.69986904",
"0.68362516",
"0.6647532",
"0.66304064",
"0.65254974",
"0.6440183",
"0.6440183",
"0.6436015",
"0.6433671",
"0.64239985",
"0.6406623",
"0.637102",
"0.6355583",
"0.6344907",
"0.6339428",
"0.6324615",
"0.62585753",
"0.62512124",
"0.62493... | 0.0 | -1 |
Return a Gem::Specification from this gem | def to_spec
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec\n @spec ||= Gem::Specification.find do |spec|\n spec.name == @name and spec.version == @version\n end\n\n @spec ||= Gem::Specification.new do |s|\n s.name = @name\n s.version = @version\n s.platform = @platform\n\n s.dependencies.concat @dependencies\n end\n end"... | [
"0.7990076",
"0.78184223",
"0.77375317",
"0.7634531",
"0.7561184",
"0.7396186",
"0.73538256",
"0.7295772",
"0.725089",
"0.71352804",
"0.71105254",
"0.7014068",
"0.69542533",
"0.68890685",
"0.65889996",
"0.6580255",
"0.651752",
"0.6426244",
"0.6395539",
"0.6349084",
"0.6283141... | 0.0 | -1 |
Version of the gem | def version
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_version; end",
"def gem_version; end",
"def gem_version; end",
"def gem_version; end",
"def gem_version; end",
"def gem_version; end",
"def version\n @gemspec.version || @version_helper.to_s\n end",
"def version\n VERSION\n end",
"def version\n VERSION\n end",
... | [
"0.86452895",
"0.86452895",
"0.86452895",
"0.86452895",
"0.86452895",
"0.86452895",
"0.8189353",
"0.8185396",
"0.81814605",
"0.8177603",
"0.8152954",
"0.8149666",
"0.8097807",
"0.80845124",
"0.8052211",
"0.8052211",
"0.8052211",
"0.7938314",
"0.79355097",
"0.7927727",
"0.7922... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.