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 |
|---|---|---|---|---|---|---|
Adds a dependency on gem +dependency+ with type +type+ that requires +requirements+. Valid types are currently :runtime and :development. | def add_dependency_with_type(dependency, type, requirements)
requirements = if requirements.empty?
Gem::Requirement.default
else
requirements.flatten
end
unless dependency.respond_to?(:name) &&
dependency.respond_to?(:requirement)
dependency = Gem::Dependency.new(dependency... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependency name, version, type = :runtime\n raise \"Unknown dependency type: #{type}\" unless\n [:runtime, :dev, :development, :developer].include? type\n\n ary = if type == :runtime then\n extra_deps\n else\n extra_dev_deps\n end\n\n ary << [name, version]... | [
"0.6939766",
"0.6760765",
"0.66160846",
"0.65631026",
"0.6555687",
"0.65243053",
"0.6439326",
"0.6439326",
"0.6309447",
"0.62800187",
"0.6214583",
"0.6145906",
"0.5984905",
"0.59629303",
"0.59249383",
"0.5877934",
"0.58665234",
"0.58573294",
"0.5802567",
"0.5797421",
"0.57482... | 0.87524927 | 0 |
Adds this spec's require paths to LOAD_PATH, in the proper location. | def add_self_to_load_path
return if default_gem?
paths = full_require_paths
Gem.add_to_load_path(*paths)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_to_dependency_load_paths #:nodoc:\n Dependencies.load_paths.concat(load_paths)\n end",
"def inject_into_load_path\n \n # Add ALL paths under the engine root to the load path\n %w(app/controllers \n app/helpers \n app/models\n components\n lib).collect ... | [
"0.75330967",
"0.7506363",
"0.7329474",
"0.7273826",
"0.7243185",
"0.7206035",
"0.71899986",
"0.7127017",
"0.7119331",
"0.71009314",
"0.71009314",
"0.7079797",
"0.7061001",
"0.70546407",
"0.70194435",
"0.6987072",
"0.6987072",
"0.69868046",
"0.69868046",
"0.6956001",
"0.69510... | 0.6922702 | 22 |
Singular reader for authors. Returns the first author in the list | def author
val = authors and val.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def author\n authors.first\n end",
"def author\n authors.first\n end",
"def author\n @title_pages.each { |tp| tp.author and return tp.author }\n nil\n end",
"def authors\n author\n end",
"def authors\n read_property 'Authors'\n end",
"def citation_author\n su... | [
"0.7577776",
"0.7577776",
"0.69716257",
"0.6934609",
"0.68407756",
"0.68256265",
"0.6773829",
"0.6770087",
"0.6770087",
"0.67274785",
"0.6706713",
"0.6677316",
"0.6658524",
"0.66492665",
"0.66492665",
"0.6624497",
"0.66095716",
"0.65732324",
"0.6571698",
"0.656792",
"0.655510... | 0.75468254 | 2 |
The list of author names who wrote this gem. spec.authors = ['Chad Fowler', 'Jim Weirich', 'Rich Kilmer'] | def authors
@authors ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def author_names\n\t\treturn self.authors.map do |author|\n\t\t\tauthor[ /^(.*?) </, 1 ]\n\t\tend\n\tend",
"def authors\n @authors\n end",
"def authors\n @authors ||= pairs.keys.sort\n end",
"def author_info\n self.authors.map(&:full_name).join(', ')\n end",
"def get_authors\n ... | [
"0.74767274",
"0.7302743",
"0.72747225",
"0.710073",
"0.70587623",
"0.6966075",
"0.69392335",
"0.69082075",
"0.68883705",
"0.6820407",
"0.6815837",
"0.68119144",
"0.6809718",
"0.6797777",
"0.678676",
"0.67531174",
"0.67187744",
"0.6698552",
"0.6693947",
"0.65041506",
"0.64803... | 0.74372935 | 1 |
Returns the full path to installed gem's bin directory. NOTE: do not confuse this with +bindir+, which is just 'bin', not a full path. | def bin_dir
@bin_dir ||= File.join gem_dir, bindir
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_bindir\n cmd = shell_out!([new_resource.absolute_gem_binary, 'environment'])\n # Parse a line like:\n # - EXECUTABLE DIRECTORY: /usr/local/bin\n matches = cmd.stdout.scan(/EXECUTABLE DIRECTORY: (.*)$/).first\n if matches\n matches.first\n els... | [
"0.8167717",
"0.80327594",
"0.76693827",
"0.76693827",
"0.76312447",
"0.7603095",
"0.740995",
"0.74033105",
"0.73033005",
"0.73033005",
"0.73033005",
"0.70515895",
"0.69566303",
"0.69489956",
"0.6945308",
"0.6823404",
"0.68025124",
"0.6724133",
"0.65771556",
"0.65738994",
"0.... | 0.7684492 | 2 |
Returns the full path to an executable named +name+ in this gem. | def bin_file(name)
File.join bin_dir, name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_executable(name)\n @project.from_directory do\n Find.find(\"kit\") do |path|\n next unless path =~ /bin\\/#{name}$/\n\n log.debug(\"found #{name} executable: #{path}\")\n return path\n end\n end\n\n log.debug(\"#{name} executable not found\")\n ... | [
"0.7410499",
"0.7325603",
"0.72049594",
"0.6978869",
"0.6951482",
"0.68964684",
"0.6844962",
"0.6844962",
"0.68398726",
"0.66102284",
"0.6370168",
"0.63529885",
"0.6350456",
"0.6337093",
"0.6302415",
"0.62802565",
"0.6265818",
"0.62516594",
"0.62050635",
"0.61281735",
"0.6033... | 0.66752654 | 9 |
Returns the build_args used to install the gem | def build_args
if File.exist? build_info_file
build_info = File.readlines build_info_file
build_info = build_info.map {|x| x.strip }
build_info.delete ""
build_info
else
[]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collect_build_args\n build_flags = []\n\n build_flags << \"--HEAD\" if HEAD?\n build_flags << \"--universal\" if build_universal?\n build_flags << \"--build-bottle\" if build_bottle?\n build_flags << \"--build-from-source\" if build_from_source?\n\n build_flags\n ... | [
"0.74175733",
"0.6777194",
"0.6777039",
"0.6713279",
"0.65670097",
"0.6367902",
"0.6046877",
"0.6033468",
"0.5872944",
"0.5844399",
"0.5801444",
"0.5800321",
"0.5786157",
"0.5772834",
"0.57578266",
"0.5752963",
"0.5663593",
"0.56552166",
"0.56064826",
"0.5593801",
"0.55890566... | 0.66603315 | 4 |
Builds extensions for this platform if the gem has extensions listed and the gem.build_complete file is missing. | def build_extensions # :nodoc:
return if extensions.empty?
return if default_gem?
return if File.exist? gem_build_complete_path
return if !File.writable?(base_dir)
return if !File.exist?(File.join(base_dir, 'extensions'))
begin
# We need to require things in $LOAD_PATH without looking for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def missing_extensions?\n return false if extensions.empty?\n return false if default_gem?\n return false if File.exist? gem_build_complete_path\n\n true\n end",
"def gem_build_complete_path # :nodoc:\n File.join extension_dir, 'gem.build_complete'\n end",
"def setup_c_extension(extension_name... | [
"0.7239222",
"0.6423478",
"0.6151538",
"0.58882546",
"0.5863389",
"0.5805559",
"0.5805559",
"0.5805559",
"0.56670046",
"0.56331074",
"0.55690396",
"0.5566159",
"0.5533141",
"0.5533141",
"0.5514598",
"0.5514161",
"0.5502572",
"0.5496433",
"0.5460027",
"0.5454867",
"0.54082197"... | 0.80954534 | 0 |
Returns the full path to the build info directory | def build_info_dir
File.join base_dir, "build_info"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_info_file\n File.join build_info_dir, \"#{full_name}.info\"\n end",
"def build_dir\n File.expand_path(\"#{Config.build_dir}/#{project.name}\")\n end",
"def build_path\n @build_path ||= \"#{@ant_path}/#{@config[:build_name]}\"\n end",
"def build_path\n @build_path ||= Path... | [
"0.78966",
"0.7766446",
"0.7715264",
"0.76986444",
"0.76325524",
"0.74845314",
"0.74845314",
"0.7373608",
"0.72873664",
"0.7146513",
"0.71359587",
"0.71274",
"0.6989882",
"0.69453406",
"0.68333745",
"0.67941725",
"0.67584443",
"0.67584443",
"0.6718103",
"0.660602",
"0.6483559... | 0.90239835 | 0 |
Returns the full path to the file containing the build information generated when the gem was installed | def build_info_file
File.join build_info_dir, "#{full_name}.info"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_info_dir\n File.join base_dir, \"build_info\"\n end",
"def build\n\t@built_gem_path ||= @helper.build_gem\nend",
"def gem_build_complete_path # :nodoc:\n File.join extension_dir, 'gem.build_complete'\n end",
"def build_information_file\n dir = FilePath.new(@build_dir, \"cruisecontrol_int... | [
"0.75605464",
"0.71567065",
"0.70876676",
"0.70129883",
"0.67085826",
"0.66319185",
"0.6509923",
"0.6455464",
"0.6455464",
"0.64526474",
"0.642366",
"0.64113086",
"0.6362953",
"0.62907726",
"0.6289517",
"0.62859106",
"0.62759376",
"0.62730956",
"0.6267518",
"0.62668294",
"0.6... | 0.7663369 | 0 |
Returns the full path to the cache directory containing this spec's cached gem. | def cache_dir
@cache_dir ||= File.join base_dir, "cache"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_path\n Pathname.new(File.expand_path(File.join(ChefCLI::Helpers.package_home, \"cache\")))\n .join(\".cache\", \"git\", Digest::SHA1.hexdigest(uri))\n end",
"def cache_dir\n return pretty_path(File.join(Dir::COMMON_APPDATA, 'RightScale', 'cache'))\n end",
"def cache_r... | [
"0.845283",
"0.80261534",
"0.7956112",
"0.7936246",
"0.7805441",
"0.7760538",
"0.7721699",
"0.7720287",
"0.76551926",
"0.7626893",
"0.7619365",
"0.7610428",
"0.7563987",
"0.7557549",
"0.7524982",
"0.75204074",
"0.75204074",
"0.7516712",
"0.7500044",
"0.74605876",
"0.7440779",... | 0.7507433 | 18 |
Returns the full path to the cached gem for this spec. | def cache_file
@cache_file ||= File.join cache_dir, "#{full_name}.gem"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_path\n @path || downloaded_gem_path\n end",
"def gem_path\n @path || downloaded_gem_path\n end",
"def gemspec_cached_path(spec_file_name)\n paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }\n paths.find {|path| File.file? path }\n ... | [
"0.7716828",
"0.7706515",
"0.7493678",
"0.7262463",
"0.72343373",
"0.71818227",
"0.70966643",
"0.7052417",
"0.7052417",
"0.69745195",
"0.68762106",
"0.6839493",
"0.68060374",
"0.6792059",
"0.66898036",
"0.66847515",
"0.6676186",
"0.66592443",
"0.6652007",
"0.6646243",
"0.6627... | 0.7164376 | 6 |
Return any possible conflicts against the currently loaded specs. | def conflicts
conflicts = {}
self.runtime_dependencies.each do |dep|
spec = Gem.loaded_specs[dep.name]
if spec and not spec.satisfies_requirement? dep
(conflicts[spec] ||= []) << dep
end
end
env_req = Gem.env_requirement(name)
(conflicts[self] ||= []) << env_req unless env_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conflicts\n @conflicts ||= []\n end",
"def conflicts\n @conflicts ||= []\n end",
"def spec_set\n Bundler.locked_gems.specs\n end",
"def external_incompatibilities\n if conflict?\n [\n cause.conflict,\n cause.other\n ].flat_map(&:external_incomp... | [
"0.76543564",
"0.76543564",
"0.66567695",
"0.66272587",
"0.64776444",
"0.6368641",
"0.6310196",
"0.6285852",
"0.6285852",
"0.6285852",
"0.6103008",
"0.60997725",
"0.5994291",
"0.5979315",
"0.59699047",
"0.5965745",
"0.595479",
"0.5911542",
"0.5910154",
"0.58857054",
"0.587014... | 0.7055969 | 2 |
return true if there will be conflict when spec if loaded together with the list of specs. | def conficts_when_loaded_with?(list_of_specs) # :nodoc:
result = list_of_specs.any? do |spec|
spec.dependencies.any? {|dep| dep.runtime? && (dep.name == name) && !satisfies_requirement?(dep) }
end
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_spec_is?(spec)\n return false unless file_name_spec_set?\n spec = [spec] unless spec.is_a? Array\n spec = spec.flatten\n spec = spec.map do |spec|\n Noop::Utils.convert_to_spec spec\n end\n spec.any? do |spec|\n file_name_spec == spec\n end\n end",
... | [
"0.6879194",
"0.6841424",
"0.65848756",
"0.65630907",
"0.65630907",
"0.6530285",
"0.64077216",
"0.6333517",
"0.628167",
"0.6253348",
"0.6235524",
"0.61476576",
"0.60784054",
"0.6076085",
"0.6063316",
"0.60223293",
"0.59662217",
"0.59258",
"0.59016144",
"0.58834475",
"0.583719... | 0.7281558 | 0 |
Return true if there are possible conflicts against the currently loaded specs. | def has_conflicts?
return true unless Gem.env_requirement(name).satisfied_by?(version)
self.dependencies.any? do |dep|
if dep.runtime?
spec = Gem.loaded_specs[dep.name]
spec and not spec.satisfies_requirement? dep
else
false
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conficts_when_loaded_with?(list_of_specs) # :nodoc:\n result = list_of_specs.any? do |spec|\n spec.dependencies.any? {|dep| dep.runtime? && (dep.name == name) && !satisfies_requirement?(dep) }\n end\n result\n end",
"def candidates_exist_for_all_forced_changes?\n forced_packages_missing... | [
"0.72421914",
"0.7088645",
"0.707429",
"0.6978174",
"0.6940795",
"0.66473275",
"0.64549",
"0.64373773",
"0.6372519",
"0.634937",
"0.63470685",
"0.62589794",
"0.62589794",
"0.6247313",
"0.61886567",
"0.6170467",
"0.6092332",
"0.606129",
"0.6053477",
"0.60429084",
"0.60429084",... | 0.75043875 | 0 |
The date this gem was created. If SOURCE_DATE_EPOCH is set as an environment variable, use that to support reproducible builds; otherwise, default to the current UTC date. Details on SOURCE_DATE_EPOCH: | def date
@date ||= Time.utc(*Gem.source_date_epoch.utc.to_a[3..5].reverse)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date\n return @date if @date\n\n return Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime if ENV['SOURCE_DATE_EPOCH']\n\n return File.mtime(path) if File.exist?(path)\n\n Time.now\n end",
"def build_timestamp\n @build_timestamp\n end",
"def build_start_time\n @build_start_time |... | [
"0.74143505",
"0.6234359",
"0.61484975",
"0.5997721",
"0.59944683",
"0.5946482",
"0.5946482",
"0.5946482",
"0.5904312",
"0.58608896",
"0.58577466",
"0.58031875",
"0.57980037",
"0.57892823",
"0.5736597",
"0.57245624",
"0.571443",
"0.5679308",
"0.5679227",
"0.5666231",
"0.56639... | 0.76697457 | 0 |
The date this gem was created DO NOT set this, it is set automatically when the gem is packaged. | def date=(date)
# We want to end up with a Time object with one-day resolution.
# This is the cleanest, most-readable, faster-than-using-Date
# way to do it.
@date = case date
when String then
if DateTimeFormat =~ date
Time.utc($1.to_i, $2.to_i, $3.to_i)
else
raise(Gem::I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date\n self.publicized_or_packaged || super\n end",
"def date\n self.publicized_or_packaged || super\n end",
"def creation_date=(_); end",
"def date\n data[\"date\"] ||= (draft? ? source_file_mtime : site.time)\n end",
"def install_date\n in_service_date\n end",
"def date\n ... | [
"0.7232638",
"0.7232638",
"0.6844709",
"0.68098384",
"0.67937875",
"0.6735843",
"0.66489416",
"0.6634482",
"0.66237664",
"0.66114867",
"0.660138",
"0.660138",
"0.6569183",
"0.6496272",
"0.647436",
"0.64719844",
"0.64670527",
"0.6454449",
"0.6454449",
"0.6454449",
"0.6454449",... | 0.0 | -1 |
The default executable for this gem. Deprecated: The name of the gem is assumed to be the name of the executable now. See Gem.bin_path. | def default_executable # :nodoc:
if defined?(@default_executable) and @default_executable
result = @default_executable
elsif @executables and @executables.size == 1
result = Array(@executables).first
else
result = nil
end
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executable_path; end",
"def binary\n @binary ||= begin\n if brewed?\n # If the python is brewed we always prefer it!\n # Note, we don't support homebrew/versions/pythonXX.rb, though.\n Formula.factory(@name).opt_prefix/\"bin/python#{@min_version.major}\"\n else\n # Us... | [
"0.6506241",
"0.65061384",
"0.6351024",
"0.63106513",
"0.63026655",
"0.62938726",
"0.62931883",
"0.6292144",
"0.6278508",
"0.6278508",
"0.6278508",
"0.6262631",
"0.6222437",
"0.6199372",
"0.6172561",
"0.6160316",
"0.61562806",
"0.6119192",
"0.6108332",
"0.60803545",
"0.607400... | 0.75244385 | 0 |
The default value for specification attribute +name+ | def default_value(name)
@@default_value[name]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default(name,value)\n @network.spec_factory.defaults[name]=value\n end",
"def attr(name, default_value=:undefined)\n other_attrs[name] = Attr.new(name, default_value, @_current_desc)\n @_current_desc = nil\n _define_attr(name)\n end",
"def default\n attrib... | [
"0.7306999",
"0.7036556",
"0.70114654",
"0.69388634",
"0.6729359",
"0.67246073",
"0.6698558",
"0.6633355",
"0.66059643",
"0.65921664",
"0.6576238",
"0.6525432",
"0.6520971",
"0.6516546",
"0.64980614",
"0.64641654",
"0.6458371",
"0.64574254",
"0.64200205",
"0.64182305",
"0.641... | 0.7287327 | 1 |
A list of Gem::Dependency objects this gem depends on. Use add_dependency or add_development_dependency to add dependencies to a gem. | def dependencies
@dependencies ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependencies\n @dependencies.collect { |name, dependency| dependency }\n end",
"def dependencies\n version_req = if options[:version]\n ::Gem::Requirement.create(options[:version])\n else\n ::Gem::Requirement.default\n end\n if gem_dir\n ::Gem.clear_pa... | [
"0.7958951",
"0.7637144",
"0.75769776",
"0.75769776",
"0.75769776",
"0.75769776",
"0.75273323",
"0.7468037",
"0.73294693",
"0.72455704",
"0.7224574",
"0.71341956",
"0.71176237",
"0.7097456",
"0.6997121",
"0.69915795",
"0.6914663",
"0.6893045",
"0.6893045",
"0.6893045",
"0.689... | 0.7359819 | 8 |
Return a list of all gems that have a dependency on this gemspec. The list is structured with entries that conform to: [depending_gem, dependency, [list_of_gems_that_satisfy_dependency]] | def dependent_gems(check_dev=true)
out = []
Gem::Specification.each do |spec|
deps = check_dev ? spec.dependencies : spec.runtime_dependencies
deps.each do |dep|
if self.satisfies_requirement?(dep)
sats = []
find_all_satisfiers(dep) do |sat|
sats << sat
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_dependencies(list, gem_dependencies, options = {})\n gem_dependencies.each do |gd|\n if options['excludes'] && options['excludes'].to_s.split(',').include?(gd.name)\n next\n end\n\n gs = gd.matching_specs.first\n if gs\n unless list[gs.name]\... | [
"0.77196926",
"0.7295382",
"0.72311866",
"0.70432466",
"0.6970635",
"0.69426405",
"0.69245464",
"0.69088054",
"0.69084626",
"0.6842496",
"0.6817715",
"0.6813397",
"0.6741597",
"0.6709746",
"0.6705055",
"0.66989976",
"0.66911244",
"0.66709954",
"0.6645784",
"0.6619333",
"0.660... | 0.7723611 | 0 |
Returns all specs that matches this spec's runtime dependencies. | def dependent_specs
runtime_dependencies.map {|dep| dep.to_specs }.flatten
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def specs\n @specs ||= begin\n specs = resolve.materialize(requested_dependencies)\n\n all_dependencies = requested_dependencies.concat(specs.flat_map(&:dependencies))\n if all_dependencies.any? { |d| d.name == \"bundler\" } && !specs[\"bundler\"].any?\n bundler = sourc... | [
"0.7730806",
"0.7469615",
"0.7310479",
"0.7224647",
"0.7224647",
"0.71994454",
"0.7185859",
"0.71687204",
"0.7006178",
"0.6982965",
"0.69644445",
"0.6858082",
"0.682782",
"0.6710752",
"0.6631414",
"0.66263694",
"0.65902007",
"0.65831655",
"0.65802324",
"0.657385",
"0.657385",... | 0.8415499 | 0 |
A detailed description of this gem. See also summary | def description=(str)
@description = str.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description\n raise \"not implemented\"\n end",
"def description\n end",
"def description\n end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def description; end",
"def de... | [
"0.75116056",
"0.74454147",
"0.74454147",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.74436724",
"0.7371773",
"0.7371773",
"0.73036015",
"0.7277848",
"0.7241876",
"0.717101",
"0.7106885",
"0.... | 0.0 | -1 |
List of dependencies that are used for development | def development_dependencies
dependencies.select {|d| d.type == :development }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def development_dependencies\n Gem::Specification.load(gemspec_path.to_s).development_dependencies\n end",
"def dependencies\n []\n end",
"def dependencies\n []\n end",
"def fetch_development_dependencies # :nodoc:\n end",
"def dependencies\n []\n end",
"def depen... | [
"0.7992689",
"0.77386785",
"0.76294833",
"0.76257294",
"0.7608233",
"0.7427019",
"0.73974293",
"0.7385461",
"0.73493296",
"0.73493296",
"0.73493296",
"0.73493296",
"0.7309422",
"0.72918624",
"0.72758615",
"0.7266481",
"0.7188666",
"0.71545446",
"0.7110239",
"0.7087273",
"0.70... | 0.8594862 | 0 |
Returns the full path to this spec's documentation directory. If +type+ is given it will be appended to the end. For example: spec.doc_dir => "/path/to/gem_repo/doc/a1" spec.doc_dir 'ri' => "/path/to/gem_repo/doc/a1/ri" | def doc_dir(type = nil)
@doc_dir ||= File.join base_dir, 'doc', full_name
if type
File.join @doc_dir, type
else
@doc_dir
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def docpath\n return case type.to_sym\n when :constant, :module, :class\n (namespace.empty?) ? token.to_s : \"#{namespace}::#{token}\"\n when :class_method, :module_function\n \"#{namespace}.#{token}\"\n when :instance_method\n \"#{namespace}##{token}\"\n ... | [
"0.6488444",
"0.6101154",
"0.6101154",
"0.5968532",
"0.59576386",
"0.57460517",
"0.5743164",
"0.57260567",
"0.5613132",
"0.5599833",
"0.5530683",
"0.55271536",
"0.5496155",
"0.54738855",
"0.5461717",
"0.5448382",
"0.5444703",
"0.5443961",
"0.5338714",
"0.5330671",
"0.5301466"... | 0.8369116 | 0 |
Singular accessor for executables | def executable
val = executables and val.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executable_path=(_arg0); end",
"def executable_path; end",
"def executable?; true; end",
"def executable?; true; end",
"def executable_real?() end",
"def executable_code\n metadata_hash['executable']\n end",
"def executable?() end",
"def executable_prefix(specifier = nil)\n raise Exception... | [
"0.6320297",
"0.628562",
"0.6055949",
"0.6055949",
"0.6027481",
"0.59889334",
"0.59852386",
"0.58721536",
"0.5656388",
"0.56243616",
"0.56243616",
"0.5553511",
"0.55221677",
"0.55221677",
"0.55080944",
"0.5507883",
"0.54003",
"0.5367333",
"0.53463596",
"0.5338449",
"0.5338449... | 0.702247 | 0 |
Singular accessor for executables | def executable=(o)
self.executables = [o]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executable\n val = executables and val.first\n end",
"def executable_path=(_arg0); end",
"def executable_path; end",
"def executable?; true; end",
"def executable?; true; end",
"def executable_real?() end",
"def executable_code\n metadata_hash['executable']\n end",
"def executable?() end"... | [
"0.702247",
"0.6320297",
"0.628562",
"0.6055949",
"0.6055949",
"0.6027481",
"0.59889334",
"0.59852386",
"0.58721536",
"0.56243616",
"0.56243616",
"0.5553511",
"0.55221677",
"0.55221677",
"0.55080944",
"0.5507883",
"0.54003",
"0.5367333",
"0.53463596",
"0.5338449",
"0.5338449"... | 0.5656388 | 9 |
Sets executables to +value+, ensuring it is an array. | def executables=(value)
@executables = Array(value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executable=(o)\n self.executables = [o]\n end",
"def set(value)\n value.to_a\n end",
"def _set_value(value)\n if value.is_a? Array\n value.map do |v|\n v.is_a?(Taverna::Baclava::Node) ? v : Node.new(v)\n end\n else\n value.to_s\n ... | [
"0.6445983",
"0.55091935",
"0.5448938",
"0.5433677",
"0.5376182",
"0.53684676",
"0.536604",
"0.5292531",
"0.5263883",
"0.52347606",
"0.5233751",
"0.52200955",
"0.5187062",
"0.5160364",
"0.5158829",
"0.5136202",
"0.50608456",
"0.5038862",
"0.501979",
"0.49755228",
"0.49207732"... | 0.8006002 | 0 |
Sets extensions to +extensions+, ensuring it is an array. | def extensions=(extensions)
@extensions = Array extensions
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extensions=(extensions); end",
"def extension(*extensions)\n if extensions[0].is_a?(Array)\n @_ext = extensions[0]\n else\n @_ext = extensions\n end\n end",
"def extensions=(value)\n @extensions = value\n end",
"def extensi... | [
"0.78750813",
"0.7812076",
"0.7789109",
"0.7789109",
"0.7789109",
"0.72623855",
"0.72492564",
"0.71971",
"0.7170198",
"0.7123928",
"0.7123928",
"0.71230185",
"0.7091134",
"0.68305993",
"0.68305993",
"0.6705654",
"0.6705654",
"0.6650653",
"0.6590885",
"0.6542541",
"0.64931804"... | 0.84406877 | 0 |
Sets extra_rdoc_files to +files+, ensuring it is an array. | def extra_rdoc_files=(files)
@extra_rdoc_files = Array files
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extra_rdoc_files\n @extra_rdoc_files ||= []\n end",
"def files=(files)\n @files = Array files\n end",
"def normalize\n if defined?(@extra_rdoc_files) and @extra_rdoc_files\n @extra_rdoc_files.uniq!\n @files ||= []\n @files.concat(@extra_rdoc_files)\n end\n\n @files ... | [
"0.7272864",
"0.6687392",
"0.6370434",
"0.6319887",
"0.62963504",
"0.6204016",
"0.6204016",
"0.6127527",
"0.61129034",
"0.6078326",
"0.60617524",
"0.5694809",
"0.5694613",
"0.56851625",
"0.5684815",
"0.5653759",
"0.5611922",
"0.5603131",
"0.54850185",
"0.5461645",
"0.54487115... | 0.88096565 | 0 |
The default (generated) file name of the gem. See also spec_name. spec.file_name => "example1.0.gem" | def file_name
"#{full_name}.gem"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec_name\n \"#{full_name}.gemspec\"\n end",
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def name\n @name ||= Dir['*.gemspec'].firs... | [
"0.77973545",
"0.7795181",
"0.7795181",
"0.7795181",
"0.7795181",
"0.7629892",
"0.73950034",
"0.73677003",
"0.70375496",
"0.6900688",
"0.68557864",
"0.6811286",
"0.6806731",
"0.6757643",
"0.6746551",
"0.6736111",
"0.66751665",
"0.6597718",
"0.65625715",
"0.6518379",
"0.649339... | 0.8002654 | 0 |
Sets files to +files+, ensuring it is an array. | def files=(files)
@files = Array files
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def files= files\n @files = files\n end",
"def files= files\n @files = files\n end",
"def test_files=(files) # :nodoc:\n @test_files = Array files\n end",
"def files_array(files)\n return [] unless files\n files.is_a?(Array) ? files : pattern_to_filelist(files.to_s)\n end",
... | [
"0.76560545",
"0.76560545",
"0.75611705",
"0.7410021",
"0.7357725",
"0.7019844",
"0.68660134",
"0.65175307",
"0.64390004",
"0.6370169",
"0.6351024",
"0.6320473",
"0.62705773",
"0.6249393",
"0.6245408",
"0.6222346",
"0.6170422",
"0.61356",
"0.6119415",
"0.6118571",
"0.6090961"... | 0.8399263 | 0 |
Finds all gems that satisfy +dep+ | def find_all_satisfiers(dep)
Gem::Specification.each do |spec|
yield spec if spec.satisfies_requirement? dep
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependent_gems(check_dev=true)\n out = []\n Gem::Specification.each do |spec|\n deps = check_dev ? spec.dependencies : spec.runtime_dependencies\n deps.each do |dep|\n if self.satisfies_requirement?(dep)\n sats = []\n find_all_satisfiers(dep) do |sat|\n sats ... | [
"0.75803447",
"0.71221066",
"0.6960615",
"0.6836749",
"0.681254",
"0.678336",
"0.67713577",
"0.6700876",
"0.66962796",
"0.6690357",
"0.66709274",
"0.66686213",
"0.6629052",
"0.6615816",
"0.6601388",
"0.65546274",
"0.6535226",
"0.65262353",
"0.6525381",
"0.6514136",
"0.6496374... | 0.7758424 | 0 |
Creates a duplicate spec without large blobs that aren't used at runtime. | def for_cache
spec = dup
spec.files = nil
spec.test_files = nil
spec
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dup_fixture( name = :all_valid )\n fixture = prospects(:all_valid)\n fixture.directory_id = SecureRandom.hex\n fixture\n end",
"def purged_xml_for_clone\n local_structs_regex = []\n shape.local_structs.each do | struct |\n local_structs_regex << struct.name.underscore.downcase.dash... | [
"0.57659185",
"0.5586243",
"0.536432",
"0.53323114",
"0.520557",
"0.519714",
"0.5096927",
"0.508732",
"0.5080574",
"0.50080246",
"0.4992671",
"0.49721706",
"0.49602988",
"0.49544653",
"0.49479103",
"0.4945387",
"0.49075854",
"0.49061808",
"0.49061808",
"0.4903925",
"0.4893525... | 0.5714857 | 1 |
Work around bundler removing my methods | def gem_dir # :nodoc:
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bundle()\n puts \"TODO\"\n end",
"def ignore_method_conflicts; end",
"def run_bundle; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def libs; end",
"def run_bundle ; end",
"def run_bundle ; end",
"def library; end",
"def library; end",
... | [
"0.6909195",
"0.65914845",
"0.6315172",
"0.6299083",
"0.6299083",
"0.6299083",
"0.6299083",
"0.62580943",
"0.62457377",
"0.62457377",
"0.62428766",
"0.62428766",
"0.61322176",
"0.6122854",
"0.6121189",
"0.6081449",
"0.60799897",
"0.60606045",
"0.60606045",
"0.60606045",
"0.60... | 0.0 | -1 |
Deprecated and ignored, defaults to true. Formerly used to indicate this gem was RDoccapable. | def has_rdoc # :nodoc:
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deprecated?\n comment.include?(\"(Deprecated)\")\n end",
"def deprecated?\n false\n end",
"def completely_deprecated?\n @deprecated == :completely\n end",
"def deprecated?\n superseded_by.present?\n end",
"def change_deprecation_iff_user_requested\n return nil unl... | [
"0.74733377",
"0.74715984",
"0.69183445",
"0.6915677",
"0.68483895",
"0.673472",
"0.65794265",
"0.65769416",
"0.6471015",
"0.6470391",
"0.64558774",
"0.6453785",
"0.6447667",
"0.6394188",
"0.63853145",
"0.62524885",
"0.6221668",
"0.62164605",
"0.62007195",
"0.6197005",
"0.614... | 0.6836009 | 5 |
Deprecated and ignored. Formerly used to indicate this gem was RDoccapable. | def has_rdoc=(ignored) # :nodoc:
@has_rdoc = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_rdoc # :nodoc:\n true\n end",
"def doc; end",
"def doc; end",
"def doc; end",
"def doc; end",
"def legacy_rdoc *args\n args << @spec.rdoc_options\n args << '--quiet'\n args << @spec.require_paths.clone\n args << @spec.extra_rdoc_files\n args << '--title' << \"#{@spec.full_name}... | [
"0.71554625",
"0.7030193",
"0.7030193",
"0.7030193",
"0.7030193",
"0.6982485",
"0.679443",
"0.67634964",
"0.66025287",
"0.65901047",
"0.65901047",
"0.6488817",
"0.6440129",
"0.6440129",
"0.6440129",
"0.64263576",
"0.6275907",
"0.6275907",
"0.61967486",
"0.618336",
"0.6171201"... | 0.63577706 | 16 |
True if this gem has files in test_files | def has_unit_tests? # :nodoc:
not test_files.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_file?(path)\n @tests_files.include?(path)\n end",
"def has_tests?\n FileList[test_pattern].any?\n end",
"def installed?\n results = target_files.map {|f| is_my_file?(f) }\n return false if results.include? false\n return true\n end",
"def files_match?\n ... | [
"0.81662625",
"0.7950804",
"0.76714855",
"0.7308164",
"0.7131836",
"0.7095997",
"0.69110066",
"0.6905366",
"0.68521816",
"0.68352956",
"0.68249303",
"0.67881525",
"0.67856914",
"0.6753365",
"0.67518973",
"0.67403084",
"0.66874707",
"0.6684076",
"0.667764",
"0.6675359",
"0.665... | 0.8064769 | 1 |
Specification constructor. Assigns the default values to the attributes and yields itself for further initialization. Optionally takes +name+ and +version+. | def initialize(name = nil, version = nil)
super()
@gems_dir = nil
@base_dir = nil
@loaded = false
@activated = false
@loaded_from = nil
@original_platform = nil
@installed_by_version = nil
set_nil_attributes_to_nil
set_not_nil_attributes_to_default_valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec name, version, &block\n Gem::Specification.new name, v(version), &block\n end",
"def initialize(name, value = nil, specification: nil)\n fail 'Name cannot be nil' if name.nil?\n\n @name = name\n @value = value\n @attributes = Attributes.new\n @specification = specificati... | [
"0.7281655",
"0.7216812",
"0.71845734",
"0.70976627",
"0.6825308",
"0.66095054",
"0.66095054",
"0.66095054",
"0.6534856",
"0.6454138",
"0.64475447",
"0.6275753",
"0.62336695",
"0.6176665",
"0.61696535",
"0.6142012",
"0.6138602",
"0.6137559",
"0.611926",
"0.61092836",
"0.60909... | 0.6746562 | 5 |
Duplicates array_attributes from +other_spec+ so state isn't shared. | def initialize_copy(other_spec)
self.class.array_attributes.each do |name|
name = :"@#{name}"
next unless other_spec.instance_variable_defined? name
begin
val = other_spec.instance_variable_get(name)
if val
instance_variable_set name, val.dup
elsif Gem.configurat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extend_other(other)\n other.extend(Hash[removed_attributes.zip])\n end",
"def copy_attrs(other)\n (ActsAsArtifact::ARTIFACT_ATTRIBUTES + [:name, :requirement]).each do |attr|\n value = other.instance_variable_get(\"@#{attr}\")\n value = value.dup if value && !value.kind_o... | [
"0.62163115",
"0.61784405",
"0.6054322",
"0.5999586",
"0.5944261",
"0.59115255",
"0.58470076",
"0.5739642",
"0.57317424",
"0.56868106",
"0.5620311",
"0.55974233",
"0.55218005",
"0.5514171",
"0.55095065",
"0.544797",
"0.5398127",
"0.53880155",
"0.5383703",
"0.5373249",
"0.5366... | 0.6679951 | 0 |
Expire memoized instance variables that can incorrectly generate, replace or miss files due changes in certain attributes used to compute them. | def invalidate_memoized_attributes
@full_name = nil
@cache_file = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def memoized_methods\n @_memoized_methods ||= {}\n end",
"def expire_cache_for(class_name)\n self.class.reflections.each do |name, reflection|\n if reflection.options[:cached] and reflection.class_name == class_name\n cache_delete(reflection)\n end\n end\n ... | [
"0.65123636",
"0.648462",
"0.638144",
"0.6341784",
"0.62653404",
"0.61449814",
"0.6127409",
"0.609826",
"0.6079521",
"0.60396",
"0.6035939",
"0.5993971",
"0.5988231",
"0.59849185",
"0.59798056",
"0.5961815",
"0.5945742",
"0.592825",
"0.59197575",
"0.59129",
"0.59079593",
"0... | 0.76466435 | 0 |
Files in the Gem under one of the require_paths | def lib_files
@files.select do |file|
require_paths.any? do |path|
file.start_with? path
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def require_paths; end",
"def require_paths; end",
"def generate_require_paths; end",
"def require_files\n @load_paths.each do |path|\n Dir[\"#{path}/**/*\"].each do |f|\n require f\n end\n end\n end",
"def configured_require_paths; end",
"def add_gem_paths; end",
"d... | [
"0.742657",
"0.742657",
"0.7357182",
"0.7140601",
"0.7064362",
"0.69940513",
"0.6906241",
"0.68956363",
"0.68298644",
"0.67956924",
"0.67700446",
"0.67408377",
"0.6698807",
"0.6698176",
"0.66559625",
"0.66289586",
"0.6623141",
"0.6599965",
"0.657774",
"0.6564327",
"0.6563701"... | 0.7280128 | 3 |
Singular accessor for licenses | def license
licenses.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def license\n return self.licenses.first\n end",
"def license\n @licenses.first\n end",
"def license(name=nil)\n if name\n self.license = name\n else\n if copryrights.first\n copyrights.first.license\n end\n end\n end",
"def licenses\n ... | [
"0.7596561",
"0.7535177",
"0.74428535",
"0.7427285",
"0.73464763",
"0.7231737",
"0.72155905",
"0.7187257",
"0.71402687",
"0.7140113",
"0.70187396",
"0.70166105",
"0.70166105",
"0.6985789",
"0.6934023",
"0.6933006",
"0.6880181",
"0.6868798",
"0.68520063",
"0.6836044",
"0.68342... | 0.7864173 | 0 |
Plural accessor for setting licenses See license= for details | def licenses
@licenses ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def license=(o)\n self.licenses = [o]\n end",
"def licenses\n data[:licenses]\n end",
"def license=(value)\n @license = value\n end",
"def license name\n self.licenses << name.to_s\n end",
"def licenses=(licenses)\n @licenses = Array licenses\n end",
"def lic... | [
"0.71823585",
"0.71164423",
"0.70842624",
"0.6967353",
"0.6960962",
"0.6870291",
"0.68065196",
"0.68030506",
"0.67838305",
"0.6771008",
"0.67159075",
"0.6701774",
"0.6671348",
"0.66556627",
"0.6639536",
"0.65938956",
"0.6587418",
"0.65315366",
"0.6496023",
"0.6494854",
"0.644... | 0.68833846 | 5 |
Sets the rubygems_version to the current RubyGems version. | def mark_version
@rubygems_version = Gem::VERSION
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_version=(version)\n @gem_version = version\n end",
"def version=(version)\n @version = Gem::Version.create(version)\n # skip to set required_ruby_version when pre-released rubygems.\n # It caused to raise CircularDependencyError\n if @version.prerelease? && (@name.nil? || @name.strip ... | [
"0.72226256",
"0.6238584",
"0.6148308",
"0.5856879",
"0.5833394",
"0.5833394",
"0.5810042",
"0.5768405",
"0.5724517",
"0.5572845",
"0.55675125",
"0.5549174",
"0.5539304",
"0.5503671",
"0.54927415",
"0.54835284",
"0.5472053",
"0.5472053",
"0.5472053",
"0.5472053",
"0.5472053",... | 0.7232319 | 0 |
Track removed method calls to warn about during build time. Warn about unknown attributes while loading a spec. | def method_missing(sym, *a, &b) # :nodoc:
if REMOVED_METHODS.include?(sym)
removed_method_calls << sym
return
end
if @specification_version > CURRENT_SPECIFICATION_VERSION and
sym.to_s.end_with?("=")
warn "ignoring #{sym} loading #{full_name}" if $DEBUG
else
super
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ignore_method_conflicts; end",
"def ignore_unexpected_calls!\n return if @ignoring_unexpected_calls # do it once!\n\n @ignoring_unexpected_calls = true\n\n def self.method_missing(sym, *args)\n super if @expected_calls.has_key?(sym)\n end\n\n def self.respond_to?(sym)\n true\n end... | [
"0.62020075",
"0.61768514",
"0.6149045",
"0.60621065",
"0.60600096",
"0.59695464",
"0.59317",
"0.5880196",
"0.5875316",
"0.58592504",
"0.5756122",
"0.5714805",
"0.5704213",
"0.5688064",
"0.5684538",
"0.56791234",
"0.56778204",
"0.56243753",
"0.562343",
"0.56137604",
"0.558345... | 0.74641675 | 0 |
Is this specification missing its extensions? When this returns true you probably want to build_extensions | def missing_extensions?
return false if extensions.empty?
return false if default_gem?
return false if File.exist? gem_build_complete_path
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extensions_present?\n\t\treturn !self.extensions.empty?\n\tend",
"def supports_extensions?\n false\n end",
"def supports_extensions?\n false\n end",
"def specification_attached?\n self.eco_documents.detect { |d| d.specification? } != nil\n end",
"def complete?\n not @ex... | [
"0.78955007",
"0.74292827",
"0.74292827",
"0.7408829",
"0.7344359",
"0.71035576",
"0.7057708",
"0.7033296",
"0.6881547",
"0.6876644",
"0.68711054",
"0.68532",
"0.68532",
"0.68532",
"0.67339104",
"0.6674063",
"0.6674063",
"0.6646955",
"0.66356",
"0.6541938",
"0.6474091",
"0.... | 0.7706786 | 1 |
Normalize the list of files so that: All file lists have redundancies removed. Files referenced in the extra_rdoc_files are included in the package file list. | def normalize
if defined?(@extra_rdoc_files) and @extra_rdoc_files
@extra_rdoc_files.uniq!
@files ||= []
@files.concat(@extra_rdoc_files)
end
@files = @files.uniq if @files
@extensions = @extensions.uniq if @extensions
@test_files = @test_files.uniq if @test... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern && exclude_pattern =~ rel_file_name\n case type = File.stat(rel_file_name).ftype\n when \"file\"\n ... | [
"0.6843745",
"0.67348343",
"0.6713494",
"0.6509411",
"0.64122564",
"0.6386944",
"0.63603145",
"0.6288455",
"0.58288014",
"0.5791663",
"0.56672925",
"0.5623293",
"0.56085616",
"0.55985576",
"0.55948204",
"0.55906993",
"0.5578478",
"0.5567899",
"0.5558256",
"0.5550227",
"0.5548... | 0.80654854 | 0 |
Return a NameTuple that represents this Specification | def name_tuple
Gem::NameTuple.new name, version, original_platform
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n @spec['name']\n end",
"def name\n @spec['name']\n end",
"def name\n @spec.name\n end",
"def name\n spec.name\n end",
"def to_requirement_spec\n result = to_spec\n result = \"#{name} -> #{result}\" if name\n result = \"#{result} -> #{requirement}\" if ... | [
"0.6108634",
"0.6108634",
"0.6074727",
"0.59697956",
"0.5722728",
"0.5658365",
"0.56313926",
"0.5589741",
"0.54658127",
"0.5445797",
"0.53802526",
"0.5370584",
"0.5350941",
"0.5300766",
"0.52485013",
"0.51956016",
"0.51956016",
"0.51898015",
"0.5160584",
"0.50973165",
"0.5088... | 0.62143856 | 0 |
Returns the full name (nameversion) of this gemspec using the original platform. For use with legacy gems. | def original_name # :nodoc:
if platform == Gem::Platform::RUBY or platform.nil?
"#{@name}-#{@version}"
else
"#{@name}-#{@version}-#{@original_platform}"
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 full_name\n if platform == Gem::Platform::RUBY or platform.nil?\n \"#{name}-#{version}\".dup.tap(&Gem::UNTAI... | [
"0.8239578",
"0.80124485",
"0.76554716",
"0.75295216",
"0.7288384",
"0.7019976",
"0.6963128",
"0.6870691",
"0.68534434",
"0.6844013",
"0.67567307",
"0.6725258",
"0.6705543",
"0.6682421",
"0.6665975",
"0.66168505",
"0.66168505",
"0.66168505",
"0.66168505",
"0.65999687",
"0.659... | 0.84139526 | 0 |
The platform this gem runs on. See Gem::Platform for details. | def platform
@new_platform ||= Gem::Platform::RUBY
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform\n fetch('device.platform')\n end",
"def platform\n System::get_property('platform')\n end",
"def platform\n osver[0]\n end",
"def platform\n kernel.platform\n end",
"def platform\n RUBY_PLATFORM\n end",
"def platform\n @spec.platform\n end",
... | [
"0.8761049",
"0.8745602",
"0.8692734",
"0.8691554",
"0.86192465",
"0.8594889",
"0.85921067",
"0.85691065",
"0.85691065",
"0.85691065",
"0.85608625",
"0.8551531",
"0.8498512",
"0.84816724",
"0.83951694",
"0.8358833",
"0.83210796",
"0.8312681",
"0.8194624",
"0.8191278",
"0.8191... | 0.833062 | 16 |
Raise an exception if the version of this spec conflicts with the one that is already loaded (+other+) | def check_version_conflict(other) # :nodoc:
return if self.version == other.version
# This gem is already loaded. If the currently loaded gem is not in the
# list of candidate gems, then we have a version conflict.
msg = "can't activate #{full_name}, already activated #{other.full_name}"
e = Gem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_mismatch_detected\n end",
"def raise_if_conflicts # :nodoc:\n if has_conflicts?\n raise Gem::ConflictError.new self, conflicts\n end\n end",
"def raise_expected_version_error!\n self.raise_expected_version_error = true\n nil\n end",
"def merge_conflict?; en... | [
"0.6823861",
"0.66459817",
"0.6436269",
"0.5824174",
"0.5717348",
"0.5617557",
"0.5587979",
"0.554467",
"0.55251116",
"0.55046177",
"0.5501211",
"0.54873747",
"0.5414429",
"0.5397766",
"0.539138",
"0.5387272",
"0.53667665",
"0.5342542",
"0.5319369",
"0.52851236",
"0.5267334",... | 0.7845106 | 0 |
Check the spec for possible conflicts and freak out if there are any. | def raise_if_conflicts # :nodoc:
if has_conflicts?
raise Gem::ConflictError.new self, conflicts
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conflicts\n @conflicts ||= []\n end",
"def conflicts\n @conflicts ||= []\n end",
"def conflicts *syms\n syms.each { |sym| raise ArgumentError, \"unknown option '#{sym}'\" unless @specs[sym] }\n @constraints << [:conflicts, syms]\n end",
"def handle_incorrect_constraints(speci... | [
"0.6321798",
"0.6321798",
"0.62778175",
"0.6266193",
"0.6041026",
"0.59883916",
"0.5850254",
"0.58478147",
"0.58296126",
"0.57839787",
"0.5782041",
"0.5767645",
"0.5763935",
"0.57515895",
"0.5734027",
"0.56837094",
"0.5623876",
"0.5586989",
"0.55849737",
"0.5578406",
"0.55436... | 0.65367365 | 0 |
Sets rdoc_options to +value+, ensuring it is an array. | def rdoc_options=(options)
@rdoc_options = Array options
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_option(value)\r\n\t\tif value.is_a? Array\r\n\t\t\tvalue.each do |cur_value|\r\n\t\t\t\to_v = OptionValue.find(cur_value)\r\n\t\t\t\tself.line_item_option_values << LineItemOptionValue.new(:option_value => cur_value, :extra_cost => o_v.extra_cost, :extra_weight => o_v.extra_weight)\r\n\t\t\tend\r\n\t\telse... | [
"0.6137355",
"0.59404516",
"0.5686454",
"0.56401247",
"0.5627123",
"0.5614911",
"0.561372",
"0.5597855",
"0.5561064",
"0.55558413",
"0.5435883",
"0.5435883",
"0.53502107",
"0.53148466",
"0.52874094",
"0.525601",
"0.5223679",
"0.5217037",
"0.5215334",
"0.5205776",
"0.52046895"... | 0.70140934 | 0 |
Singular accessor for require_paths | def require_path
val = require_paths and val.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def require_paths\n @require_paths ||= data.require_paths\n end",
"def require_paths; end",
"def require_paths; end",
"def require_paths\n raise NotImplementedError\n end",
"def require_paths\n raw_data['require_paths'] || []\n end",
"def require_paths=(val)\n @require_paths = Arra... | [
"0.773584",
"0.7552832",
"0.7552832",
"0.7389002",
"0.7271765",
"0.7096937",
"0.70657194",
"0.696104",
"0.69123894",
"0.67036134",
"0.67036134",
"0.6695101",
"0.66807926",
"0.6678418",
"0.66602296",
"0.66595525",
"0.6658369",
"0.66202986",
"0.6593068",
"0.6593068",
"0.6593068... | 0.73090726 | 4 |
Singular accessor for require_paths | def require_path=(path)
self.require_paths = Array(path)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def require_paths\n @require_paths ||= data.require_paths\n end",
"def require_paths; end",
"def require_paths; end",
"def require_paths\n raise NotImplementedError\n end",
"def require_path\n val = require_paths and val.first\n end",
"def require_paths\n raw_data['require_paths'] || [... | [
"0.773584",
"0.7552832",
"0.7552832",
"0.7389002",
"0.73090726",
"0.7271765",
"0.7096937",
"0.70657194",
"0.696104",
"0.69123894",
"0.67036134",
"0.67036134",
"0.6695101",
"0.66807926",
"0.66602296",
"0.66595525",
"0.6658369",
"0.66202986",
"0.6593068",
"0.6593068",
"0.659306... | 0.6678418 | 14 |
Set requirements to +req+, ensuring it is an array. | def requirements=(req)
@requirements = Array req
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def requirements=(requirements)\n @table[:requirements] = Array(requirements)\n end",
"def exteneral_requirements=(requirements)\n @external_requirements = case requirements\n when Array\n requirements\n ... | [
"0.6584476",
"0.6310685",
"0.59663945",
"0.596302",
"0.5941853",
"0.59280384",
"0.591193",
"0.58898354",
"0.5862262",
"0.5757111",
"0.5673891",
"0.55001086",
"0.544492",
"0.54196644",
"0.5401128",
"0.5401128",
"0.53782886",
"0.53777635",
"0.5326941",
"0.53015524",
"0.52929074... | 0.81633717 | 0 |
Returns the full path to this spec's ri directory. | def ri_dir
@ri_dir ||= File.join base_dir, 'ri', full_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path\n @directory.path\n end",
"def rpath\n if (parent.nil? and domain) or (parent and parent.domain != domain)\n return ''\n else\n if parent\n rp = parent.rpath\n unless rp.blank?\n rp + '/' + path\n else\n path\n end\n else\n ... | [
"0.6649926",
"0.6634099",
"0.6533204",
"0.6511814",
"0.6473551",
"0.6463214",
"0.6420529",
"0.6420353",
"0.64073753",
"0.6385265",
"0.6340489",
"0.6334347",
"0.6306791",
"0.62920016",
"0.6283907",
"0.6273242",
"0.627166",
"0.6271017",
"0.6266511",
"0.6254197",
"0.6236622",
... | 0.81062627 | 0 |
Return a string containing a Ruby code representation of the given object. | def ruby_code(obj)
case obj
when String then obj.dump + ".freeze"
when Array then '[' + obj.map {|x| ruby_code x }.join(", ") + ']'
when Hash then
seg = obj.keys.sort.map {|k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" }
"{ #{seg.join(', ')} }"
when Ge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ruby_code(obj); end",
"def to_s\n @code.to_s\n end",
"def to_s\r\n code \r\n end",
"def to_s\n code.to_s\n end",
"def to_s\n \"#{@code}: #{@name}\"\n end",
"def to_s\n \"#{@code}: #{@name}\"\n end",
"def inspect\n @code.to_s\n end",
"def to_code\n \"#... | [
"0.755687",
"0.7174574",
"0.70903635",
"0.7075822",
"0.6948534",
"0.6948534",
"0.68201786",
"0.66650265",
"0.658853",
"0.658235",
"0.6526843",
"0.6497127",
"0.6476886",
"0.6443934",
"0.63869834",
"0.637501",
"0.637351",
"0.6333916",
"0.6331943",
"0.6288329",
"0.62881106",
"... | 0.7556969 | 0 |
List of dependencies that will automatically be activated at runtime. | def runtime_dependencies
dependencies.select(&:runtime?)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependencies\n []\n end",
"def dependencies\n []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n end",
"def dependencies\n @dependencies ||= []\n en... | [
"0.7987093",
"0.7953042",
"0.79258513",
"0.79258513",
"0.79258513",
"0.79258513",
"0.78514856",
"0.7835743",
"0.775329",
"0.75756073",
"0.75612646",
"0.7426518",
"0.7397999",
"0.73702544",
"0.73484766",
"0.73428315",
"0.7316716",
"0.7316716",
"0.7315318",
"0.71643174",
"0.711... | 0.7176168 | 19 |
True if this gem has the same attributes as +other+. | def same_attributes?(spec)
@@attributes.all? {|name, default| self.send(name) == spec.send(name) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n self.class.valid_attrs.each do |attr|\n return false if read(attr) != other.read(attr)\n end\n true\n end",
"def ==(other)\n self.attributes == (other.respond(:attributes) || {} )\n end",
"def ===(other)\n required = self.class.required_attributes\n\n other.respond_... | [
"0.7655818",
"0.7613076",
"0.75544363",
"0.7523971",
"0.7500686",
"0.7487041",
"0.74436116",
"0.7436066",
"0.7426612",
"0.74139434",
"0.74139434",
"0.74139434",
"0.7401444",
"0.7377545",
"0.7364556",
"0.7351519",
"0.7346899",
"0.7228285",
"0.71938723",
"0.7080071",
"0.7079749... | 0.70716465 | 21 |
Checks if this specification meets the requirement of +dependency+. | def satisfies_requirement?(dependency)
return @name == dependency.name &&
dependency.requirement.satisfied_by?(@version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_dependency?(dependency)\n !find(dependency).nil?\n end",
"def has_dependency?\n return true unless @dependency.nil?\n end",
"def matches_spec?(spec)\n @dependency.matches_spec? spec\n end",
"def satisfied_by?(spec)\n return false unless requirement\n spec = ArtifactNames... | [
"0.7074852",
"0.70280164",
"0.68615746",
"0.6758044",
"0.6721764",
"0.67039114",
"0.6690064",
"0.66754466",
"0.66293466",
"0.6623074",
"0.65596175",
"0.653758",
"0.65168446",
"0.64686763",
"0.6437893",
"0.6437893",
"0.63887495",
"0.63507056",
"0.6319887",
"0.63095784",
"0.628... | 0.8016094 | 0 |
Returns an object you can use to sort specifications in sort_by. | def sort_obj
[@name, @version, Gem::Platform.sort_priority(@new_platform)]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_by(*args, &blk)\n new(*args).order_by(&blk)\n end",
"def sort_by(&block)\n self.class.new(values: super)\n end",
"def order_by(&blk)\n OrderedCollection.new(@things.sort_by(&blk))\n end",
"def order_by(*args)\n clone.tap do |crit|\n arguments = args.size == 1 ? arg... | [
"0.69934106",
"0.6817193",
"0.6658975",
"0.6486079",
"0.6483544",
"0.6473429",
"0.6417652",
"0.6417652",
"0.63220763",
"0.62977695",
"0.6256127",
"0.6234844",
"0.6223403",
"0.621396",
"0.62034255",
"0.61982584",
"0.6158753",
"0.61331403",
"0.61139107",
"0.6104331",
"0.6082169... | 0.59678507 | 33 |
Used by Gem::Resolver to order Gem::Specification objects | def source # :nodoc:
Gem::Source::Installed.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_gemspecs\n Gem.source_index.map { |_, spec| spec }.sort { |a,b|\n\t(a.name <=> b.name).nonzero? || (b.version <=> a.version)\n }\n end",
"def sort_obj\n [@name, @version, Gem::Platform.sort_priority(@new_platform)]\n end",
"def dependency_order\n sorted = strongly_connected_compone... | [
"0.74317735",
"0.64741623",
"0.6089055",
"0.59861875",
"0.59138435",
"0.58532155",
"0.58352",
"0.5826056",
"0.58214796",
"0.5818752",
"0.5811477",
"0.5770754",
"0.5770754",
"0.5769195",
"0.5768775",
"0.5736224",
"0.5730981",
"0.57263124",
"0.57225627",
"0.57069904",
"0.569493... | 0.0 | -1 |
Returns the full path to the directory containing this spec's gemspec file. eg: /usr/local/lib/ruby/gems/1.8/specifications | def spec_dir
@spec_dir ||= File.join base_dir, "specifications"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gemspec_path\n Pathname.glob('*.gemspec').first\n end",
"def ruby_spec_path\n File.join(RAILS_ROOT, 'vendor/gems/ruby/specifications')\n end",
"def gemspec_path\n unless instance_variable_defined? :@gemspec\n path = \"#{name}.gemspec\"\n\n unless File.exist?(path)\n shell.say 'N... | [
"0.81653374",
"0.766749",
"0.74790287",
"0.7460543",
"0.74523324",
"0.7338839",
"0.7283435",
"0.720281",
"0.7175836",
"0.71711093",
"0.7158501",
"0.71417046",
"0.7139056",
"0.70925474",
"0.70925474",
"0.7061487",
"0.7060276",
"0.7060276",
"0.701811",
"0.70063406",
"0.7006021"... | 0.7910843 | 1 |
Returns the full path to this spec's gemspec file. eg: /usr/local/lib/ruby/gems/1.8/specifications/mygem1.0.gemspec | def spec_file
@spec_file ||= File.join spec_dir, "#{full_name}.gemspec"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gemspec_path\n Pathname.glob('*.gemspec').first\n end",
"def gemspec_path\n unless instance_variable_defined? :@gemspec\n path = \"#{name}.gemspec\"\n\n unless File.exist?(path)\n shell.say 'No gemspec found'\n exit 1\n end\n\n @gemspec_path = path\n end\n\n @ge... | [
"0.87667733",
"0.8336282",
"0.8213012",
"0.81728655",
"0.7616672",
"0.7556316",
"0.7542695",
"0.7530072",
"0.74875003",
"0.74870414",
"0.7451649",
"0.7408232",
"0.73654634",
"0.7307427",
"0.7292632",
"0.72401685",
"0.7215379",
"0.7215379",
"0.7197028",
"0.7139155",
"0.7056271... | 0.81941134 | 3 |
The default name of the gemspec. See also file_name spec.spec_name => "example1.0.gemspec" | def spec_name
"#{full_name}.gemspec"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend",
"def spec_file\n @spec_fi... | [
"0.76816756",
"0.76816756",
"0.76816756",
"0.76816756",
"0.738698",
"0.7069946",
"0.7021953",
"0.7012734",
"0.6942184",
"0.6749956",
"0.66289634",
"0.65700275",
"0.6561644",
"0.64882994",
"0.6381831",
"0.63208336",
"0.6296949",
"0.62846184",
"0.6276389",
"0.6222068",
"0.61796... | 0.824359 | 0 |
A short summary of this gem's description. | def summary=(str)
@summary = str.to_s.strip.
gsub(/(\w-)\n[ \t]*(\w)/, '\1\2').gsub(/\n[ \t]*/, " ") # so. weird.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description\n res = (@package.short_description ? @package.short_description : \"Description not available\") + \"\\n\"\n return res unless @package.long_description\n @package.long_description.each_line do |line|\n if line.strip.empty?\n res << \" .\\n\"\n else\n ... | [
"0.80672204",
"0.80286247",
"0.79605323",
"0.79605323",
"0.7868673",
"0.78162944",
"0.78162944",
"0.76615673",
"0.76405066",
"0.7632534",
"0.762972",
"0.7567887",
"0.7525547",
"0.7514789",
"0.74904555",
"0.74868274",
"0.7483072",
"0.7477034",
"0.7477034",
"0.7477034",
"0.7477... | 0.0 | -1 |
Singular accessor for test_files | def test_file # :nodoc:
val = test_files and val.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tests_for_file(filename)\n super.select { |f| @files.has_key? f }\n end",
"def test_files=(files) # :nodoc:\n @test_files = Array files\n end",
"def test_file=(file) # :nodoc:\n self.test_files = [file]\n end",
"def test_file1\n File.new(\"#{TEST_DIR}/fixtures/uploads/test_file1.txt\")\n ... | [
"0.7056515",
"0.6994836",
"0.6924959",
"0.682191",
"0.67913455",
"0.6781862",
"0.6572902",
"0.6557033",
"0.64838415",
"0.6482329",
"0.6482329",
"0.6482329",
"0.6482329",
"0.6482329",
"0.6482329",
"0.6274593",
"0.6259646",
"0.6259646",
"0.6259646",
"0.6213479",
"0.61804855",
... | 0.7125982 | 0 |
Singular mutator for test_files | def test_file=(file) # :nodoc:
self.test_files = [file]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_files=(files) # :nodoc:\n @test_files = Array files\n end",
"def test_files=(list)\n @test_files = list\n end",
"def tests_for_file(filename)\n super.select { |f| @files.has_key? f }\n end",
"def test_file1\n File.new(\"#{TEST_DIR}/fixtures/uploads/test_file1.txt\")\n end",
"de... | [
"0.767396",
"0.71746045",
"0.6566514",
"0.6254079",
"0.61816525",
"0.6139904",
"0.6110873",
"0.6008563",
"0.5985992",
"0.5982781",
"0.597181",
"0.595727",
"0.5937823",
"0.58924574",
"0.58924574",
"0.58821356",
"0.5881076",
"0.58746856",
"0.58706975",
"0.58486617",
"0.58459926... | 0.7638477 | 1 |
Test files included in this gem. You cannot append to this accessor, you must assign to it. | def test_files # :nodoc:
# Handle the possibility that we have @test_suite_file but not
# @test_files. This will happen when an old gem is loaded via
# YAML.
if defined? @test_suite_file
@test_files = [@test_suite_file].flatten
@test_suite_file = nil
end
if defined?(@test_files) and... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_file=(file) # :nodoc:\n self.test_files = [file]\n end",
"def before_load(test_files); end",
"def test_files=(files) # :nodoc:\n @test_files = Array files\n end",
"def test_files=(list)\n @test_files = list\n end",
"def test_can_add_paths_to_source_path\n Crd::Spec.new 'Testing'... | [
"0.69234645",
"0.6835627",
"0.67742354",
"0.6193917",
"0.60934556",
"0.60608315",
"0.59713465",
"0.5862085",
"0.5849716",
"0.5845976",
"0.5831079",
"0.5774191",
"0.5745249",
"0.57364124",
"0.5732595",
"0.57206935",
"0.56702244",
"0.56702244",
"0.5667967",
"0.56463546",
"0.563... | 0.65674585 | 3 |
Returns a Ruby code representation of this specification, such that it can be eval'ed and reconstruct the same specification later. Attributes that still have their default values are omitted. | def to_ruby
mark_version
result = []
result << "# -*- encoding: utf-8 -*-"
result << "#{Gem::StubSpecification::PREFIX}#{name} #{version} #{platform} #{raw_require_paths.join("\0")}"
result << "#{Gem::StubSpecification::PREFIX}#{extensions.join "\0"}" unless
extensions.empty?
result << nil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_definition(codeClass, cfg)\n readDef = String.new\n varArray = Array.new\n codeClass.getAllVarsFor(varArray);\n\n\treadDef << \"\\n\"\n\t\n readDef << \" public function create() {\\n\";\n readDef <<\n\t\t\t\"$serializer = JMS\\Serializer\\SerializerBuilder::create()->build();\n\t\t\t\... | [
"0.5763065",
"0.57055753",
"0.56512994",
"0.55945516",
"0.55880255",
"0.55681956",
"0.55659676",
"0.5531977",
"0.5524247",
"0.54898095",
"0.5465174",
"0.5461775",
"0.5447894",
"0.5447894",
"0.54242826",
"0.5404554",
"0.5387729",
"0.53784496",
"0.537207",
"0.5349822",
"0.53375... | 0.61951125 | 0 |
Returns a Ruby lighterweight code representation of this specification, used for indexing only. See to_ruby. | def to_ruby_for_cache
for_cache.to_ruby
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_ruby\n self\n end",
"def to_ruby\n self.class.to_ruby[@element_type.to_ruby]\n end",
"def to_ruby\n res = []\n res.push global_code unless global_code.empty?\n res.push \"control #{id.inspect} do\"\n res.push \" title #{title.inspect}\" unless title.to_s.empt... | [
"0.7076031",
"0.6700109",
"0.66224915",
"0.65309554",
"0.65267897",
"0.6511213",
"0.6508112",
"0.63950366",
"0.6389792",
"0.6374852",
"0.6344807",
"0.6341096",
"0.63407516",
"0.63386226",
"0.6247164",
"0.62281585",
"0.62244505",
"0.6185429",
"0.6157429",
"0.6138919",
"0.61297... | 0.5718927 | 48 |
Recursively walk dependencies of this spec, executing the +block+ for each hop. | def traverse(trail = [], visited = {}, &block)
trail.push(self)
begin
dependencies.each do |dep|
next unless dep.runtime?
dep.matching_specs(true).each do |dep_spec|
next if visited.has_key?(dep_spec)
visited[dep_spec] = true
trail.push(dep_spec)
beg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recursive_dependencies(&block)\n Dependency.expand(self, &block)\n end",
"def each_forward_dependency(&block)\n forward_dependencies.each(&block)\n end",
"def each_dependency(&block)\n return dependencies_enumerator if block.nil?\n\n dependencies_enumerator.each(&block)\n end",
"... | [
"0.6871152",
"0.67407846",
"0.66907555",
"0.59690857",
"0.5958219",
"0.58448434",
"0.5779989",
"0.5759745",
"0.5749141",
"0.5727519",
"0.56741077",
"0.56704813",
"0.56553406",
"0.56456226",
"0.5644051",
"0.5644051",
"0.5600899",
"0.55740803",
"0.5556719",
"0.550558",
"0.54942... | 0.68901575 | 0 |
Checks that the specification contains all required fields, and does a very basic sanity check. Raises InvalidSpecificationException if the spec does not pass the checks.. | def validate(packaging = true, strict = false)
normalize
validation_policy = Gem::SpecificationPolicy.new(self)
validation_policy.packaging = packaging
validation_policy.validate(strict)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_required!\n validate_nil_attributes\n\n validate_rubygems_version\n\n validate_required_attributes\n\n validate_name\n\n validate_require_paths\n\n @specification.keep_only_files_and_directories\n\n validate_non_files\n\n validate_self_inclusion_in_files_list\n\n validate_sp... | [
"0.7410317",
"0.67549163",
"0.6564448",
"0.65512794",
"0.64131165",
"0.64131165",
"0.64123887",
"0.63858116",
"0.63435215",
"0.6298133",
"0.6173891",
"0.61655617",
"0.61505425",
"0.61423945",
"0.61322033",
"0.6108019",
"0.6065716",
"0.6016765",
"0.6010369",
"0.60046124",
"0.5... | 0.5798076 | 37 |
Set the version to +version+, potentially also setting required_rubygems_version if +version+ indicates it is a prerelease. | def version=(version)
@version = Gem::Version.create(version)
# skip to set required_ruby_version when pre-released rubygems.
# It caused to raise CircularDependencyError
if @version.prerelease? && (@name.nil? || @name.strip != "rubygems")
self.required_rubygems_version = '> 1.3.1'
end
inv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version=(version)\n mutate_config(:version) { version.dup }\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def ... | [
"0.71095914",
"0.7074304",
"0.7074304",
"0.7074304",
"0.7074304",
"0.7074304",
"0.7074304",
"0.7074304",
"0.7074304",
"0.7074304",
"0.70165503",
"0.69651574",
"0.6961632",
"0.69430333",
"0.69097596",
"0.68839824",
"0.6883244",
"0.68235135",
"0.6713396",
"0.66146326",
"0.65759... | 0.8002484 | 0 |
Reset nil attributes to their default values to make the spec valid | def reset_nil_attributes_to_default
nil_attributes = self.class.non_nil_attributes.find_all do |name|
!instance_variable_defined?("@#{name}") || instance_variable_get("@#{name}").nil?
end
nil_attributes.each do |attribute|
default = self.default_value attribute
value = case default
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_default_attributes\n self.attributes = default_attributes\n self.attributes.each do |key, value|\n # Scrub the attributes if there's no value\n attr_clean!(key) unless value\n end\n end",
"def defaulted_attrs\n given_attrs.reject {|attr| send(\"given_#{a... | [
"0.7922061",
"0.72491777",
"0.7172684",
"0.68912745",
"0.68329465",
"0.67476714",
"0.6682934",
"0.6597607",
"0.6577076",
"0.6573354",
"0.6566299",
"0.65224946",
"0.65092635",
"0.6505077",
"0.64829856",
"0.64731264",
"0.6453238",
"0.64306474",
"0.6422499",
"0.6422499",
"0.6379... | 0.80331653 | 0 |
Constructs a dependency with +name+ and +requirements+. The last argument can optionally be the dependency type, which defaults to :runtime. | def initialize(name, *requirements)
case name
when String then # ok
when Regexp then
msg = ["NOTE: Dependency.new w/ a regexp is deprecated.",
"Dependency.new called from #{Gem.location_of_caller.join(":")}"]
warn msg.join("\n") unless Gem::Deprecate.skip
else
raise Argume... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependency name, version, type = :runtime\n raise \"Unknown dependency type: #{type}\" unless\n [:runtime, :dev, :development, :developer].include? type\n\n ary = if type == :runtime then\n extra_deps\n else\n extra_dev_deps\n end\n\n ary << [name, version]... | [
"0.699692",
"0.6474678",
"0.63284886",
"0.61119056",
"0.6077873",
"0.6036122",
"0.5954777",
"0.589545",
"0.5856594",
"0.58346736",
"0.58346736",
"0.5821633",
"0.5731927",
"0.56580144",
"0.56325126",
"0.55586976",
"0.55512",
"0.55267847",
"0.54670113",
"0.54437",
"0.53838027",... | 0.79413337 | 0 |
A dependency's hash is the XOR of the hashes of +name+, +type+, and +requirement+. | def hash # :nodoc:
name.hash ^ type.hash ^ requirement.hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash # :nodoc:\n identifier.hash ^ requirement.hash\n end",
"def external_dependency_checksum; end",
"def hash\n name.hash ^ version.hash\n end",
"def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",... | [
"0.74324983",
"0.63959634",
"0.62503374",
"0.61245036",
"0.6053182",
"0.5971398",
"0.59685373",
"0.5843891",
"0.5742342",
"0.5651583",
"0.56355023",
"0.5622002",
"0.55765647",
"0.55238783",
"0.55122685",
"0.54560983",
"0.5437216",
"0.54256433",
"0.5412078",
"0.5395979",
"0.53... | 0.798864 | 0 |
Does this dependency require a prerelease? | def prerelease?
@prerelease || requirement.prerelease?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_prerelease?(_)\n false\n end",
"def prerelease?\n comparable.prerelease?\n end",
"def prerelease?\n @prerelease ||= @version =~ /[a-zA-Z]/\n end",
"def prerelease?\n requirements.any? {|r| r.last.prerelease? }\n end",
"def test_method_prereleasep\n value_ = ::Ver... | [
"0.78548944",
"0.78216904",
"0.7723752",
"0.7702897",
"0.76625526",
"0.7607308",
"0.7373045",
"0.72939336",
"0.71536726",
"0.6972269",
"0.69373244",
"0.6910923",
"0.67992955",
"0.6780165",
"0.6685098",
"0.666964",
"0.6645401",
"0.66229004",
"0.6586515",
"0.657153",
"0.657153"... | 0.7951344 | 0 |
Is this dependency simply asking for the latest version of a gem? | def latest_version?
@requirement.none?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def outdated?\n if dependency.specific?\n ( latest_stable_version <=> dependency.to_version ) == OUTDATED_FLAG\n end\n end",
"def latest_version?\n if (res = _latest_version?)\n Gem.unversioned(@name)\n end\n res\n end",
"def latest_version?\n if (rval = super)... | [
"0.7588968",
"0.7537953",
"0.74585795",
"0.73920876",
"0.7203558",
"0.7198588",
"0.71259075",
"0.7045703",
"0.70136255",
"0.6997824",
"0.6986977",
"0.69658476",
"0.69658476",
"0.6926522",
"0.69255936",
"0.6921588",
"0.6885996",
"0.68072915",
"0.6775213",
"0.6775213",
"0.67752... | 0.7989585 | 1 |
What does this dependency require? | def requirement
return @requirement if defined?(@requirement) and @requirement
# @version_requirements and @version_requirement are legacy ivar
# names, and supported here because older gems need to keep
# working and Dependency doesn't implement marshal_dump and
# marshal_load. In a happier world,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conscientious_require; end",
"def dependencies; end",
"def dependencies; end",
"def dependencies; end",
"def direct_dependencies; end",
"def require_gems; end",
"def requirement\n @dependency.requirement\n end",
"def dependency_met?\n true\n end",
"def request_dependencies\n end",
... | [
"0.7869698",
"0.781279",
"0.781279",
"0.781279",
"0.7802842",
"0.69650674",
"0.6934281",
"0.68526024",
"0.68364197",
"0.6814587",
"0.6814587",
"0.6814587",
"0.6814587",
"0.6687384",
"0.651828",
"0.651828",
"0.64893675",
"0.64773875",
"0.64705634",
"0.6444536",
"0.6442847",
... | 0.5961842 | 74 |
Dependencies are ordered by name. | def <=>(other)
self.name <=> other.name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dependencies(name)\n dependencies = []\n submodule = submodule(name)\n if submodule.has_key?(:dependencies)\n submodule[:dependencies].each do |dependency|\n dependencies << dependency\n dependencies << dependencies(dependency)\n end\n end\n\n... | [
"0.75265443",
"0.7435082",
"0.72958434",
"0.728327",
"0.71809924",
"0.71624017",
"0.70634705",
"0.7051135",
"0.70043343",
"0.69396085",
"0.690279",
"0.68472123",
"0.6836774",
"0.68367547",
"0.68078965",
"0.68074805",
"0.679241",
"0.677842",
"0.67774624",
"0.67716235",
"0.6749... | 0.0 | -1 |
Uses this dependency as a pattern to compare to +other+. This dependency will match if the name matches the other's name, and other has only an equal version requirement that satisfies this dependency. | def =~(other)
unless Gem::Dependency === other
return unless other.respond_to?(:name) && other.respond_to?(:version)
other = Gem::Dependency.new other.name, other.version
end
return false unless name === other.name
reqs = other.requirement.requirements
return false unless reqs.length ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def =~(other)\n unless FoobarMod::Dependency === other\n return false unless other.respond_to?(:identifier) && other.respond_to?(:version)\n other = FoobarMod::Dependency.new other.identifier, other.version\n end\n\n return false unless identifier === other.identifier\n\n reqs = other.require... | [
"0.7522174",
"0.66565984",
"0.63404644",
"0.6176564",
"0.6122951",
"0.6122951",
"0.612271",
"0.6057647",
"0.6055577",
"0.6033155",
"0.59626824",
"0.5945738",
"0.59379864",
"0.59056383",
"0.5899025",
"0.5893676",
"0.58881265",
"0.58805776",
"0.5876614",
"0.5869537",
"0.5855072... | 0.7791151 | 0 |
:callseq: dep.match? name => true or false dep.match? name, version => true or false dep.match? spec => true or false Does this dependency match the specification described by +name+ and +version+ or match +spec+? NOTE: Unlike matches_spec? this method does not return true when the version is a prerelease version unles... | def match?(obj, version=nil, allow_prerelease=false)
if !version
name = obj.name
version = obj.version
else
name = obj
end
return false unless self.name === name
version = Gem::Version.new version
return true if requirement.none? and not version.prerelease?
return false ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matches_spec?(spec)\n return false unless name === spec.name\n return true if requirement.none?\n\n requirement.satisfied_by?(spec.version)\n end",
"def matches_spec? spec\n name == spec.name and requirement.satisfied_by? spec.version\n end",
"def gem_dep_matches?(what, version, *deps)\n... | [
"0.82987547",
"0.8256891",
"0.76499516",
"0.7590807",
"0.758648",
"0.7129519",
"0.70737493",
"0.6995066",
"0.66988164",
"0.66988164",
"0.6689681",
"0.6638283",
"0.6532412",
"0.65109277",
"0.6422931",
"0.64115673",
"0.62552756",
"0.6245996",
"0.62283343",
"0.6223544",
"0.61506... | 0.7000951 | 7 |
Does this dependency match +spec+? NOTE: This is not a convenience method. Unlike match? this method returns true when +spec+ is a prerelease version even if this dependency is not a prerelease dependency. | def matches_spec?(spec)
return false unless name === spec.name
return true if requirement.none?
requirement.satisfied_by?(spec.version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matches_spec?(spec)\n @dependency.matches_spec? spec\n end",
"def match?(spec, allow_prerelease = false)\n @dependency.match? spec, nil, allow_prerelease\n end",
"def matches_spec? spec\n name == spec.name and requirement.satisfied_by? spec.version\n end",
"def satisfied_by?(spec)\n ... | [
"0.8540654",
"0.850564",
"0.80981857",
"0.77910256",
"0.7433975",
"0.7433975",
"0.695977",
"0.68220234",
"0.6707611",
"0.66986",
"0.6573794",
"0.65141577",
"0.6467292",
"0.64121807",
"0.6406172",
"0.63655114",
"0.6348698",
"0.6336519",
"0.62668455",
"0.62582535",
"0.616948",
... | 0.829287 | 2 |
Merges the requirements of +other+ into this dependency | def merge(other)
unless name == other.name
raise ArgumentError,
"#{self} and #{other} have different names"
end
default = Gem::Requirement.default
self_req = self.requirement
other_req = other.requirement
return self.class.new name, self_req if other_req == default
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge(other)\n unless identifier == other.identifier\n raise ArgumentError,\n \"#{self} and #{other} have different identifiers\"\n end\n\n default = FoobarMod::Requirement.default\n self_req = self.requirement\n other_req = other.requirement\n\n return self.class.new identif... | [
"0.76151264",
"0.68907845",
"0.6736544",
"0.669614",
"0.66470814",
"0.6646401",
"0.66015303",
"0.6512081",
"0.6506849",
"0.6484463",
"0.64837724",
"0.6474116",
"0.64274263",
"0.6420128",
"0.6398535",
"0.63901633",
"0.6386817",
"0.6381776",
"0.63467443",
"0.632681",
"0.6319516... | 0.7795957 | 0 |
True if the dependency will not always match the latest version. | def specific?
@requirement.specific?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def outdated?\n if dependency.specific?\n ( latest_stable_version <=> dependency.to_version ) == OUTDATED_FLAG\n end\n end",
"def latest_version?\n @requirement.none?\n end",
"def latest_version?\n @requirement.none?\n end",
"def require_matched_dependency_version\n false... | [
"0.8437703",
"0.81126064",
"0.81126064",
"0.7887303",
"0.77364755",
"0.7533298",
"0.7519128",
"0.74178314",
"0.74178314",
"0.7379476",
"0.7301401",
"0.71862817",
"0.717191",
"0.71715385",
"0.70502687",
"0.7031525",
"0.70265865",
"0.70228726",
"0.69782597",
"0.6910946",
"0.690... | 0.0 | -1 |
Register a Gem::Specification for default gem. Two formats for the specification are supported: MRI 2.0 style, where spec.files contains unprefixed require names. The spec's filenames will be registered asis. New style, where spec.files contains files prefixed with paths from spec.require_paths. The prefixes are stripp... | def register_default_spec(spec)
extended_require_paths = spec.require_paths.map {|f| f + "/" }
new_format = extended_require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
if new_format
prefix_group = extended_require_paths.join("|")
prefix_pattern = /^(#{prefix_group}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_spec(gem_spec, name = T.unsafe(nil)); end",
"def add_spec(gem_spec)\n @gems[gem_spec.full_name] = gem_spec\n end",
"def gemspec\n @gemspec ||= begin\n raise Error.new(\"Unable to automatically determine gem name from specs in #{base}. Please set the gem name via #{self.class.name}.i... | [
"0.65851974",
"0.6427081",
"0.6071915",
"0.5910308",
"0.590007",
"0.5854085",
"0.58534116",
"0.5802796",
"0.57821476",
"0.5772949",
"0.5706859",
"0.56968284",
"0.5678579",
"0.56411",
"0.55570954",
"0.553088",
"0.55030745",
"0.55030745",
"0.5488882",
"0.5476791",
"0.5458224",
... | 0.77982825 | 0 |
Find a Gem::Specification of default gem from +path+ | def find_unresolved_default_spec(path)
default_spec = @path_to_default_spec_map[path]
return default_spec if default_spec && loaded_specs[default_spec.name] != default_spec
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gemspec(path)\n installed_gemspec(path) || local_gemspec(path)\n end",
"def find(path)\n @gemspecs.each do |spec|\n return spec if matching_file(spec, path)\n end\n nil\n end",
"def find_gemspec(name, path) # :nodoc:\n glob = File.join path, \"#{name}.gemspec\"\n\n ... | [
"0.7383685",
"0.72964406",
"0.7293397",
"0.7165166",
"0.7110603",
"0.6975313",
"0.687133",
"0.6834393",
"0.6424211",
"0.6424211",
"0.6397879",
"0.6379975",
"0.6326812",
"0.6326442",
"0.6318725",
"0.6226789",
"0.6226522",
"0.62255394",
"0.6218505",
"0.6170396",
"0.6133591",
... | 0.71049464 | 5 |
Clear default gem related variables. It is for test | def clear_default_specs
@path_to_default_spec_map.clear
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_gem_specs!\n return unless Gem.loaded_specs.keys.include?('locomotivecms_wagon')\n\n core_gems = %w(did_you_mean).freeze\n\n Gem.loaded_specs.values.each do |spec|\n next if core_gems.include?(spec.name)\n spec.full_require_paths.each do |path|\n $LOAD_PATH.delete(path)\n end\n\n # Wi... | [
"0.700801",
"0.6844291",
"0.6735328",
"0.6693545",
"0.6616834",
"0.6581971",
"0.650196",
"0.64936495",
"0.6466409",
"0.6450064",
"0.6421074",
"0.6421074",
"0.6405372",
"0.63591194",
"0.6356471",
"0.6344565",
"0.62854373",
"0.6277454",
"0.62709165",
"0.6257035",
"0.6250949",
... | 0.6684739 | 4 |
:nodoc: Constructor. Takes a single argument which is to be treated like a hashtable, or defaults to ENV, the system environment. | def initialize(env)
@home = env["GEM_HOME"] || Gem.default_dir
if File::ALT_SEPARATOR
@home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
end
@home = expand(@home)
@path = split_gem_path env["GEM_PATH"], @home
@spec_cache_dir = env["GEM_SPEC_CACHE"] || Gem.default_spec_cache_dir
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(*args)\n @env = args.first\n end",
"def initialize(params = nil)\n @env = Hash.new\n unless params.nil?\n params.each_pair { |var, typ|\n @env[var] = {type: typ, fixed: true}\n }\n end\n end",
"def initialize(env={})\n @env = env\n ... | [
"0.73962545",
"0.72701824",
"0.7244341",
"0.69231564",
"0.69231564",
"0.6885112",
"0.67634183",
"0.67232394",
"0.65996194",
"0.6565119",
"0.6565119",
"0.6562326",
"0.65244824",
"0.65230674",
"0.6521824",
"0.6512433",
"0.6512433",
"0.6512433",
"0.648129",
"0.6376421",
"0.63724... | 0.0 | -1 |
Split the Gem search path (as reported by Gem.path). | def split_gem_path(gpaths, home)
# FIX: it should be [home, *path], not [*path, home]
gem_path = []
if gpaths
gem_path = gpaths.split(Gem.path_separator)
# Handle the path_separator being set to a regexp, which will cause
# end_with? to error
if gpaths =~ /#{Gem.path_separator}\z/
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendored_path_parts(package)\n return if package.nil? || package[\"Dir\"].nil?\n package[\"Dir\"].match(/^(?<vendor_path>#{config.root}(\\/.+)*\\/[^\\/]*vendor[^\\/]*)\\/(?<import_path>.+)$/i)\n end",
"def get_gem_home_root(arr)\n gem_string = \"/gems/\"\n ret = nil\n arr.each do ... | [
"0.7101855",
"0.70657897",
"0.6959767",
"0.682456",
"0.66034937",
"0.6354039",
"0.63026565",
"0.6036006",
"0.6017892",
"0.5980781",
"0.5926944",
"0.5886906",
"0.5886459",
"0.5856541",
"0.5851115",
"0.5811356",
"0.5780702",
"0.5779156",
"0.57435656",
"0.5723514",
"0.5723514",
... | 0.76253134 | 0 |
Return the default Gem path | def default_path
Gem.default_path + [@home]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_dir\n return force_gem_dir if force_gem_dir\n if File.directory?(dir = default_gem_dir)\n dir\n end\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 ... | [
"0.77889735",
"0.7462937",
"0.7406949",
"0.729505",
"0.72738755",
"0.71688145",
"0.716692",
"0.7101116",
"0.7098283",
"0.7098283",
"0.70637846",
"0.7027109",
"0.70152456",
"0.70152456",
"0.6992932",
"0.6946804",
"0.69418347",
"0.69295317",
"0.68354076",
"0.6796167",
"0.677156... | 0.86196834 | 0 |
Example: x.foo ^^^^ x.foo(42) ^^^^ x&.foo ^^^^^ x[42] ^^^^ x += 1 ^ | def spot_call_for_name
nd_recv, mid, nd_args = @node.children
lineno = nd_recv.last_lineno
lines = @fetch[lineno, @node.last_lineno]
if mid == :[] && lines.match(/\G[\s)]*(\[(?:\s*\])?)/, nd_recv.last_column)
@beg_column = $~.begin(1)
@snippet = lines[/.*\n/]
@beg_lineno ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def [](i); @x[i]; end",
"def tricky_method(a_string_param, an_array_param)\n a_string_param << \"rutabaga\" #originally +=. shovel operator modifies original object. \n an_array_param << \"rutabaga\" #(\"mutates the caller)\"\nend",
"def x; self[X]; end",
"def x; self[X]; end",
"def x; self[X]; end",
"... | [
"0.6021213",
"0.5976177",
"0.59271854",
"0.59271854",
"0.59271854",
"0.59006757",
"0.57746345",
"0.5767622",
"0.5742585",
"0.56485665",
"0.5635188",
"0.5625272",
"0.5613845",
"0.5596117",
"0.5556101",
"0.55480045",
"0.55199665",
"0.55099964",
"0.5500932",
"0.54806376",
"0.546... | 0.0 | -1 |
Example: x.foo(42) ^^ x[42] ^^ x += 1 ^ | def spot_call_for_args
_nd_recv, _mid, nd_args = @node.children
if nd_args && nd_args.first_lineno == nd_args.last_lineno
fetch_line(nd_args.first_lineno)
@beg_column = nd_args.first_column
@end_column = nd_args.last_column
end
# TODO: support @arg
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def [](i); @x[i]; end",
"def []=(index, value)\n %x{\n var size = #{self}.length;\n\n if (index < 0) {\n index += size;\n }\n\n return #{self}[index] = value;\n }\n end",
"def my_array_modification_method!(source, thing_to_modify)\n source.each_index do |x|\n if (sourc... | [
"0.63160485",
"0.6301655",
"0.62508696",
"0.6207871",
"0.6207871",
"0.6207871",
"0.61639726",
"0.6135456",
"0.613243",
"0.6089326",
"0.6083988",
"0.6080942",
"0.60518503",
"0.60462415",
"0.6026267",
"0.5988162",
"0.5977654",
"0.59662366",
"0.59536976",
"0.59194297",
"0.590728... | 0.0 | -1 |
Example: x.foo = 1 ^^^^^^ x[42] = 1 ^^^^^^ | def spot_attrasgn_for_name
nd_recv, mid, nd_args = @node.children
*nd_args, _nd_last_arg, _nil = nd_args.children
fetch_line(nd_recv.last_lineno)
if mid == :[]= && @snippet.match(/\G[\s)]*(\[)/, nd_recv.last_column)
@beg_column = $~.begin(1)
args_last_column = $~.end(0)
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def [](i); @x[i]; end",
"def x; self[X]; end",
"def x; self[X]; end",
"def x; self[X]; end",
"def [](x)\n @data[x]\n end",
"def [](name); end",
"def [](name); end",
"def [](name); end",
"def [](name); end",
"def [](name); end",
"def [](field_name); end",
"def [](value); end",
"def [](in... | [
"0.6974809",
"0.6910038",
"0.6910038",
"0.6910038",
"0.681633",
"0.6693356",
"0.6693356",
"0.6693356",
"0.6693356",
"0.6693356",
"0.66302186",
"0.6614658",
"0.6570043",
"0.6517165",
"0.6502373",
"0.64809406",
"0.6390181",
"0.6384392",
"0.63792014",
"0.6361625",
"0.6361625",
... | 0.0 | -1 |
Example: x.foo = 1 ^ x[42] = 1 ^^^^^^^ x[] = 1 ^^^^^ | def spot_attrasgn_for_args
nd_recv, mid, nd_args = @node.children
fetch_line(nd_recv.last_lineno)
if mid == :[]= && @snippet.match(/\G[\s)]*\[/, nd_recv.last_column)
@beg_column = $~.end(0)
if nd_recv.last_lineno == nd_args.last_lineno
@end_column = nd_args.last_column
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def [](i); @x[i]; end",
"def [](expression); end",
"def x; self[X]; end",
"def x; self[X]; end",
"def x; self[X]; end",
"def [](idx)\n Ruby.primitive :array_aref\n end",
"def []=(*) end",
"def [](*) end",
"def [](p0) end",
"def [](p0) end",
"def [](value); end",
"def x() self[0]; end",
... | [
"0.66636974",
"0.64202",
"0.63021284",
"0.63021284",
"0.63021284",
"0.6298006",
"0.62553686",
"0.61613655",
"0.6160083",
"0.6160083",
"0.6151801",
"0.59278554",
"0.587312",
"0.5866468",
"0.583261",
"0.582781",
"0.57937825",
"0.57477164",
"0.57436496",
"0.57436496",
"0.5737992... | 0.0 | -1 |
Example: x + 1 ^ +x ^ | def spot_opcall_for_name
nd_recv, op, nd_arg = @node.children
fetch_line(nd_recv.last_lineno)
if nd_arg
# binary operator
if @snippet.match(/\G[\s)]*(#{ Regexp.quote(op) })/, nd_recv.last_column)
@beg_column = $~.begin(1)
@end_column = $~.end(1)
end
el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ^(p0) end",
"def ^(p0) end",
"def ^(p0) end",
"def ^(p0) end",
"def ^(p0) end",
"def ^(pow)\r\n\t\tpower(pow)\r\n\tend",
"def single_number(nums)\n nums.reduce(&:^)\n #亦可 nums.reduce(:^)\nend",
"def single_number(nums)\n nums.reduce(:^) # { |memo, num| memo ^ num }\nend",
"def expression\n ... | [
"0.73372364",
"0.73372364",
"0.73372364",
"0.73372364",
"0.73372364",
"0.70611984",
"0.65649915",
"0.64192283",
"0.636158",
"0.62874275",
"0.62747705",
"0.62316144",
"0.62316144",
"0.62316144",
"0.6230464",
"0.6200806",
"0.61878544",
"0.6187768",
"0.6155719",
"0.612592",
"0.6... | 0.0 | -1 |
Example: x + 1 ^ | def spot_opcall_for_args
_nd_recv, _op, nd_arg = @node.children
if nd_arg && nd_arg.first_lineno == nd_arg.last_lineno
# binary operator
fetch_line(nd_arg.first_lineno)
@beg_column = nd_arg.first_column
@end_column = nd_arg.last_column
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ^(p0) end",
"def ^(p0) end",
"def ^(p0) end",
"def ^(p0) end",
"def ^(p0) end",
"def ^(pow)\r\n\t\tpower(pow)\r\n\tend",
"def ^(arg0)\n end",
"def ^(arg0)\n end",
"def ^(arg0)\n end",
"def do_something (arg1, arg2, arg3)\n\n\targ1^arg2^arg3\nend",
"def * x; operation(:*, 2, \"x\", x); en... | [
"0.7480456",
"0.7480456",
"0.7480456",
"0.7480456",
"0.7480456",
"0.723436",
"0.66736305",
"0.66736305",
"0.66736305",
"0.6454238",
"0.6440809",
"0.6423772",
"0.64233",
"0.6419981",
"0.64152694",
"0.6386414",
"0.6386222",
"0.63775617",
"0.63567823",
"0.63145924",
"0.63145924"... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.