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 |
|---|---|---|---|---|---|---|
Whether this specification is stubbed i.e. we have information about the gem from a stub line, without having to evaluate the entire gemspec file. | def stubbed?
raise NotImplementedError
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stubbed?\n !@stubs.empty?\n end",
"def stubbed?\n data.is_a? StubLine\n end",
"def stub?\n self.status == :stub\n end",
"def is_stub?\n is_registered == false\n end",
"def spec_stubs?\n @config.files.copy.any? { |f, _| f.start_with?(STUBS_FOLDER) } \\\n || @c... | [
"0.75910753",
"0.75494343",
"0.7337757",
"0.70907325",
"0.70209634",
"0.6629",
"0.65402514",
"0.6517656",
"0.6174498",
"0.61116946",
"0.6106911",
"0.6106911",
"0.60500187",
"0.60500187",
"0.60500187",
"0.60483474",
"0.59720737",
"0.5937279",
"0.5911833",
"0.5892476",
"0.58900... | 0.68268645 | 5 |
True when this gem has been activated | def activated?
@activated ||=
begin
loaded = Gem.loaded_specs[name]
loaded && loaded.version == version
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activated?\n loaded = Gem.loaded_specs[name]\n loaded && loaded.version == version\n end",
"def activate\n true\n end",
"def activate\n other = Gem.loaded_specs[self.name]\n if other\n check_version_conflict other\n return false\n end\n\n raise_if_conflicts\n\n a... | [
"0.7663147",
"0.7585725",
"0.7441279",
"0.7041353",
"0.6940641",
"0.68653727",
"0.68168914",
"0.68168914",
"0.6702041",
"0.6681493",
"0.6679804",
"0.66702014",
"0.66682446",
"0.6662765",
"0.66292334",
"0.66233134",
"0.66154104",
"0.66154104",
"0.6598707",
"0.65948",
"0.658629... | 0.81292176 | 0 |
If the gemspec contains a stubline, returns a StubLine instance. Otherwise returns the full Gem::Specification. | def data
unless @data
begin
saved_lineno = $.
Gem.open_file loaded_from, OPEN_MODE do |file|
begin
file.readline # discard encoding line
stubline = file.readline.chomp
if stubline.start_with?(PREFIX)
extensions = if /\A#{PREFIX}/ =~ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_spec\n Gem::Specification === @spec ? @spec : @spec.spec\n end",
"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.p... | [
"0.67114204",
"0.6236067",
"0.61631143",
"0.6049775",
"0.59067684",
"0.58721906",
"0.58514786",
"0.58098024",
"0.5778066",
"0.5776271",
"0.57648224",
"0.56992966",
"0.56552976",
"0.55720836",
"0.5550802",
"0.54791135",
"0.54410636",
"0.5419413",
"0.5399714",
"0.53910166",
"0.... | 0.60283536 | 4 |
Name of the gem | def name
data.name
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
data.platform
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.76490337",
"0.76490337",
"0.763814",
"0.76323134",
"0.75423443",
"0.7526862",
"0.7494673",
"0.7494673",
"0.746945",
"0.7465693",
"0.7465693",
"0.7465693",
... | 0.7442732 | 23 |
Extensions for this gem | def extensions
data.extensions
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extension; end",
"def extension; end",
"def extension; end",
"def extension; end",
"def extensions; end",
"def extensions; end",
"def extensions; end",
"def extended(*) end",
"def ext; end",
"def ext; end",
"def init_ext()\n \n end",
"def extended_modules; end",
"def extension... | [
"0.7483241",
"0.7483241",
"0.7483241",
"0.7483241",
"0.73046",
"0.73046",
"0.73046",
"0.72822833",
"0.72599804",
"0.72599804",
"0.70488846",
"0.6733662",
"0.66858006",
"0.6523625",
"0.6523625",
"0.64928186",
"0.64904785",
"0.64904785",
"0.6364714",
"0.63553226",
"0.6257581",
... | 0.0 | -1 |
Version of the gem | def version
data.version
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.7571417 | 89 |
The full Gem::Specification for this gem, loaded from evalling its gemspec | def to_spec
@spec ||= if @data
loaded = Gem.loaded_specs[name]
loaded if loaded && loaded.version == version
end
@spec ||= Gem::Specification.load(loaded_from)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_spec\n Gem::Specification === @spec ? @spec : @spec.spec\n end",
"def gem_spec\n if @gem_spec.nil?\n unless @gem_spec = Micro::Source.gem_spec(@name, @version_requirements.version)\n raise Micro::GemSpecMissingError, \"Unable to locate Gem::Specification for Gem::Dependency `#{s... | [
"0.8247255",
"0.81481963",
"0.80695033",
"0.80650145",
"0.8018429",
"0.7878446",
"0.78100306",
"0.7656895",
"0.74950165",
"0.74348295",
"0.7340907",
"0.73231506",
"0.73027736",
"0.73027736",
"0.73027736",
"0.73027736",
"0.73027736",
"0.73027736",
"0.73027736",
"0.73027736",
"... | 0.7758823 | 7 |
Is this StubSpecification valid? i.e. have we found a stub line, OR does the filename contain a valid gemspec? | def valid?
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_gemspec?; end",
"def valid_gemspec?\n gemspec_helper.valid?\n end",
"def valid_gemspec?\n gemspec_helper.valid?\n end",
"def valid_gemspec?\n gemspec_helper.valid?\n end",
"def validate_gemspec; end",
"def stubbed?\n data.is_a? StubLine\n end",
"def current_spec_is?(spec)\n ... | [
"0.69462436",
"0.6746955",
"0.6746955",
"0.6746955",
"0.667021",
"0.6641096",
"0.6468122",
"0.6381421",
"0.63744223",
"0.6290887",
"0.6247049",
"0.62069654",
"0.6169047",
"0.61546123",
"0.614137",
"0.61241055",
"0.61018735",
"0.60885894",
"0.60878396",
"0.6039794",
"0.6010531... | 0.0 | -1 |
Is there a stub line present for this StubSpecification? | def stubbed?
data.is_a? StubLine
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stub?\n self.status == :stub\n end",
"def stubbed?\n !@stubs.empty?\n end",
"def is_stub?\n is_registered == false\n end",
"def spec_stubs?\n @config.files.copy.any? { |f, _| f.start_with?(STUBS_FOLDER) } \\\n || @config.files.compile.any? { |f, _| f.start_with?(ST... | [
"0.70363504",
"0.6909812",
"0.67397505",
"0.6320669",
"0.6087928",
"0.5869099",
"0.5809518",
"0.58093524",
"0.5613932",
"0.5570952",
"0.5509408",
"0.5490004",
"0.54743606",
"0.54511654",
"0.54209083",
"0.5396169",
"0.53955775",
"0.53632665",
"0.5362203",
"0.5352816",
"0.53484... | 0.80770963 | 0 |
Wraps +text+ to +wrap+ characters and optionally indents by +indent+ characters | def format_text(text, wrap, indent=0)
result = []
work = clean_text(text)
while work.length > wrap do
if work =~ /^(.{0,#{wrap}})[ \n]/
result << $1.rstrip
work.slice!(0, $&.length)
else
result << work.slice!(0, wrap)
end
end
result << work if work.length.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wrap text\n return unless text && !text.empty?\n\n text_len = @width - @indent\n\n text_len = 20 if text_len < 20\n\n re = /^(.{0,#{text_len}})[ \\n]/\n next_prefix = ' ' * @indent\n\n prefix = @prefix || next_prefix\n @prefix = nil\n\n @res << prefix\n\n while text.length > text_len... | [
"0.8027529",
"0.74338996",
"0.7209784",
"0.7029085",
"0.6984576",
"0.68898726",
"0.68884027",
"0.68715304",
"0.6858496",
"0.6855229",
"0.6763654",
"0.67384416",
"0.67381376",
"0.66900593",
"0.6636343",
"0.66334844",
"0.6622727",
"0.6619252",
"0.6583129",
"0.6569293",
"0.65199... | 0.7744255 | 2 |
Returns a value representing the "cost" of transforming str1 into str2 | def levenshtein_distance(str1, str2)
n = str1.length
m = str2.length
return m if n.zero?
return n if m.zero?
d = (0..m).to_a
x = nil
# to avoid duplicating an enumerable object, create it outside of the loop
str2_codepoints = str2.codepoints
str1.each_codepoint.with_index(1) do |c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transformation_distance(str1, str2)\n # puts \"#{@count += 1}\"\n\n str1,str2 = str1.downcase, str2.downcase\n # Dont need to compute if it has already been computed earlier, return from the aux hash.\n return @aux[\"#{str1}_#{str2}\"] if !(@aux[\"#{str1}_#{str2}\"].nil?)\n\n # if one string is empty, ret... | [
"0.67928606",
"0.65254015",
"0.65254015",
"0.64385706",
"0.6431034",
"0.63402236",
"0.6196954",
"0.6083561",
"0.60791296",
"0.60571164",
"0.60311055",
"0.6025806",
"0.5952749",
"0.5952128",
"0.5935255",
"0.5928867",
"0.5923281",
"0.5886611",
"0.5871686",
"0.5871686",
"0.58424... | 0.59847224 | 12 |
Displays an alert +statement+. Asks a +question+ if given. | def alert(statement, question = nil)
ui.alert statement, question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alert(statement, question=nil)\n @outs.puts \"INFO: #{statement}\"\n ask(question) if question\n end",
"def alert_warning(statement, question=nil)\n @errs.puts \"WARNING: #{statement}\"\n ask(question) if question\n end",
"def alert_error(statement, question=nil)\n @errs.puts \"ERROR: #... | [
"0.8491036",
"0.7825179",
"0.76959854",
"0.75154996",
"0.7357009",
"0.61600804",
"0.5961053",
"0.59600955",
"0.5952738",
"0.5814925",
"0.5814925",
"0.57961214",
"0.5756158",
"0.5680805",
"0.56412596",
"0.56412596",
"0.5629427",
"0.5575236",
"0.5570371",
"0.55597",
"0.554435",... | 0.8645611 | 0 |
Displays an error +statement+ to the error output location. Asks a +question+ if given. | def alert_error(statement, question = nil)
ui.alert_error statement, question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alert_error(statement, question=nil)\n @errs.puts \"ERROR: #{statement}\"\n ask(question) if question\n end",
"def alert_warning(statement, question=nil)\n @errs.puts \"WARNING: #{statement}\"\n ask(question) if question\n end",
"def error(message, line, column)\n puts \"*-*-* error at #... | [
"0.8625579",
"0.67197484",
"0.6370664",
"0.6328346",
"0.6270167",
"0.62539667",
"0.6228471",
"0.6208447",
"0.6124786",
"0.6016528",
"0.5975666",
"0.59413135",
"0.5893674",
"0.58892417",
"0.57965916",
"0.5719551",
"0.57107013",
"0.57093143",
"0.5689743",
"0.5683744",
"0.565734... | 0.7834198 | 1 |
Displays a warning +statement+ to the warning output location. Asks a +question+ if given. | def alert_warning(statement, question = nil)
ui.alert_warning statement, question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alert_warning(statement, question=nil)\n @errs.puts \"WARNING: #{statement}\"\n ask(question) if question\n end",
"def alert_error(statement, question=nil)\n @errs.puts \"ERROR: #{statement}\"\n ask(question) if question\n end",
"def alert(statement, question=nil)\n @outs.puts \"INFO: #... | [
"0.8946501",
"0.7301055",
"0.722927",
"0.6648547",
"0.65464723",
"0.6386995",
"0.595851",
"0.5950357",
"0.58260936",
"0.58260936",
"0.58260936",
"0.57826465",
"0.57826465",
"0.57826465",
"0.5707381",
"0.567022",
"0.567022",
"0.5665217",
"0.56517917",
"0.5640272",
"0.5600132",... | 0.8009437 | 1 |
Asks a +question+ and returns the answer. | def ask(question)
ui.ask question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ask_question(question)\n\tprint question\n\t\n\tgets.chomp # what gets returned from the function\nend",
"def ask(question)\n answer = 'n'\n answer = 'y' if agree(\"#{question} (y/n) \")\n answer\n end",
"def ask(question, expected_answer)\n answer = ''\n until answer.match?(exp... | [
"0.7819805",
"0.7755157",
"0.75470155",
"0.74229866",
"0.7372328",
"0.7330026",
"0.7328086",
"0.7307669",
"0.7279198",
"0.72768295",
"0.72701836",
"0.7241091",
"0.717898",
"0.71638465",
"0.7144918",
"0.71164006",
"0.7081771",
"0.70467955",
"0.70371145",
"0.7029396",
"0.701710... | 0.681883 | 37 |
Asks for a password with a +prompt+ | def ask_for_password(prompt)
ui.ask_for_password prompt
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def password(prompt)\n STDIN.noecho do\n begin\n ask(prompt)\n ensure\n puts\n end\n end\n end",
"def password_prompt(prompt=\"Password: \")\n ui.ask(prompt) { |q| q.echo = false }\n end",
"def ask_for_password(prompt = 'new password', *colors... | [
"0.8815871",
"0.8700373",
"0.8364579",
"0.8360036",
"0.8302727",
"0.8238798",
"0.8229967",
"0.8190985",
"0.8080827",
"0.799124",
"0.7914845",
"0.78951114",
"0.78570163",
"0.78321934",
"0.782071",
"0.7767407",
"0.7749137",
"0.77432823",
"0.76606375",
"0.76547265",
"0.7556146",... | 0.8910631 | 0 |
Asks a yes or no +question+. Returns true for yes, false for no. | def ask_yes_no(question, default = nil)
ui.ask_yes_no question, default
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def yes?(question)\n answer = ask(question).downcase\n answer == \"y\" || answer == \"yes\"\n end",
"def yes?(question)\r\n answer = ask(question).downcase\r\n answer == \"y\" || answer == \"yes\"\r\n end",
"def ask_boolean(question)\n yes? ask(question, true, ['y/n'])\n end",
"... | [
"0.8792426",
"0.8761577",
"0.8576767",
"0.8208754",
"0.8121966",
"0.79807794",
"0.79749745",
"0.78555804",
"0.777772",
"0.771932",
"0.767263",
"0.76513386",
"0.75862193",
"0.7568185",
"0.7563665",
"0.7538883",
"0.75244427",
"0.7523453",
"0.75080276",
"0.74532014",
"0.7444038"... | 0.74764425 | 19 |
Asks the user to answer +question+ with an answer from the given +list+. | def choose_from_list(question, list)
ui.choose_from_list question, list
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_from_list(question, list)\n @outs.puts question\n\n list.each_with_index do |item, index|\n @outs.puts \" #{index + 1}. #{item}\"\n end\n\n @outs.print \"> \"\n @outs.flush\n\n result = @ins.gets\n\n return nil, nil unless result\n\n result = result.strip.to_i - 1\n retur... | [
"0.74887955",
"0.7241415",
"0.6375267",
"0.5941572",
"0.5788211",
"0.5772353",
"0.5621486",
"0.56127584",
"0.5604012",
"0.5533692",
"0.5438587",
"0.54359126",
"0.54307204",
"0.5425203",
"0.54244465",
"0.54187965",
"0.54103315",
"0.5402585",
"0.5383448",
"0.5351846",
"0.533870... | 0.74980325 | 0 |
Displays the given +statement+ on the standard output (or equivalent). | def say(statement = '')
ui.say statement
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def say(statement)\n statement = render_statement(statement)\n return if statement.empty?\n\n statement = (indentation + statement)\n\n # Don't add a newline if statement ends with whitespace, OR\n # if statement ends with whitespace before a color escape code.\n if /[ \\t](\\e\\[\\d+(;\\d+)*m)?\... | [
"0.7240776",
"0.70787114",
"0.6984796",
"0.65171283",
"0.64541024",
"0.6396102",
"0.6268066",
"0.6213691",
"0.6212359",
"0.60421294",
"0.60403514",
"0.5945732",
"0.5899737",
"0.5887599",
"0.58522934",
"0.5848726",
"0.5825356",
"0.58124596",
"0.5809951",
"0.5721154",
"0.570311... | 0.6377973 | 6 |
Terminates the RubyGems process with the given +exit_code+ | def terminate_interaction(exit_code = 0)
ui.terminate_interaction exit_code
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exit_process(exit_code)\n exit exit_code\n end",
"def exit(env_ptr, code)\n @devices.each_value do |device|\n device.close\n end\n \n unless code == 0\n # Abnormal exit codes can indicate a CLIPS SYSTEM ERROR\n # This gives developers a chance to catch debuggi... | [
"0.75778675",
"0.70265085",
"0.68221223",
"0.6750263",
"0.671293",
"0.66005576",
"0.65290034",
"0.64758986",
"0.6470308",
"0.64515424",
"0.6444619",
"0.64107406",
"0.6398117",
"0.63912976",
"0.63593906",
"0.63158315",
"0.63090074",
"0.62982506",
"0.62982506",
"0.6286469",
"0.... | 0.6259268 | 21 |
Calls +say+ with +msg+ or the results of the block if really_verbose is true. | def verbose(msg = nil)
say(clean_text(msg || yield)) if Gem.configuration.really_verbose
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def say(message)\n puts green(message) if self.verbose \n end",
"def say(*par)\n return unless self[:verbose]\n\n super(*par)\n end",
"def v_puts(msg)\n puts msg if @options[:verbose]\n end",
"def print_verbose(msg)\n puts msg if (@verbose) \n STDOUT.flush\n end",
"def msg(m)\... | [
"0.6961021",
"0.68369734",
"0.6699907",
"0.6680886",
"0.660792",
"0.6244028",
"0.62109846",
"0.61993927",
"0.60987395",
"0.60934824",
"0.6081157",
"0.60376596",
"0.60376596",
"0.5971169",
"0.5970192",
"0.58754843",
"0.58489764",
"0.58489764",
"0.58421254",
"0.5811404",
"0.581... | 0.7364758 | 0 |
Creates a new StreamUI wrapping +in_stream+ for user input, +out_stream+ for standard output, +err_stream+ for error output. If +usetty+ is true then special operations (like asking for passwords) will use the TTY commands to disable character echo. | def initialize(in_stream, out_stream, err_stream=STDERR, usetty=true)
@ins = in_stream
@outs = out_stream
@errs = err_stream
@usetty = usetty
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tty(stream)\n @output = true\n @stdout.print(encode_str(\n stream\n ))\n end",
"def capture_with_inputs(stream, *args)\n begin\n # override STDOUT\n stream = stream.to_s\n eval \"$#{stream} = StringIO.new\"\n # override STDIN\n $stdin = StringIO.... | [
"0.57459486",
"0.53752786",
"0.5286506",
"0.51281846",
"0.5091985",
"0.49268836",
"0.487953",
"0.47790083",
"0.47729295",
"0.47517553",
"0.4749539",
"0.474326",
"0.47299808",
"0.4717042",
"0.46841958",
"0.46795598",
"0.46795598",
"0.46795598",
"0.46789363",
"0.46778262",
"0.4... | 0.67490536 | 0 |
Returns true if TTY methods should be used on this StreamUI. | def tty?
@usetty && @ins.tty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tty?\n false\n end",
"def tty?()\n #This is a stub, used for indexing\n end",
"def tty?\n end",
"def tty?\n end",
"def tty?\n @tty\n end",
"def _tty?\n false\n end",
"def tty?\n @io.respond_to?(:tty?) && @io.tty?\n end",
"def tty?() end"... | [
"0.7864531",
"0.7794309",
"0.7759351",
"0.7759351",
"0.76747334",
"0.75634086",
"0.7508185",
"0.7502044",
"0.7502044",
"0.7502044",
"0.74736387",
"0.74736387",
"0.74736387",
"0.7431238",
"0.7377867",
"0.7334476",
"0.7278969",
"0.7278969",
"0.72706443",
"0.71385735",
"0.709514... | 0.75219125 | 6 |
Prints a formatted backtrace to the errors stream if backtraces are enabled. | def backtrace(exception)
return unless Gem.configuration.backtrace
@errs.puts "\t#{exception.backtrace.join "\n\t"}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trace_errors\n getErrors.each { |e|\n puts \"(#{e.object || ''}): #{e.error}\"\n }\n end",
"def error(message, backtrace=nil)\n STDERR.puts color(message, error_color)\n backtrace.each {|line| line_color = (line[0..1] == '/') ? backtrace_local_color : backtrace_gem_color; STDERR... | [
"0.6372667",
"0.6206571",
"0.59374636",
"0.5915222",
"0.5849532",
"0.5670618",
"0.5626308",
"0.5535605",
"0.55114526",
"0.5445234",
"0.5442843",
"0.54340076",
"0.5418627",
"0.53961325",
"0.53588176",
"0.533829",
"0.53057647",
"0.52954894",
"0.52787405",
"0.5265034",
"0.521065... | 0.6221804 | 1 |
Choose from a list of options. +question+ is a prompt displayed above the list. +list+ is a list of option strings. Returns the pair [option_name, option_index]. | def choose_from_list(question, list)
@outs.puts question
list.each_with_index do |item, index|
@outs.puts " #{index + 1}. #{item}"
end
@outs.print "> "
@outs.flush
result = @ins.gets
return nil, nil unless result
result = result.strip.to_i - 1
return list[result], result
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_from_list(question, list)\n ui.choose_from_list question, list\n end",
"def select(question, options:, default: options.first, **opts)\n default_value = nil\n options = case options\n when Array\n default_text = default\n\n o = options - [default]\n... | [
"0.76769686",
"0.60068417",
"0.58153385",
"0.55872077",
"0.55263776",
"0.54821956",
"0.5463582",
"0.5438447",
"0.54243076",
"0.5396697",
"0.53718424",
"0.52885014",
"0.5268431",
"0.5246633",
"0.5241207",
"0.5238106",
"0.51814085",
"0.5162212",
"0.50895727",
"0.50168467",
"0.5... | 0.7557414 | 1 |
Ask a question. Returns a true for yes, false for no. If not connected to a tty, raises an exception if default is nil, otherwise returns default. | def ask_yes_no(question, default=nil)
unless tty?
if default.nil?
raise Gem::OperationNotSupportedError,
"Not connected to a tty and no default specified"
else
return default
end
end
default_answer = case default
when nil
'yn'
when true
'Y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ask(question, default: nil, **opts)\n CLI::UI.ask(question, default: default, **opts)\n end",
"def ask(question, options={})\n print \"#{question} [default: #{options[:default]}] \"\n reply = STDIN.readline.chomp\n if reply.empty?\n options[:default]\n else\n reply\n ... | [
"0.75660145",
"0.7524288",
"0.72618467",
"0.7066423",
"0.7014927",
"0.6942377",
"0.6859466",
"0.6848127",
"0.68276495",
"0.6822974",
"0.6822974",
"0.6719243",
"0.66605943",
"0.6576384",
"0.6551435",
"0.65513855",
"0.65045196",
"0.6458735",
"0.64059573",
"0.6397142",
"0.638048... | 0.7780975 | 0 |
Ask a question. Returns an answer if connected to a tty, nil otherwise. | def ask(question)
return nil if not tty?
@outs.print(question + " ")
@outs.flush
result = @ins.gets
result.chomp! if result
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ask(question, answer_type = String, non_interactive_value = nil, &continuation)\n if interactive?\n interaction_highline.ask(question, answer_type, &continuation)\n else\n nil\n end\n end",
"def ask(question)\n puts question\n begin\n system \"stty raw -echo\"... | [
"0.6960845",
"0.6947745",
"0.6860395",
"0.67608863",
"0.6683575",
"0.64894867",
"0.6433988",
"0.63541716",
"0.6344929",
"0.6341772",
"0.6324087",
"0.6278431",
"0.6231272",
"0.6224659",
"0.62237024",
"0.61701953",
"0.61134714",
"0.60479945",
"0.60307944",
"0.60230356",
"0.5981... | 0.7694514 | 0 |
Ask for a password. Does not echo response to terminal. | def ask_for_password(question)
return nil if not tty?
@outs.print(question, " ")
@outs.flush
password = _gets_noecho
@outs.puts
password.chomp! if password
password
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ask_for_password\n echo_off\n password = ask\n puts\n echo_on\n return password\n end",
"def ask_for_password(prompt)\n ui.ask_for_password prompt\n end",
"def password_prompt(prompt=\"Password: \")\n ui.ask(prompt) { |q| q.echo = false }\n end",
... | [
"0.85840595",
"0.84044695",
"0.8325443",
"0.82793444",
"0.82315606",
"0.81191176",
"0.80130816",
"0.79633933",
"0.7916039",
"0.7913471",
"0.78817934",
"0.7791564",
"0.7782432",
"0.7781891",
"0.76784813",
"0.7654454",
"0.7643359",
"0.75905365",
"0.7590241",
"0.7559836",
"0.752... | 0.80149406 | 6 |
Display an informational alert. Will ask +question+ if it is not nil. | def alert(statement, question=nil)
@outs.puts "INFO: #{statement}"
ask(question) if question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alert(statement, question = nil)\n ui.alert statement, question\n end",
"def alert_warning(statement, question=nil)\n @errs.puts \"WARNING: #{statement}\"\n ask(question) if question\n end",
"def display_question(question)\n input = nil\n Scraper.initiate_details_scrape(question)\n put... | [
"0.7279838",
"0.7039499",
"0.67498344",
"0.66877186",
"0.6642786",
"0.64417064",
"0.64109135",
"0.6373843",
"0.624628",
"0.6204987",
"0.6165544",
"0.61434597",
"0.60684496",
"0.60609514",
"0.6056123",
"0.60339224",
"0.6010233",
"0.59989077",
"0.5996909",
"0.5979393",
"0.59787... | 0.77028644 | 0 |
Display a warning on stderr. Will ask +question+ if it is not nil. | def alert_warning(statement, question=nil)
@errs.puts "WARNING: #{statement}"
ask(question) if question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alert_error(statement, question=nil)\n @errs.puts \"ERROR: #{statement}\"\n ask(question) if question\n end",
"def warning(msg, ask_continue: true)\n tell(colorize(\"☞ \", :magenta) + colorize(msg, :yellow))\n exit(-1) if ask_continue && !quiz(\"continue\")\n end",
"def alert_warning(stateme... | [
"0.7265617",
"0.66323805",
"0.65700334",
"0.6396416",
"0.6319249",
"0.6319249",
"0.6319249",
"0.6184151",
"0.6184151",
"0.616485",
"0.6155794",
"0.6131316",
"0.599554",
"0.5960004",
"0.5948453",
"0.5941891",
"0.5938795",
"0.59296083",
"0.59296083",
"0.59296083",
"0.5884097",
... | 0.7714893 | 0 |
Display an error message in a location expected to get error messages. Will ask +question+ if it is not nil. | def alert_error(statement, question=nil)
@errs.puts "ERROR: #{statement}"
ask(question) if question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_error\n error <<~MSG\n Sorry, please check\n your input to verify it\n is correct.\n MSG\n prompt error\nend",
"def alert_error(statement, question = nil)\n ui.alert_error statement, question\n end",
"def displayinvalidinputerror\r\n\t\t\t@output.puts('Invalid input.')\r\n\t\tend",
"def... | [
"0.69758475",
"0.6953052",
"0.6575102",
"0.6433149",
"0.63206583",
"0.62758243",
"0.62115604",
"0.6197357",
"0.6191325",
"0.6118041",
"0.6062907",
"0.6059703",
"0.60570085",
"0.60351604",
"0.599639",
"0.59807557",
"0.597996",
"0.5954311",
"0.5906132",
"0.587974",
"0.58774614"... | 0.7688582 | 0 |
Terminate the application with exit code +status+, running any exit handlers that might have been defined. | def terminate_interaction(status = 0)
close
raise Gem::SystemExitException, status
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exit(status = 0)\n say BLANK\n Kernel.exit(status)\n end",
"def halt(status = 0)\n exit status\n end",
"def system_exit(status)\n exit(status)\n end",
"def halt(exit_status = :ok)\n exit(EXIT_CODES[exit_status])\n end",
"def original_exit_application(exception, stat... | [
"0.73956746",
"0.7262885",
"0.69583607",
"0.6810273",
"0.6574946",
"0.64834535",
"0.6475377",
"0.60214204",
"0.5722025",
"0.56921136",
"0.5620156",
"0.56173587",
"0.5593259",
"0.54945236",
"0.54697704",
"0.5443923",
"0.5426226",
"0.53914046",
"0.53821826",
"0.53713",
"0.53690... | 0.7007891 | 2 |
Return a progress reporter object chosen from the current verbosity. | def progress_reporter(*args)
case Gem.configuration.verbose
when nil, false
SilentProgressReporter.new(@outs, *args)
when true
SimpleProgressReporter.new(@outs, *args)
else
VerboseProgressReporter.new(@outs, *args)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reporter\n @reporter ||= decorate_reporter(reporter_class.new($stdout, reporter_options))\n end",
"def reporter\n reporter_class = RSpec::Core::Reporter\n\n if strategy.rspec2?\n reporter_class.new\n else\n reporter_class.new(strategy.configuration)\n end... | [
"0.591401",
"0.5791898",
"0.57326305",
"0.5701476",
"0.5699068",
"0.5577254",
"0.54260504",
"0.5328234",
"0.5247583",
"0.51236194",
"0.51214284",
"0.5118964",
"0.50606525",
"0.48610333",
"0.4854117",
"0.4819692",
"0.477973",
"0.46357566",
"0.46252942",
"0.4606947",
"0.4601488... | 0.7264542 | 0 |
Creates a silent progress reporter that ignores all input arguments. | def initialize(out_stream, size, initial_message, terminal_message = nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def progress_reporter(*args)\n case Gem.configuration.verbose\n when nil, false\n SilentProgressReporter.new(@outs, *args)\n when true\n SimpleProgressReporter.new(@outs, *args)\n else\n VerboseProgressReporter.new(@outs, *args)\n end\n end",
"def silent(*what)\n return unless blo... | [
"0.62860787",
"0.5760329",
"0.5546326",
"0.5500096",
"0.54410857",
"0.5428378",
"0.5350712",
"0.53330463",
"0.5313995",
"0.5295832",
"0.52889335",
"0.5229384",
"0.52202165",
"0.5181423",
"0.5121915",
"0.5118682",
"0.5115579",
"0.51136637",
"0.51094943",
"0.5104961",
"0.510139... | 0.0 | -1 |
Does not print +message+ when updated as this object has taken a vow of silence. | def updated(message)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def silence=(value)\n @silence = value\n end",
"def report(message)\n puts message unless quiet? #or trial?\n end",
"def tell(message)\n message message, nil\n end",
"def tell(message)\n message message, nil\n end",
"def silent(text)\n GitPusshuTen::Log.silent... | [
"0.66540277",
"0.6370349",
"0.6333155",
"0.6333155",
"0.622532",
"0.61767566",
"0.6140074",
"0.60735977",
"0.60637534",
"0.60637534",
"0.6030732",
"0.5954485",
"0.593621",
"0.58651924",
"0.57852834",
"0.5718005",
"0.5702735",
"0.56997967",
"0.56952107",
"0.567703",
"0.5675162... | 0.5745479 | 15 |
Does not print anything when complete as this object has taken a vow of silence. | def done
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def silence!\n IO.console.raw!\n end",
"def silence(&block)\n begin_silence\n block.call\n ensure\n end_silence\n end",
"def put_hold_notice\n @io.puts\n @io.puts 'Pausing here -- run Ruby again to ' \\\n 'measure the next benchmark...'... | [
"0.6838912",
"0.6598205",
"0.65222234",
"0.6493029",
"0.62438625",
"0.623644",
"0.6091345",
"0.6046565",
"0.6040144",
"0.5978964",
"0.5949809",
"0.5942408",
"0.59179515",
"0.58779705",
"0.58125645",
"0.581219",
"0.5802614",
"0.5795399",
"0.57148707",
"0.57148707",
"0.57068497... | 0.0 | -1 |
Creates a new progress reporter that will write to +out_stream+ for +size+ items. Shows the given +initial_message+ when progress starts and the +terminal_message+ when it is complete. | def initialize(out_stream, size, initial_message,
terminal_message = "complete")
@out = out_stream
@total = size
@count = 0
@terminal_message = terminal_message
@out.puts initial_message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(out_stream, size, initial_message,\n terminal_message = 'complete')\n @out = out_stream\n @total = size\n @count = 0\n @terminal_message = terminal_message\n\n @out.puts initial_message\n end",
"def initialize(out_stream, size, initial_message, termina... | [
"0.77580965",
"0.6740908",
"0.51421344",
"0.4994209",
"0.49073216",
"0.486512",
"0.48038182",
"0.46461365",
"0.4601513",
"0.45527318",
"0.4548478",
"0.45107937",
"0.45097283",
"0.45039496",
"0.44601145",
"0.44589153",
"0.44276068",
"0.44168147",
"0.44018513",
"0.43857723",
"0... | 0.7769637 | 0 |
Prints out a dot and ignores +message+. | def updated(message)
@count += 1
@out.print "."
@out.flush
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def msg(message)\n puts message unless nagios_mode?\n end",
"def message(message, options = {})\n options[:prefix] ||= \"*** \"\n options[:color] ||= :white\n output message, options\n end",
"def info(message)\n puts \"\\e[35m#{message}\\e[0m\"\n end",
"def say(message)\n puts ... | [
"0.6994916",
"0.68468463",
"0.6724884",
"0.65763927",
"0.64772785",
"0.6447569",
"0.6433827",
"0.6424056",
"0.64127237",
"0.6390384",
"0.6390384",
"0.6369663",
"0.6344895",
"0.632584",
"0.6248701",
"0.6227132",
"0.6225759",
"0.6221584",
"0.6217089",
"0.6215969",
"0.62094784",... | 0.0 | -1 |
Prints out the terminal message. | def done
@out.puts "\n#{@terminal_message}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def msg(message)\n stdout.puts message\n end",
"def display(msg)\n stdout.puts msg\n return \"#{msg}\\n\"\n end",
"def print_command(msg)\n puts \" #{color(\"$\", 32)} #{color(msg, 32)}\"\n end",
"def print(message)\n output.print(message)\n end",
"def print_messa... | [
"0.7981536",
"0.7923777",
"0.77426404",
"0.77052784",
"0.77046835",
"0.75566185",
"0.7542471",
"0.7537075",
"0.74906933",
"0.74731886",
"0.7323935",
"0.73217887",
"0.72771466",
"0.7243613",
"0.72252023",
"0.7199631",
"0.7199283",
"0.7186668",
"0.7168798",
"0.7142213",
"0.7119... | 0.70708776 | 22 |
Creates a new progress reporter that will write to +out_stream+ for +size+ items. Shows the given +initial_message+ when progress starts and the +terminal_message+ when it is complete. | def initialize(out_stream, size, initial_message,
terminal_message = 'complete')
@out = out_stream
@total = size
@count = 0
@terminal_message = terminal_message
@out.puts initial_message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(out_stream, size, initial_message,\n terminal_message = \"complete\")\n @out = out_stream\n @total = size\n @count = 0\n @terminal_message = terminal_message\n\n @out.puts initial_message\n end",
"def initialize(out_stream, size, initial_message, termi... | [
"0.7768438",
"0.67401916",
"0.5138541",
"0.49937457",
"0.49054474",
"0.486417",
"0.4801555",
"0.464516",
"0.45993418",
"0.45513475",
"0.4546601",
"0.45097557",
"0.45059717",
"0.4502208",
"0.44592604",
"0.44560632",
"0.44243366",
"0.44135475",
"0.43981883",
"0.4383289",
"0.437... | 0.77569693 | 1 |
Prints out the position relative to the total and the +message+. | def updated(message)
@count += 1
@out.puts "#{@count}/#{@total}: #{message}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def positioned_message msg\n result = [msg]\n result << \"in file #{file}\" if file\n result << \"at line #{line}:#{pos}\" if line\n result.join(\" \")\n end",
"def afaire message\n if verbose?\n message_console message, '35'\n else\n message_point '35'\n end\n end",
"def info(... | [
"0.69877696",
"0.6408846",
"0.6400099",
"0.6352962",
"0.63161594",
"0.6304619",
"0.6299007",
"0.62885183",
"0.62641096",
"0.6231764",
"0.61477727",
"0.6132358",
"0.6100355",
"0.60959876",
"0.6080753",
"0.60706544",
"0.60533357",
"0.60323054",
"0.60291904",
"0.6027324",
"0.602... | 0.6407858 | 2 |
Prints out the terminal message. | def done
@out.puts @terminal_message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def msg(message)\n stdout.puts message\n end",
"def display(msg)\n stdout.puts msg\n return \"#{msg}\\n\"\n end",
"def print_command(msg)\n puts \" #{color(\"$\", 32)} #{color(msg, 32)}\"\n end",
"def print(message)\n output.print(message)\n end",
"def print_messa... | [
"0.7981536",
"0.7923777",
"0.77426404",
"0.77052784",
"0.77046835",
"0.75566185",
"0.7542471",
"0.7537075",
"0.74906933",
"0.74731886",
"0.7323935",
"0.73217887",
"0.72771466",
"0.7243613",
"0.72252023",
"0.7199631",
"0.7199283",
"0.7186668",
"0.7168798",
"0.7142213",
"0.7119... | 0.6808163 | 46 |
Return a download reporter object chosen from the current verbosity | def download_reporter(*args)
if [nil, false].include?(Gem.configuration.verbose) || !@outs.tty?
SilentDownloadReporter.new(@outs, *args)
else
ThreadedDownloadReporter.new(@outs, *args)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def progress_reporter(*args)\n case Gem.configuration.verbose\n when nil, false\n SilentProgressReporter.new(@outs, *args)\n when true\n SimpleProgressReporter.new(@outs, *args)\n else\n VerboseProgressReporter.new(@outs, *args)\n end\n end",
"def verbosity\n options[:verbosity]... | [
"0.63250476",
"0.5558899",
"0.55247355",
"0.54935896",
"0.5405294",
"0.54045135",
"0.5366706",
"0.53372234",
"0.517933",
"0.51744026",
"0.5141777",
"0.50860584",
"0.5061637",
"0.50447464",
"0.49723062",
"0.49433243",
"0.48816076",
"0.48778006",
"0.48537084",
"0.4853654",
"0.4... | 0.7112696 | 0 |
The silent download reporter does not display +filename+ or care about +filesize+ because it is silent. | def fetch(filename, filesize)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_reporter(*args)\n if [nil, false].include?(Gem.configuration.verbose) || !@outs.tty?\n SilentDownloadReporter.new(@outs, *args)\n else\n ThreadedDownloadReporter.new(@outs, *args)\n end\n end",
"def download_file(path, url, size: nil)\n File.open(path, 'wb') do |f|\n ... | [
"0.5919088",
"0.5671807",
"0.5489171",
"0.5488151",
"0.54393023",
"0.53909475",
"0.53228855",
"0.5279065",
"0.5248902",
"0.52320296",
"0.5228605",
"0.5199657",
"0.5199657",
"0.51987875",
"0.5181821",
"0.51780194",
"0.51746887",
"0.5174425",
"0.5164575",
"0.5124327",
"0.512016... | 0.5494703 | 2 |
Nothing can update the silent download reporter. | def update(current)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def no_download!\n\t\traise_if_error C.glyr_opt_download(to_native, false)\n\tend",
"def download_reporter(*args)\n if [nil, false].include?(Gem.configuration.verbose) || !@outs.tty?\n SilentDownloadReporter.new(@outs, *args)\n else\n ThreadedDownloadReporter.new(@outs, *args)\n end\n end",
... | [
"0.6695258",
"0.6578925",
"0.6230866",
"0.5790726",
"0.5735922",
"0.5662151",
"0.5661263",
"0.55012286",
"0.54574335",
"0.53428686",
"0.53396153",
"0.5338455",
"0.5304965",
"0.52954966",
"0.5291411",
"0.5273798",
"0.5249589",
"0.52079266",
"0.51962286",
"0.5187774",
"0.516738... | 0.0 | -1 |
The silent download reporter won't tell you when the download is done. Because it is silent. | def done
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_url\n process_emulation 10\n clear_progress_bar\n self.downloaded_at = Time.now.utc\n save! && ready!\n end",
"def download_reporter(*args)\n if [nil, false].include?(Gem.configuration.verbose) || !@outs.tty?\n SilentDownloadReporter.new(@outs, *args)\n else\n ThreadedDo... | [
"0.67876506",
"0.6733283",
"0.6473071",
"0.6401593",
"0.6336013",
"0.62918645",
"0.62429243",
"0.6166236",
"0.6125783",
"0.61219466",
"0.6104464",
"0.6005536",
"0.5982203",
"0.59586644",
"0.59503216",
"0.5900994",
"0.5890907",
"0.5879087",
"0.58712125",
"0.58673286",
"0.58586... | 0.0 | -1 |
Creates a new threaded download reporter that will display on +out_stream+. The other arguments are ignored. | def initialize(out_stream, *args)
@file_name = nil
@out = out_stream
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_reporter(*args)\n if [nil, false].include?(Gem.configuration.verbose) || !@outs.tty?\n SilentDownloadReporter.new(@outs, *args)\n else\n ThreadedDownloadReporter.new(@outs, *args)\n end\n end",
"def initialize(ostream, thread)\n proc = Proc.new do |ostream, thread|\n ... | [
"0.6503082",
"0.52936095",
"0.5231754",
"0.51719713",
"0.51719713",
"0.51719713",
"0.51577175",
"0.50959206",
"0.509098",
"0.50716096",
"0.50515294",
"0.5042121",
"0.49870422",
"0.49825636",
"0.4850236",
"0.48199058",
"0.4804817",
"0.4765703",
"0.47649574",
"0.47401968",
"0.4... | 0.58847255 | 1 |
Tells the download reporter that the +file_name+ is being fetched. The other arguments are ignored. | def fetch(file_name, *args)
if @file_name.nil?
@file_name = file_name
locked_puts "Fetching #{@file_name}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download!(file)\n login\n warn \"DEBUG: downloading #{file}\" if debug\n if dry_run\n warn \"DEBUG: download skipped for dry run\" if dry_run\n filename = file\n body = \"no body\"\n else\n page = agent.get(file)\n filename = page.filenam... | [
"0.65167075",
"0.6478627",
"0.6039747",
"0.6019223",
"0.5972361",
"0.59080523",
"0.5874894",
"0.584542",
"0.58123463",
"0.57874364",
"0.57737905",
"0.57717085",
"0.5769445",
"0.5723719",
"0.5712175",
"0.5686669",
"0.5641929",
"0.56303483",
"0.56253344",
"0.5615136",
"0.557869... | 0.7993017 | 0 |
Updates the threaded download reporter for the given number of +bytes+. | def update(bytes)
# Do nothing.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_bytes=(value)\n @num_bytes = value\n end",
"def update_download_status size, length\n @current_byte ||= 0\n @previous_print ||= 0\n @current_byte += size\n\n if length\n pct = @current_byte * 100 / length\n pc... | [
"0.58579093",
"0.5836282",
"0.57877195",
"0.5482136",
"0.53716034",
"0.5224466",
"0.51369286",
"0.50797534",
"0.5074861",
"0.5074861",
"0.50109065",
"0.4918127",
"0.4916258",
"0.4868489",
"0.48303527",
"0.48059168",
"0.47894293",
"0.4788481",
"0.4788481",
"0.47792047",
"0.477... | 0.5857679 | 1 |
Indicates the download is complete. | def done
# Do nothing.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complete!\n return if completed?\n self.status = \"complete\"\n self.stop = Time.now.to_s\n end",
"def complete?\n status == \"Completed\"\n end",
"def completed\n @status = 'complete'\n end",
"def complete\n @status = :ok\n do_stop\n ... | [
"0.7162856",
"0.71150076",
"0.7091515",
"0.7044363",
"0.6956287",
"0.6919742",
"0.6913724",
"0.691368",
"0.6894655",
"0.68515676",
"0.684071",
"0.6833204",
"0.6824373",
"0.6753173",
"0.6753173",
"0.6743438",
"0.67086124",
"0.669177",
"0.66508216",
"0.6638443",
"0.66348016",
... | 0.0 | -1 |
Does a sanity check on the specification. Raises InvalidSpecificationException if the spec does not pass the checks. It also performs some validations that do not raise but print warning messages instead. | def validate(strict = false)
validate_required!
validate_optional(strict) if packaging || strict
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(spec)\n raise \"undefined method -- `validate'\"\n end",
"def perform_extensive_analysis(spec)\n if spec.non_library_specification?\n error('spec', \"Validating a non library spec (`#{spec.name}`) is not supported.\")\n return false\n end\n validate_homepage(... | [
"0.6232125",
"0.6225833",
"0.6164926",
"0.5874185",
"0.5768053",
"0.57521737",
"0.5714523",
"0.5712307",
"0.57051545",
"0.5703375",
"0.56612134",
"0.5631116",
"0.55030847",
"0.5449231",
"0.5428907",
"0.5408891",
"0.53653175",
"0.5357332",
"0.5356656",
"0.53538036",
"0.5328641... | 0.0 | -1 |
Does a sanity check on the specification. Raises InvalidSpecificationException if the spec does not pass the checks. Only runs checks that are considered necessary for the specification to be functional. | def validate_required!
validate_nil_attributes
validate_rubygems_version
validate_required_attributes
validate_name
validate_require_paths
@specification.keep_only_files_and_directories
validate_non_files
validate_self_inclusion_in_files_list
validate_specification_version
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform_extensive_analysis(spec)\n if spec.non_library_specification?\n error('spec', \"Validating a non library spec (`#{spec.name}`) is not supported.\")\n return false\n end\n validate_homepage(spec)\n validate_screenshots(spec)\n validate_social_media_url(spec)\n ... | [
"0.6573015",
"0.6159163",
"0.5907299",
"0.58545065",
"0.5714557",
"0.56807137",
"0.5540466",
"0.5530235",
"0.5456114",
"0.54135716",
"0.5331943",
"0.5266581",
"0.5209127",
"0.5197738",
"0.51706123",
"0.5165232",
"0.5161605",
"0.51565623",
"0.5150446",
"0.5141479",
"0.51196104... | 0.53831625 | 10 |
Checks that no duplicate dependencies are specified. | def validate_duplicate_dependencies # :nodoc:
# NOTE: see REFACTOR note in Gem::Dependency about types - this might be brittle
seen = Gem::Dependency::TYPES.inject({}) {|types, type| types.merge({ type => {}}) }
error_messages = []
@specification.dependencies.each do |dep|
if prev = seen[dep.type... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_dependencies_are_present!\n if @podfile_dependency_cache.target_definition_list.all?(&:empty?)\n add_warning 'The Podfile does not contain any dependencies.'\n end\n end",
"def validate_dependencies\n Spiceweasel::Log.debug(\"cookbook validate_dependencies: '#{@depen... | [
"0.69145846",
"0.66654855",
"0.6648947",
"0.65979",
"0.65623343",
"0.63771355",
"0.6375423",
"0.6364129",
"0.6327773",
"0.62983793",
"0.62940663",
"0.629115",
"0.6278521",
"0.62784046",
"0.62656057",
"0.6200717",
"0.61972934",
"0.6192626",
"0.6183641",
"0.6178287",
"0.6117746... | 0.8057008 | 0 |
Checks that dependencies use requirements as we recommend. Warnings are issued when dependencies are openended or overly strict for semantic versioning. | def validate_dependencies # :nodoc:
warning_messages = []
@specification.dependencies.each do |dep|
prerelease_dep = dep.requirements_list.any? do |req|
Gem::Requirement.new(req).prerelease?
end
warning_messages << "prerelease dependency on #{dep} is not recommended" if
prer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_requirements; end",
"def validate_dependencies_are_present!\n if @podfile_dependency_cache.target_definition_list.all?(&:empty?)\n add_warning 'The Podfile does not contain any dependencies.'\n end\n end",
"def requirements(requirements); end",
"def dependency_met?\n... | [
"0.7396437",
"0.69807255",
"0.695036",
"0.6948075",
"0.68703574",
"0.6774695",
"0.6689976",
"0.6688564",
"0.6683457",
"0.6683407",
"0.6683407",
"0.6683407",
"0.6683407",
"0.66751456",
"0.6631439",
"0.66189206",
"0.66043365",
"0.66037416",
"0.66011584",
"0.6538756",
"0.6513367... | 0.79692805 | 0 |
Issues a warning for each file to be packaged which is worldreadable. Implementation for Specificationvalidate_permissions | def validate_permissions
return if Gem.win_platform?
@specification.files.each do |file|
next unless File.file?(file)
next if File.stat(file).mode & 0444 == 0444
warning "#{file} is not world-readable"
end
@specification.executables.each do |name|
exec = File.join @specificatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_files\n @files.each do |f|\n stat = File.stat f rescue next\n raise RDoc::Error, \"file '#{f}' not readable\" unless stat.readable?\n end\n end",
"def file_checks\n errors = []\n errors << 'There are no entries in the manifest file.' if @current_package.manifest.count == ... | [
"0.6521154",
"0.61398864",
"0.6015326",
"0.5997431",
"0.5916029",
"0.5878314",
"0.58049953",
"0.58049953",
"0.5770281",
"0.56868166",
"0.5645043",
"0.5613497",
"0.560144",
"0.5591261",
"0.5573853",
"0.5563531",
"0.5559487",
"0.5526846",
"0.5504812",
"0.5484",
"0.5455321",
"... | 0.71955156 | 0 |
Is +other+ equal to this platform? Two platforms are equal if they have the same CPU, OS and version. | def ==(other)
self.class === other and to_a == other.to_a
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ===(other)\n return nil unless Gem::Platform === other\n\n # cpu\n ([nil,'universal'].include?(@cpu) or [nil, 'universal'].include?(other.cpu) or @cpu == other.cpu or\n (@cpu == 'arm' and other.cpu.start_with?(\"arm\"))) and\n\n # os\n @os == other.os and\n\n # version\n (@version.nil? ... | [
"0.82836",
"0.6976543",
"0.6826304",
"0.66750324",
"0.6671011",
"0.65867084",
"0.65867084",
"0.6583032",
"0.65551966",
"0.6533801",
"0.6532238",
"0.65253246",
"0.6522429",
"0.6512409",
"0.6428473",
"0.638597",
"0.6312362",
"0.63018495",
"0.62953645",
"0.6294165",
"0.6291859",... | 0.0 | -1 |
Does +other+ match this platform? Two platforms match if they have the same CPU, or either has a CPU of 'universal', they have the same OS, and they have the same version, or either has no version. Additionally, the platform will match if the local CPU is 'arm' and the other CPU starts with "arm" (for generic ARM famil... | def ===(other)
return nil unless Gem::Platform === other
# cpu
([nil,'universal'].include?(@cpu) or [nil, 'universal'].include?(other.cpu) or @cpu == other.cpu or
(@cpu == 'arm' and other.cpu.start_with?("arm"))) and
# os
@os == other.os and
# version
(@version.nil? or other.version.n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def =~(other)\n case other\n when Gem::Platform then # nop\n when String then\n # This data is from http://gems.rubyforge.org/gems/yaml on 19 Aug 2007\n other = case other\n when /^i686-darwin(\\d)/ then ['x86', 'darwin', $1 ]\n when /^i\\d86-linux/ then ['x86', ... | [
"0.70818096",
"0.69326407",
"0.6780719",
"0.6605563",
"0.6506188",
"0.64915293",
"0.6456946",
"0.6456946",
"0.63460374",
"0.6227314",
"0.61622405",
"0.61441493",
"0.61370116",
"0.6126106",
"0.60881233",
"0.6085121",
"0.6082517",
"0.6082517",
"0.60604125",
"0.60527873",
"0.603... | 0.79242164 | 0 |
Does +other+ match this platform? If +other+ is a String it will be converted to a Gem::Platform first. See === for matching rules. | def =~(other)
case other
when Gem::Platform then # nop
when String then
# This data is from http://gems.rubyforge.org/gems/yaml on 19 Aug 2007
other = case other
when /^i686-darwin(\d)/ then ['x86', 'darwin', $1 ]
when /^i\d86-linux/ then ['x86', 'linux', ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ===(other)\n return nil unless Gem::Platform === other\n\n # cpu\n ([nil,'universal'].include?(@cpu) or [nil, 'universal'].include?(other.cpu) or @cpu == other.cpu or\n (@cpu == 'arm' and other.cpu.start_with?(\"arm\"))) and\n\n # os\n @os == other.os and\n\n # version\n (@version.nil? ... | [
"0.75330055",
"0.6590862",
"0.646517",
"0.63633585",
"0.61384565",
"0.61384565",
"0.61347735",
"0.6096043",
"0.60801053",
"0.6012473",
"0.59952563",
"0.5993206",
"0.5989259",
"0.59883976",
"0.5935801",
"0.5882765",
"0.58661187",
"0.5858255",
"0.58428866",
"0.584197",
"0.58339... | 0.75561184 | 0 |
:nodoc: A string representation of this Version. | def version
@version.dup
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n self.version.to_s\n end",
"def to_s\n @version\n end",
"def to_s\n @version\n end",
"def to_s\n \"<Version #{number}>\"\n end",
"def to_s\n @version\n end",
"def to_s\n version = get_version_string\n version << \"-#{get_pre_string}\" unless @pr... | [
"0.8215513",
"0.8058804",
"0.8058804",
"0.796417",
"0.79218316",
"0.760062",
"0.7438801",
"0.74122417",
"0.74122417",
"0.74122417",
"0.74122417",
"0.73941314",
"0.7385345",
"0.7279383",
"0.7279383",
"0.7279383",
"0.7279383",
"0.7270175",
"0.72545546",
"0.7232385",
"0.7232385"... | 0.0 | -1 |
Constructs a Version from the +version+ string. A version string is a series of digits or ASCII letters separated by dots. | def initialize(version)
unless self.class.correct?(version)
raise ArgumentError, "Malformed version number string #{version}"
end
# If version is an empty string convert it to 0
version = 0 if version.is_a?(String) && version =~ /\A\s*\Z/
@version = version.to_s.strip.gsub("-",".pre.")
@... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(version)\n @string = version.to_s\n @parsed = parse @string\n end",
"def initialize(version)\n unless self.class.correct?(version)\n raise ArgumentError, \"Malformed version number string #{version}\"\n end\n\n @version = version.to_s.strip\n @segments = nil\n end",
"def... | [
"0.75010276",
"0.74028313",
"0.73253834",
"0.72288823",
"0.7208856",
"0.71559083",
"0.7001371",
"0.6874154",
"0.6782436",
"0.676036",
"0.6743286",
"0.6697681",
"0.6619271",
"0.6619271",
"0.6534759",
"0.648085",
"0.6453774",
"0.6436464",
"0.64097077",
"0.63496315",
"0.63113314... | 0.76013184 | 0 |
Return a new version object where the next to the last revision number is one greater (e.g., 5.3.1 => 5.4). Prerelease (alpha) parts, e.g, 5.3.1.b.2 => 5.4, are ignored. | def bump
@@bump[self] ||= begin
segments = self.segments
segments.pop while segments.any? {|s| String === s }
segments.pop if segments.size > 1
segments[-1] = segments[-1].succ
self.class.new segments... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bump\n parts = parse_parts_from_version_string\n parts.pop while parts.any? { |part| part.alpha? }\n parts.pop if parts.size > 1\n parts[-1] = parts[-1].succ\n self.class.new(parts.join(\".\"))\n end",
"def next_version\n # x.y.z\n v = version.split '.'\n # bump z\n v[-1] = v[-1].to_i + 1... | [
"0.78884834",
"0.6926781",
"0.662856",
"0.66271925",
"0.6618088",
"0.6572423",
"0.6467047",
"0.64438146",
"0.6365385",
"0.63348126",
"0.6309917",
"0.6294192",
"0.6277417",
"0.6259452",
"0.6210307",
"0.61986923",
"0.617662",
"0.6175295",
"0.6138402",
"0.61131954",
"0.6089086",... | 0.0 | -1 |
A Version is only eql? to another version if it's specified to the same precision. Version "1.0" is not the same as version "1". | def eql?(other)
self.class === other and @version == other._version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_numeric_comparison\n value1_ = ::Versionomy.create([1, 9, 2], :semver)\n value2_ = ::Versionomy.create([1, 9], :semver)\n assert(value2_ < value1_)\n value1_ = ::Versionomy.create([1, 9, 0], :semver)\n value2_ = ::Versionomy.create([1, 9], :semver)\n assert(value2... | [
"0.7102786",
"0.7077664",
"0.6941745",
"0.6726454",
"0.67063844",
"0.66714835",
"0.65376127",
"0.64102656",
"0.6391553",
"0.6389727",
"0.6383313",
"0.6360304",
"0.6339766",
"0.6336462",
"0.63065106",
"0.6254093",
"0.62261075",
"0.6222422",
"0.6148251",
"0.6133003",
"0.6127844... | 0.67358375 | 3 |
Dump only the raw version string, not the complete object. It's a string for backwards (RubyGems 1.3.5 and earlier) compatibility. | def marshal_dump
[version]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def marshal_dump\n [version]\n end",
"def to_s\n self.version.to_s\n end",
"def marshal_dump\n [@version]\n end",
"def inspect\n\t\t\trval = super\n\t\t\treturn rval unless self.structure_version\n\t\t\tvstring = \"%d.%d\" % [ self.structure_version, self.data_version ]\n\t\t\treturn rval... | [
"0.74256",
"0.7211016",
"0.706517",
"0.70251673",
"0.6984906",
"0.6984906",
"0.6971729",
"0.67579484",
"0.6720594",
"0.6685187",
"0.6586474",
"0.653716",
"0.64979714",
"0.6383397",
"0.6374806",
"0.6361547",
"0.63499486",
"0.63499486",
"0.6270747",
"0.6270747",
"0.6254393",
... | 0.7253218 | 1 |
Load custom marshal format. It's a string for backwards (RubyGems 1.3.5 and earlier) compatibility. | def marshal_load(array)
initialize array[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def marshal_load(data_)\n format_ = Format.get(data_[0], true)\n if data_[1].kind_of?(::String)\n val_ = format_.parse(data_[1], data_[2])\n initialize(val_.values_array, format_, val_.unparse_params)\n else\n initialize(data_[1], format_, data_[2])\n end\n end",
"def ... | [
"0.6728919",
"0.66397494",
"0.64084774",
"0.6204351",
"0.6041241",
"0.5940384",
"0.5924337",
"0.5887812",
"0.58436984",
"0.5776398",
"0.5720641",
"0.55694854",
"0.55692065",
"0.5567284",
"0.5504724",
"0.5488201",
"0.5476807",
"0.5474492",
"0.5449095",
"0.542052",
"0.5384586",... | 0.51693416 | 26 |
A version is considered a prerelease if it contains a letter. | def prerelease?
unless instance_variable_defined? :@prerelease
@prerelease = !!(@version =~ /[a-zA-Z]/)
end
@prerelease
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prerelease?\n @prerelease ||= @version =~ /[a-zA-Z]/\n end",
"def prerelease?(version)\n !!PRERELEASE_STRINGS.detect do |string|\n version.match(/[^\\w]#{string}[^\\w]/)\n end\n end",
"def prerelease?\n parts.any? { |part| part.alpha? }\n end",
"def test_fo... | [
"0.8070405",
"0.79199445",
"0.7133747",
"0.70883286",
"0.70586735",
"0.7039992",
"0.7036116",
"0.66950476",
"0.66878283",
"0.6637531",
"0.66258234",
"0.6618188",
"0.6610258",
"0.6432123",
"0.63866943",
"0.63465977",
"0.6284459",
"0.6240905",
"0.62256306",
"0.6215019",
"0.6205... | 0.76479745 | 2 |
The release for this version (e.g. 1.2.0.a > 1.2.0). Nonprerelease versions return themselves. | def release
@@release[self] ||= if prerelease?
segments = self.segments
segments.pop while segments.any? {|s| String === s }
self.class.new segments.join('.')
else
self
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release\n @release ||= ENV[\"RELEASE\"] || \"1\"\n end",
"def get_release(project)\n info = get_github_api(project, \"releases\")\n release = 'master'\n if info.length > 0\n unpublishedDraftLimit = 5\n x = 0\n release = info[x]['tag_name']\n # Unpublished dr... | [
"0.75575197",
"0.72673726",
"0.69661826",
"0.69288945",
"0.692219",
"0.6905526",
"0.6881225",
"0.68714267",
"0.686079",
"0.67628616",
"0.67185855",
"0.67032164",
"0.6692211",
"0.6631198",
"0.66074723",
"0.6604782",
"0.6597542",
"0.6572386",
"0.6568078",
"0.65131634",
"0.65097... | 0.0 | -1 |
A recommended version for use with a ~> Requirement. | def approximate_recommendation
segments = self.segments
segments.pop while segments.any? {|s| String === s }
segments.pop while segments.size > 2
segments.push 0 while segments.size < 2
recommendation = "~> #{segments.join(".")}"
recommendation += ".a" if prerelease?
recommendation
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def requirement\n Gem::Requirement.new('~>' + pharos_version.segments.first(2).join('.') + (pharos_version.prerelease? ? '.0-a' : '.0'))\n end",
"def requirement\n \"~> #{major}\"\n end",
"def version\n @dependency.requirement\n end",
"def required_version\n normalize_v... | [
"0.72868747",
"0.7146809",
"0.7003008",
"0.6972227",
"0.69709706",
"0.6815177",
"0.67962575",
"0.670734",
"0.6695623",
"0.66733134",
"0.66620564",
"0.66620564",
"0.6634936",
"0.66155094",
"0.660427",
"0.65951306",
"0.654429",
"0.64922875",
"0.6462626",
"0.6437583",
"0.6396447... | 0.0 | -1 |
Compares this version with +other+ returning 1, 0, or 1 if the other version is larger, the same, or smaller than this one. Attempts to compare to something that's not a Gem::Version or a valid version String return +nil+. | def <=>(other)
return self <=> self.class.new(other) if (String === other) && self.class.correct?(other)
return unless Gem::Version === other
return 0 if @version == other._version || canonical_segments == other.canonical_segments
lhsegments = canonical_segments
rhsegments = other.canonical_segmen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_compare(v1, v2)\n gem_v1 = Gem::Version.new(v1.gsub(/\\A\\s*(#{Gem::Version::VERSION_PATTERN}).*/, '\\1'))\n gem_v2 = Gem::Version.new(v2.gsub(/\\A\\s*(#{Gem::Version::VERSION_PATTERN}).*/, '\\1'))\n\n gem_v1 <=> gem_v2\n end",
"def <=>(other) \n\n versionComparison = S... | [
"0.7355093",
"0.6994902",
"0.69890475",
"0.6910858",
"0.68332297",
"0.67868507",
"0.6739142",
"0.672413",
"0.6705216",
"0.6635522",
"0.6624122",
"0.66065806",
"0.65564793",
"0.6555332",
"0.6551878",
"0.65485674",
"0.6526283",
"0.649961",
"0.64796317",
"0.64670146",
"0.6457509... | 0.6889269 | 4 |
:nodoc: Constructs a requirement from +requirements+. Requirements can be Strings, Gem::Versions, or Arrays of those. +nil+ and duplicate requirements are ignored. An empty set of +requirements+ is the same as ">= 0". | def initialize(*requirements)
requirements = requirements.flatten
requirements.compact!
requirements.uniq!
if requirements.empty?
@requirements = [DefaultRequirement]
else
@requirements = requirements.map! {|r| self.class.parse r }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def req *requirements\n return requirements.first if Gem::Requirement === requirements.first\n Gem::Requirement.create requirements\n end",
"def req *requirements\n return requirements.first if Gem::Requirement === requirements.first\n Gem::Requirement.create requirements\n end",
"def... | [
"0.692784",
"0.69266593",
"0.689287",
"0.6813113",
"0.6762696",
"0.6752263",
"0.6633507",
"0.6567336",
"0.646806",
"0.6452252",
"0.6412474",
"0.6396967",
"0.63059837",
"0.6302269",
"0.6225966",
"0.6100303",
"0.6030575",
"0.6030575",
"0.59888655",
"0.5943431",
"0.593894",
"0... | 0.74043214 | 0 |
Concatenates the +new+ requirements onto this requirement. | def concat(new)
new = new.flatten
new.compact!
new.uniq!
new = new.map {|r| self.class.parse r }
@requirements.concat new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_requirement_attributes=(attributes)\n requirement = Requirement.find_or_create_by(attributes)\n self.requirements << requirement if requirement.valid? || !self.requirements\n end",
"def append(*new_attributes)\n new(attributes + new_attributes)\n end",
"def update_deps_from(new_source)\n... | [
"0.64193624",
"0.61889875",
"0.6079255",
"0.6047088",
"0.5957726",
"0.59047234",
"0.5840909",
"0.5668148",
"0.56299865",
"0.55344915",
"0.54511154",
"0.5431996",
"0.5291449",
"0.5288915",
"0.5288344",
"0.5276218",
"0.5231483",
"0.5191488",
"0.51862365",
"0.5164228",
"0.513867... | 0.7912805 | 0 |
Formats this requirement for use in a Gem::RequestSet::Lockfile. | def for_lockfile # :nodoc:
return if [DefaultRequirement] == @requirements
list = requirements.sort_by do |_, version|
version
end.map do |op, version|
"#{op} #{version}"
end.uniq
" (#{list.join ', '})"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_message(requirement)\n m = \"\"\n\n # A requirement that is required by itself is actually in the Gemfile, and does\n # not \"depend on\" itself\n if requirement.required_by.first && requirement.required_by.first.name != requirement.name\n m << \" #{clean_req(requirement.requi... | [
"0.6311326",
"0.5954041",
"0.5863315",
"0.58279204",
"0.5820155",
"0.57613677",
"0.5609519",
"0.55297947",
"0.5469973",
"0.54038423",
"0.5384745",
"0.5345564",
"0.5335278",
"0.5332886",
"0.5322093",
"0.53163075",
"0.52632993",
"0.5258679",
"0.52437973",
"0.5235901",
"0.522921... | 0.6569639 | 0 |
true if this gem has no requirements. | def none?
if @requirements.size == 1
@requirements[0] == DefaultRequirement
else
false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def satisfied?\n dependencies.none? { |_, v| v.empty? }\n end",
"def dependencies_satisfied?\n missing_dependencies.empty?\n end",
"def has_dependencies?\n update_for.length > 0 or requires.length > 0\n end",
"def gemspec?\n !gemspecs.empty?\n end",
"def non_gem_requirements... | [
"0.76441157",
"0.76095575",
"0.75841856",
"0.7539428",
"0.72282505",
"0.70047945",
"0.698144",
"0.6966105",
"0.68893343",
"0.6877637",
"0.68704724",
"0.6864259",
"0.6843678",
"0.6817272",
"0.67940676",
"0.6774389",
"0.67674714",
"0.6729785",
"0.67146504",
"0.67053115",
"0.670... | 0.75482595 | 3 |
true if the requirement is for only an exact version | def exact?
return false unless @requirements.size == 1
@requirements[0][0] == "="
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def satisfied_by?(req_vers, new_vers)\n req = LibGems::Requirement.new(req_vers)\n req_vers.sub(/^= /,'') == new_vers.sub(/^= /,'') ||\n req.satisfied_by?(LibGems::Version.new(new_vers))\n end",
"def check_version(version, requirement)\n Gem::Requirement.new( requirement ).satisfied_by... | [
"0.77208287",
"0.77043265",
"0.7641939",
"0.7576245",
"0.75673735",
"0.75673735",
"0.74794316",
"0.74574095",
"0.74543",
"0.74344015",
"0.7424816",
"0.737442",
"0.73658186",
"0.73077154",
"0.7289436",
"0.7206334",
"0.7146673",
"0.7145255",
"0.7135053",
"0.71111685",
"0.711055... | 0.0 | -1 |
A requirement is a prerelease if any of the versions inside of it are prereleases | def prerelease?
requirements.any? {|r| r.last.prerelease? }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prerelease?\n @prerelease || requirement.prerelease?\n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2, 2], :rubygems)\n assert_equal(false, value_.... | [
"0.8068106",
"0.75526327",
"0.7324127",
"0.7282404",
"0.72462374",
"0.7170464",
"0.71190095",
"0.69455785",
"0.6914383",
"0.6863299",
"0.6863299",
"0.68426514",
"0.6825016",
"0.6804854",
"0.6769285",
"0.6720497",
"0.67162323",
"0.6584076",
"0.65814763",
"0.6480631",
"0.647696... | 0.79001015 | 1 |
True if +version+ satisfies this Requirement. | def satisfied_by?(version)
raise ArgumentError, "Need a Gem::Version: #{version.inspect}" unless
Gem::Version === version
requirements.all? {|op, rv| OPS[op].call version, rv }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_version(version, requirement)\n Gem::Requirement.new( requirement ).satisfied_by? Gem::Version.new( version )\n end",
"def installed_version_matches?(version)\n installed_version? == version\n end",
"def meets_requirements?\n if dirname = Micro.installed_gem_dirnames(name... | [
"0.785732",
"0.7303244",
"0.73018795",
"0.7177367",
"0.7153308",
"0.7109508",
"0.710859",
"0.7058367",
"0.7012949",
"0.6980245",
"0.69529617",
"0.68595433",
"0.6835451",
"0.6816669",
"0.6781416",
"0.6774776",
"0.6720593",
"0.6720423",
"0.66942656",
"0.66430694",
"0.6604048",
... | 0.7833789 | 1 |
True if the requirement will not always match the latest version. | def specific?
return true if @requirements.length > 1 # GIGO, > 1, > 2 is silly
not %w[> >=].include? @requirements.first.first # grab the operator
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def latest_version?\n @requirement.none?\n end",
"def latest_version?\n @requirement.none?\n end",
"def meets_requirements?\n if dirname = Micro.installed_gem_dirnames(name).last\n Gem::Version.from_gem_dirname(dirname) >= @version_requirements.version\n end\n end",
"def outdated?... | [
"0.8386915",
"0.8386915",
"0.758467",
"0.7450388",
"0.7431902",
"0.7431032",
"0.7393184",
"0.71927553",
"0.71921617",
"0.71921617",
"0.7163172",
"0.71443605",
"0.7137454",
"0.70820844",
"0.7010511",
"0.69984764",
"0.691849",
"0.69121605",
"0.68986565",
"0.6883885",
"0.6876651... | 0.0 | -1 |
A list of authors for this gem. Alternatively, a single author can be specified by assigning a string to +spec.author+ Usage: spec.authors = ['John Jones', 'Mary Smith'] | def authors=(value)
@authors = Array(value).flatten.grep(String)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authors=(authors)\n @authors = case authors\n when Array\n authors\n else\n [authors]\n end\n end",
"def get_authors(authors, options={})\n Array(authors).map { |author| get_one_author(author, optio... | [
"0.79812104",
"0.7669922",
"0.76222736",
"0.7590711",
"0.73613036",
"0.7297126",
"0.7148308",
"0.7148308",
"0.71141875",
"0.6998233",
"0.6906216",
"0.689077",
"0.6889758",
"0.68091357",
"0.6802007",
"0.6784271",
"0.6691811",
"0.66626686",
"0.65607375",
"0.6541133",
"0.6523843... | 0.7809188 | 1 |
The license for this gem. The license must be no more than 64 characters. This should just be the name of your license. The full text of the license should be inside of the gem (at the top level) when you build it. The simplest way is to specify the standard SPDX ID for the license. Ideally, you should pick one that is... | def license=(o)
self.licenses = [o]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def license(arg = nil)\n set_or_return(\n :license,\n arg,\n kind_of: [ String ]\n )\n end",
"def license(arg = nil)\n set_or_return(:license, arg, kind_of: [String])\n end",
"def license\n conf['license'] || proj.license\n end",
"def license\... | [
"0.7775757",
"0.77365357",
"0.7595261",
"0.7579416",
"0.7544562",
"0.75020885",
"0.7439709",
"0.7146926",
"0.7129237",
"0.7080518",
"0.69858485",
"0.69756895",
"0.692848",
"0.68327373",
"0.6765202",
"0.67454225",
"0.66889757",
"0.66637015",
"0.6640714",
"0.6624596",
"0.658587... | 0.6426458 | 24 |
The license(s) for the library. Each license must be a short name, no more than 64 characters. This should just be the name of your license. The full text of the license should be inside of the gem when you build it. See license= for more discussion Usage: spec.licenses = ['MIT', 'GPL2.0'] | def licenses=(licenses)
@licenses = Array licenses
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def licenses\n @licenses ||= []\n end",
"def license(arg = nil)\n set_or_return(\n :license,\n arg,\n kind_of: [ String ]\n )\n end",
"def license\n conf['license'] || proj.license\n end",
"def customized_licenses\n @research_output.plan.template.l... | [
"0.7544542",
"0.7396506",
"0.7338036",
"0.73273873",
"0.72897327",
"0.7275002",
"0.7267267",
"0.7234829",
"0.7133612",
"0.7093589",
"0.7086412",
"0.69077766",
"0.68985105",
"0.68734396",
"0.6862522",
"0.6823905",
"0.6818423",
"0.6778695",
"0.6750213",
"0.6748417",
"0.6718123"... | 0.7053666 | 11 |
:section: Optional gemspec attributes Singular (alternative) writer for authors Usage: spec.author = 'John Jones' | def author=(o)
self.authors = [o]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def author=(new_author = nil)\n @info[:Author] = new_author\n end",
"def author; end",
"def specification(full_name); end",
"def add_spec(gem_spec, name = T.unsafe(nil)); end",
"def developer name, email\n self.author << name\n self.email << email\n end",
"def author=(author)\n @author... | [
"0.5888269",
"0.5792988",
"0.5792932",
"0.5758399",
"0.57535195",
"0.57462335",
"0.5743342",
"0.56409234",
"0.56292343",
"0.55693173",
"0.55346495",
"0.55346495",
"0.5514221",
"0.54932064",
"0.5486563",
"0.5486563",
"0.5453318",
"0.5451782",
"0.5431891",
"0.54266363",
"0.5420... | 0.5391213 | 23 |
The platform this gem runs on. This is usually Gem::Platform::RUBY or Gem::Platform::CURRENT. Most gems contain pure Ruby code; they should simply leave the default value in place. Some gems contain C (or other) code to be compiled into a Ruby "extension". The gem should leave the default value in place unless the code... | def platform=(platform)
if @original_platform.nil? or
@original_platform == Gem::Platform::RUBY
@original_platform = platform
end
case platform
when Gem::Platform::CURRENT then
@new_platform = Gem::Platform.local
@original_platform = @new_platform.to_s
when Gem::Platform t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform\n @new_platform ||= Gem::Platform::RUBY\n end",
"def platform\n (RUBY_PLATFORM == \"java\") ? 'java' : Gem::Platform::RUBY\n end",
"def platform(arg = nil)\n set_or_return(:platform, arg, kind_of: String, required: true)\n end",
"def get_platform(platform = nil)\n platfo... | [
"0.80609196",
"0.7888076",
"0.76774937",
"0.7544652",
"0.75055045",
"0.74413335",
"0.73992646",
"0.7385776",
"0.738463",
"0.7379598",
"0.73401827",
"0.73401827",
"0.73401827",
"0.73289084",
"0.73152703",
"0.7309224",
"0.7307234",
"0.7304654",
"0.72121805",
"0.71693057",
"0.71... | 0.80358326 | 1 |
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 dire... | def require_paths=(val)
@require_paths = Array(val)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_gem_paths; end",
"def load_paths\n [root.join('lib'), root.join('spec')].join(':')\n end",
"def require_paths\n return raw_require_paths unless have_extensions?\n\n [extension_dir].concat raw_require_paths\n end",
"def configured_require_paths\n return ['lib'] if directory.emp... | [
"0.75961006",
"0.745649",
"0.74507177",
"0.7310479",
"0.7100412",
"0.7045117",
"0.70267355",
"0.7026431",
"0.7026431",
"0.70000637",
"0.69859946",
"0.6918339",
"0.68515736",
"0.6839705",
"0.680404",
"0.67239726",
"0.6669042",
"0.6669042",
"0.6646225",
"0.66304183",
"0.6619983... | 0.6112155 | 50 |
Adds a development dependency named +gem+ with +requirements+ to this gem. Usage: spec.add_development_dependency 'example', '~> 1.1', '>= 1.1.4' Development dependencies aren't installed by default and aren't activated when a gem is required. | def add_development_dependency(gem, *requirements)
add_dependency_with_type(gem, :development, requirements)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem( name, *requirements, **options )\n\t\tif options[:group] == :development ||\n\t\t\toptions[:groups]&.include?( :development ) ||\n\t\t\tself.current_groups.include?( :development )\n\n\t\t\trequirements.push( :development )\n\t\tend\n\n\t\tdependency = Gem::Dependency.new( name, *requirements )\n\n\t\tsel... | [
"0.704571",
"0.65723485",
"0.6098008",
"0.60539603",
"0.6006549",
"0.59076697",
"0.5828143",
"0.57699996",
"0.57627577",
"0.5753721",
"0.5753721",
"0.56741464",
"0.5668272",
"0.5665999",
"0.5644715",
"0.55837035",
"0.5533127",
"0.5476602",
"0.5450433",
"0.5415151",
"0.5383112... | 0.89851147 | 0 |
Adds a runtime dependency named +gem+ with +requirements+ to this gem. Usage: spec.add_runtime_dependency 'example', '~> 1.1', '>= 1.1.4' | def add_runtime_dependency(gem, *requirements)
if requirements.uniq.size != requirements.size
warn "WARNING: duplicated #{gem} dependency #{requirements}"
end
add_dependency_with_type(gem, :runtime, requirements)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem(name, *reqs)\n @dependencies << Gem::Dependency.new(name, reqs)\n end",
"def gem(name, *reqs)\n @dependencies << Gem::Dependency.new(name, reqs)\n end",
"def gem(name, *reqs)\n if dep = @dependency_names[name]\n dep.requirement.concat reqs\n else\n dep = Gem::Dependency.... | [
"0.6718533",
"0.6718533",
"0.6666516",
"0.6535463",
"0.6358789",
"0.61500835",
"0.61460066",
"0.6095784",
"0.59604365",
"0.5926653",
"0.58176774",
"0.57870173",
"0.5769159",
"0.57543314",
"0.57543314",
"0.57440907",
"0.5729212",
"0.57257164",
"0.57257164",
"0.5717069",
"0.563... | 0.8525414 | 0 |
Extra files to add to RDoc such as README or doc/examples.txt When the user elects to generate the RDoc documentation for a gem (typically at install time), all the library files are sent to RDoc for processing. This option allows you to have some noncode files included for a more complete set of documentation. Usage: ... | def extra_rdoc_files
@extra_rdoc_files ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extra_rdoc_files=(files)\n @extra_rdoc_files = Array files\n end",
"def add_extra_files(*files)\n files.map! {|f| f.include?(\"*\") ? Dir.glob(f) : f }.flatten!\n files.each do |file|\n raise Errno::ENOENT, \"Could not find extra file: #{file}\" unless File.file?(file)\n o... | [
"0.7847791",
"0.6714237",
"0.6325522",
"0.60316795",
"0.5957018",
"0.58505046",
"0.5581697",
"0.55413216",
"0.54862255",
"0.54862255",
"0.54662496",
"0.5439772",
"0.538689",
"0.5386457",
"0.53467846",
"0.5337335",
"0.5297485",
"0.52544415",
"0.52043074",
"0.51877457",
"0.5162... | 0.7826054 | 1 |
The version of RubyGems that installed this gem. Returns Gem::Version.new(0) for gems installed by versions earlier than RubyGems 2.2.0. | def installed_by_version # :nodoc:
@installed_by_version ||= Gem::Version.new(0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_version\n Gem::Version.new VERSION\n end",
"def gem_version\n ::Gem::Version.new(VERSION::STRING)\n end",
"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 puppet_gem_versi... | [
"0.7723014",
"0.7421018",
"0.7123824",
"0.7123824",
"0.7123824",
"0.7123824",
"0.7123824",
"0.7123824",
"0.696962",
"0.6663169",
"0.66376597",
"0.6628757",
"0.65835357",
"0.6465737",
"0.6458394",
"0.6458394",
"0.64557767",
"0.641649",
"0.63711953",
"0.6332604",
"0.61876845",
... | 0.6439907 | 17 |
Sets the version of RubyGems that installed this gem. See also installed_by_version. | def installed_by_version=(version) # :nodoc:
@installed_by_version = Gem::Version.new version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_version=(version)\n @gem_version = version\n end",
"def mark_version\n @rubygems_version = Gem::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 CircularDependen... | [
"0.7491629",
"0.7225213",
"0.692393",
"0.66579676",
"0.62410694",
"0.61935127",
"0.61291325",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6080113",
"0.6069473",
"0.6069473",
"0.6069473",
"0.6069473",
"0.6069473",
... | 0.73224676 | 1 |
Specifies the rdoc options to be used when generating API documentation. Usage: spec.rdoc_options << 'title' << 'Rake Ruby Make' << 'main' << 'README' << 'linenumbers' | def rdoc_options
@rdoc_options ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rdoc_options=(options)\n @rdoc_options = Array options\n end",
"def run_rdoc(*args)\n args << @spec.rdoc_options\n args << self.class.configured_args\n args << @spec.require_paths.clone\n args << @spec.extra_rdoc_files\n args << '--title' << \"#{@spec.full_name} Documentation\"\n args <... | [
"0.75543505",
"0.67854506",
"0.66270596",
"0.647801",
"0.6464162",
"0.6431992",
"0.63945276",
"0.6067791",
"0.60475945",
"0.60004365",
"0.59807247",
"0.5971434",
"0.58744663",
"0.5846661",
"0.58226407",
"0.5812521",
"0.5799671",
"0.5735071",
"0.5700997",
"0.5691935",
"0.56733... | 0.7490527 | 1 |
The version of Ruby required by this gem. The ruby version can be specified to the patchlevel: $ ruby v e 'p Gem.ruby_version' ruby 2.0.0p247 (20130627 revision 41674) [x86_64darwin12.4.0] Prereleases can also be specified. Usage: This gem will work with 1.8.6 or greater... spec.required_ruby_version = '>= 1.8.6' Only ... | def required_ruby_version=(req)
@required_ruby_version = Gem::Requirement.create req
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def required_ruby_version\n spec.required_ruby_version || Gem::Requirement.default\n end",
"def required_ruby_version\n spec.required_ruby_version\n end",
"def required_rubygems_version\n spec.required_rubygems_version\n end",
"def required_rubygems_version\n spec.required_rubygems_version || ... | [
"0.84789115",
"0.8365273",
"0.7541329",
"0.7363373",
"0.733047",
"0.702389",
"0.6552471",
"0.6534443",
"0.65123004",
"0.65055287",
"0.65055287",
"0.65055287",
"0.65055287",
"0.65055287",
"0.65055287",
"0.64911586",
"0.6474577",
"0.6465891",
"0.6358651",
"0.6267477",
"0.625301... | 0.7219524 | 5 |
The RubyGems version required by this gem | def required_rubygems_version=(req)
@required_rubygems_version = Gem::Requirement.create req
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 required_rubygems_version\n spec.required_rubygems_version\n end",
"def gem_version\n Gem::Version.new VERSION\n end",
"def gem_version... | [
"0.842783",
"0.842783",
"0.842783",
"0.842783",
"0.842783",
"0.842783",
"0.8157885",
"0.80055505",
"0.7903641",
"0.78225106",
"0.7777584",
"0.7556158",
"0.7381543",
"0.71988845",
"0.71564335",
"0.7127347",
"0.7057765",
"0.69731563",
"0.69607",
"0.69607",
"0.69535553",
"0.69... | 0.65446 | 55 |
Lists the external (to RubyGems) requirements that must be met for this gem to work. It's simply information for the user. Usage: spec.requirements << 'libmagick, v6.0' spec.requirements << 'A good graphics card' | def requirements
@requirements ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gem_requirements\n @metadata[:requires].nil? ? [] :\n @metadata[:requires].select { |r| r.gem? }\n end",
"def requirements_for_gem(gem_name)\n @metadata[:requires].nil? ? [] :\n @metadata[:requires].select { |r| r.gem_name == gem_name }\n end",
"def get_req... | [
"0.78651315",
"0.7524458",
"0.7517415",
"0.73660415",
"0.7358692",
"0.71349555",
"0.71157324",
"0.7037896",
"0.70283127",
"0.6923267",
"0.6923267",
"0.6910235",
"0.6870942",
"0.6870942",
"0.68346924",
"0.6791789",
"0.67652655",
"0.66502345",
"0.6623593",
"0.661826",
"0.658633... | 0.72991186 | 5 |
A collection of unit test files. They will be loaded as unit tests when the user requests a gem to be unit tested. Usage: spec.test_files = Dir.glob('test/tc_.rb') spec.test_files = ['tests/testsuite.rb'] | def test_files=(files) # :nodoc:
@test_files = Array files
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_files\n code_files_in(tests_dir, CPP_EXTENSIONS)\n end",
"def test_files\n files = tests\n files = files.map{ |f| Dir[f] }.flatten\n files = files.map{ |f| File.directory?(f) ? Dir[File.join(f, '**/*.rb')] : f }\n files = files.flatten.uniq\n files = files.map{... | [
"0.754653",
"0.74343234",
"0.7277713",
"0.7148724",
"0.7144978",
"0.7053805",
"0.6970982",
"0.6970982",
"0.6970982",
"0.6970982",
"0.6927677",
"0.6893251",
"0.68081594",
"0.6778572",
"0.67663",
"0.6742022",
"0.6727903",
"0.6697975",
"0.6655531",
"0.6641648",
"0.6570758",
"0... | 0.65717614 | 20 |
Dump only crucial instance variables. MAINTAIN ORDER! (down with the man) | def _dump(limit)
Marshal.dump [
@rubygems_version,
@specification_version,
@name,
@version,
date,
@summary,
@required_ruby_version,
@required_rubygems_version,
@original_platform,
@dependencies,
'', # rubyforge_project
@email,
@authors,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pretty_print_instance_variables\n (instance_variables - pretty_print_ignore).sort\n end",
"def _dump(depth) # :nodoc:\n instanceVarHash = {}\n self.instance_variables.each { |k| instanceVarHash[k] = self.instance_variable_get(k) }\n return Marshal.dump(instanceVarHash.delete_if{|k,... | [
"0.7493746",
"0.72432625",
"0.72058374",
"0.7085348",
"0.7085348",
"0.6981851",
"0.69680667",
"0.6898859",
"0.6871428",
"0.6845401",
"0.6834734",
"0.68339735",
"0.6821691",
"0.6819042",
"0.6798975",
"0.67772126",
"0.6594631",
"0.6580164",
"0.65796137",
"0.64886105",
"0.648861... | 0.0 | -1 |
Activate this spec, registering it as a loaded spec and adding it's lib paths to $LOAD_PATH. Returns true if the spec was activated, false if it was previously activated. Freaks out if there are conflicts upon activation. | def activate
other = Gem.loaded_specs[self.name]
if other
check_version_conflict other
return false
end
raise_if_conflicts
activate_dependencies
add_self_to_load_path
Gem.loaded_specs[self.name] = self
@activated = true
@loaded = true
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activate!\n @include_dirs.each do |dir|\n $LOAD_PATH << dir if File.directory?(dir)\n end\n\n # use Bundler if a Gemfile is present\n bundle! unless @bundle.empty?\n\n return true\n end",
"def activate\n fire :activating, :activated do\n spec = sel... | [
"0.70549035",
"0.6677937",
"0.63382965",
"0.6175766",
"0.6170689",
"0.61675364",
"0.571251",
"0.5693433",
"0.56595755",
"0.554819",
"0.5536657",
"0.54100424",
"0.5257872",
"0.5238376",
"0.5222136",
"0.52123064",
"0.5207936",
"0.52057767",
"0.5162174",
"0.510924",
"0.5107427",... | 0.8011657 | 0 |
Activate all unambiguously resolved runtime dependencies of this spec. Add any ambiguous dependencies to the unresolved list to be resolved later, as needed. | def activate_dependencies
unresolved = Gem::Specification.unresolved_deps
self.runtime_dependencies.each do |spec_dep|
if loaded = Gem.loaded_specs[spec_dep.name]
next if spec_dep.matches_spec? loaded
msg = "can't satisfy '#{spec_dep}', already activated '#{loaded.full_name}'"
e ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve_dependencies!\n return unless Config.resolve? && targets.any?\n\n puts 'resolving dependencies...'\n each_threaded(targets) do |target|\n Depends.resolve(target, self)\n end\n end",
"def resolve\n r = Gem::DependencyResolver.new(@dependencies)\n r.resolve\n ... | [
"0.6455409",
"0.601737",
"0.585228",
"0.5797278",
"0.5772052",
"0.5771665",
"0.57369286",
"0.56976837",
"0.5675714",
"0.56590337",
"0.56590337",
"0.56590337",
"0.55829805",
"0.55797035",
"0.557687",
"0.556685",
"0.5545529",
"0.55076736",
"0.5503568",
"0.5480639",
"0.5479406",... | 0.7483746 | 0 |
Abbreviate the spec for downloading. Abbreviated specs are only used for searching, downloading and related activities and do not need deployment specific information (e.g. list of files). So we abbreviate the spec, making it much smaller for quicker downloads. | def abbreviate
self.files = []
self.test_files = []
self.rdoc_options = []
self.extra_rdoc_files = []
self.cert_chain = []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec_short_name\n return self.spec.to_s.sub(\"#{ModMap.specs}::\", '')\n end",
"def specification(full_name); end",
"def full_name\n \"#{spec.name}-#{spec.version}\"\n end",
"def download(full_spec, path) # :nodoc:\n end",
"def download_display_name\n\t\tif self.name == '/'\n\t\t\tself.nam... | [
"0.601977",
"0.5900327",
"0.5781179",
"0.56719244",
"0.5661865",
"0.56064075",
"0.5431469",
"0.54097086",
"0.52722794",
"0.52489567",
"0.51996756",
"0.518872",
"0.5115505",
"0.5044543",
"0.50311947",
"0.5012371",
"0.5001194",
"0.49813953",
"0.4974744",
"0.4941522",
"0.4925448... | 0.52022904 | 10 |
Sanitize the descriptive fields in the spec. Sometimes nonASCII characters will garble the site index. NonASCII characters will be replaced by their XML entity equivalent. | def sanitize
self.summary = sanitize_string(summary)
self.description = sanitize_string(description)
self.post_install_message = sanitize_string(post_install_message)
self.authors = authors.collect {|a| sanitize_string(a) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitize_description\n self.description = Sanitize.fragment(self.description, Sanitize::Config::BASIC)\n end",
"def sanitize_attributes\n %w(author title description keyword).each do |field|\n self.send(\"#{field}=\",HTMLEntities.new.decode(self.send(field)))\n end\n end",
"def sanitize_det... | [
"0.6997577",
"0.6943094",
"0.67906904",
"0.6678723",
"0.6615768",
"0.6535234",
"0.6532959",
"0.6521719",
"0.650012",
"0.63950735",
"0.63607013",
"0.63363624",
"0.6310531",
"0.6307299",
"0.6290557",
"0.6251198",
"0.6248954",
"0.62260485",
"0.6225414",
"0.62002724",
"0.6193682"... | 0.6536667 | 5 |
Sanitize a single string. | def sanitize_string(string)
return string unless string
# HACK the #to_s is in here because RSpec has an Array of Arrays of
# Strings for authors. Need a way to disallow bad values on gemspec
# generation. (Probably won't happen.)
string.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitize(str)\n return \"\" if !str\n return Sanitize.clean(str)\n end",
"def sanitize(string, options = {})\n Engine.clean(string)\n end",
"def sanitized_string(string)\n text = Sanitize.fragment(string.to_s).squish\n CGI.unescapeHTML(text).gsub(/ /, ' ')\n end",
"def ... | [
"0.7965939",
"0.7254872",
"0.7191147",
"0.7061731",
"0.69451565",
"0.69121486",
"0.6903771",
"0.68721724",
"0.68694645",
"0.6762367",
"0.67442644",
"0.67224294",
"0.6648556",
"0.66310424",
"0.6614246",
"0.657392",
"0.6544922",
"0.6447837",
"0.63893247",
"0.63834137",
"0.63615... | 0.65341395 | 17 |
Returns an array with bindir attached to each executable in the +executables+ list | def add_bindir(executables)
return nil if executables.nil?
if @bindir
Array(executables).map {|e| File.join(@bindir, e) }
else
executables
end
rescue
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_executables\n\t\tpaths = self.project_files.find_all do |path|\n\t\t\tpath.start_with?( 'bin/' )\n\t\tend\n\t\treturn paths.map {|path| path[%r{^bin/(.*)}, 1] }\n\tend",
"def get_executables(str)\n commands = []\n ENV[\"PATH\"].split(':').each do |dir|\n Dir.glob(\"#{dir}/*\").grep( /#{File::SEPARA... | [
"0.7974471",
"0.71337587",
"0.7059882",
"0.64660585",
"0.62789845",
"0.6221563",
"0.61482203",
"0.6127779",
"0.6002931",
"0.5831856",
"0.5796348",
"0.57255733",
"0.57226515",
"0.56800777",
"0.5676847",
"0.56314504",
"0.56257224",
"0.5622121",
"0.55792904",
"0.5576867",
"0.557... | 0.6984782 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.