id
int32
0
24.9k
repo
stringlengths
5
58
path
stringlengths
9
168
func_name
stringlengths
9
130
original_string
stringlengths
66
10.5k
language
stringclasses
1 value
code
stringlengths
66
10.5k
code_tokens
list
docstring
stringlengths
8
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
94
266
1,700
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb
RDoc.Fortran95parser.check_external_aliases
def check_external_aliases(subname, params, comment, test=nil) @@external_aliases.each{ |alias_item| if subname == alias_item["old_name"] || subname.upcase == alias_item["old_name"].upcase && @options.ignore_case new_meth = initialize_external_met...
ruby
def check_external_aliases(subname, params, comment, test=nil) @@external_aliases.each{ |alias_item| if subname == alias_item["old_name"] || subname.upcase == alias_item["old_name"].upcase && @options.ignore_case new_meth = initialize_external_met...
[ "def", "check_external_aliases", "(", "subname", ",", "params", ",", "comment", ",", "test", "=", "nil", ")", "@@external_aliases", ".", "each", "{", "|", "alias_item", "|", "if", "subname", "==", "alias_item", "[", "\"old_name\"", "]", "||", "subname", ".",...
Check external aliases
[ "Check", "external", "aliases" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb#L1328-L1348
1,701
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb
RDoc.Fortran95parser.united_to_one_line
def united_to_one_line(f90src) return "" unless f90src lines = f90src.split("\n") previous_continuing = false now_continuing = false body = "" lines.each{ |line| words = line.split("") next if words.empty? && previous_continuing commentout = false bran...
ruby
def united_to_one_line(f90src) return "" unless f90src lines = f90src.split("\n") previous_continuing = false now_continuing = false body = "" lines.each{ |line| words = line.split("") next if words.empty? && previous_continuing commentout = false bran...
[ "def", "united_to_one_line", "(", "f90src", ")", "return", "\"\"", "unless", "f90src", "lines", "=", "f90src", ".", "split", "(", "\"\\n\"", ")", "previous_continuing", "=", "false", "now_continuing", "=", "false", "body", "=", "\"\"", "lines", ".", "each", ...
Continuous lines are united. Comments in continuous lines are removed.
[ "Continuous", "lines", "are", "united", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb#L1387-L1455
1,702
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb
RDoc.Fortran95parser.continuous_line?
def continuous_line?(line) continuous = false if /&\s*?(!.*)?$/ =~ line continuous = true if comment_out?($~.pre_match) continuous = false end end return continuous end
ruby
def continuous_line?(line) continuous = false if /&\s*?(!.*)?$/ =~ line continuous = true if comment_out?($~.pre_match) continuous = false end end return continuous end
[ "def", "continuous_line?", "(", "line", ")", "continuous", "=", "false", "if", "/", "\\s", "/", "=~", "line", "continuous", "=", "true", "if", "comment_out?", "(", "$~", ".", "pre_match", ")", "continuous", "=", "false", "end", "end", "return", "continuous...
Continuous line checker
[ "Continuous", "line", "checker" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb#L1461-L1470
1,703
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb
RDoc.Fortran95parser.comment_out?
def comment_out?(line) return nil unless line commentout = false squote = false ; dquote = false line.split("").each { |char| if !(squote) && !(dquote) case char when "!" ; commentout = true ; break when "\""; dquote = true when "\'"; squote = true...
ruby
def comment_out?(line) return nil unless line commentout = false squote = false ; dquote = false line.split("").each { |char| if !(squote) && !(dquote) case char when "!" ; commentout = true ; break when "\""; dquote = true when "\'"; squote = true...
[ "def", "comment_out?", "(", "line", ")", "return", "nil", "unless", "line", "commentout", "=", "false", "squote", "=", "false", ";", "dquote", "=", "false", "line", ".", "split", "(", "\"\"", ")", ".", "each", "{", "|", "char", "|", "if", "!", "(", ...
Comment out checker
[ "Comment", "out", "checker" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb#L1475-L1500
1,704
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb
RDoc.Fortran95parser.semicolon_to_linefeed
def semicolon_to_linefeed(text) return "" unless text lines = text.split("\n") lines.collect!{ |line| words = line.split("") commentout = false squote = false ; dquote = false words.collect! { |char| if !(squote) && !(dquote) && !(commentout) case ...
ruby
def semicolon_to_linefeed(text) return "" unless text lines = text.split("\n") lines.collect!{ |line| words = line.split("") commentout = false squote = false ; dquote = false words.collect! { |char| if !(squote) && !(dquote) && !(commentout) case ...
[ "def", "semicolon_to_linefeed", "(", "text", ")", "return", "\"\"", "unless", "text", "lines", "=", "text", ".", "split", "(", "\"\\n\"", ")", "lines", ".", "collect!", "{", "|", "line", "|", "words", "=", "line", ".", "split", "(", "\"\"", ")", "comme...
Semicolons are replaced to line feed.
[ "Semicolons", "are", "replaced", "to", "line", "feed", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb#L1505-L1538
1,705
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb
RDoc.Fortran95parser.remove_empty_head_lines
def remove_empty_head_lines(text) return "" unless text lines = text.split("\n") header = true lines.delete_if{ |line| header = false if /\S/ =~ line header && /^\s*?$/ =~ line } lines.join("\n") end
ruby
def remove_empty_head_lines(text) return "" unless text lines = text.split("\n") header = true lines.delete_if{ |line| header = false if /\S/ =~ line header && /^\s*?$/ =~ line } lines.join("\n") end
[ "def", "remove_empty_head_lines", "(", "text", ")", "return", "\"\"", "unless", "text", "lines", "=", "text", ".", "split", "(", "\"\\n\"", ")", "header", "=", "true", "lines", ".", "delete_if", "{", "|", "line", "|", "header", "=", "false", "if", "/", ...
Empty lines in header are removed
[ "Empty", "lines", "in", "header", "are", "removed" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_f95.rb#L1619-L1628
1,706
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.ZStream.end
def end unless ready? then warn "attempt to close uninitialized stream; ignored." return nil end if in_stream? then warn "attempt to close unfinished zstream; reset forced" reset end reset_input err = Zlib.send @func_end, pointer Zlib.handle_...
ruby
def end unless ready? then warn "attempt to close uninitialized stream; ignored." return nil end if in_stream? then warn "attempt to close unfinished zstream; reset forced" reset end reset_input err = Zlib.send @func_end, pointer Zlib.handle_...
[ "def", "end", "unless", "ready?", "then", "warn", "\"attempt to close uninitialized stream; ignored.\"", "return", "nil", "end", "if", "in_stream?", "then", "warn", "\"attempt to close unfinished zstream; reset forced\"", "reset", "end", "reset_input", "err", "=", "Zlib", "...
Closes the stream. All operations on the closed stream will raise an exception.
[ "Closes", "the", "stream", ".", "All", "operations", "on", "the", "closed", "stream", "will", "raise", "an", "exception", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L319-L344
1,707
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.ZStream.reset
def reset err = Zlib.send @func_reset, pointer Zlib.handle_error err, message @flags = READY reset_input end
ruby
def reset err = Zlib.send @func_reset, pointer Zlib.handle_error err, message @flags = READY reset_input end
[ "def", "reset", "err", "=", "Zlib", ".", "send", "@func_reset", ",", "pointer", "Zlib", ".", "handle_error", "err", ",", "message", "@flags", "=", "READY", "reset_input", "end" ]
Resets and initializes the stream. All data in both input and output buffer are discarded.
[ "Resets", "and", "initializes", "the", "stream", ".", "All", "data", "in", "both", "input", "and", "output", "buffer", "are", "discarded", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L415-L423
1,708
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.Deflate.do_deflate
def do_deflate(data, flush) if data.nil? then run '', Zlib::FINISH else data = StringValue data if flush != Zlib::NO_FLUSH or not data.empty? then # prevent BUF_ERROR run data, flush end end end
ruby
def do_deflate(data, flush) if data.nil? then run '', Zlib::FINISH else data = StringValue data if flush != Zlib::NO_FLUSH or not data.empty? then # prevent BUF_ERROR run data, flush end end end
[ "def", "do_deflate", "(", "data", ",", "flush", ")", "if", "data", ".", "nil?", "then", "run", "''", ",", "Zlib", "::", "FINISH", "else", "data", "=", "StringValue", "data", "if", "flush", "!=", "Zlib", "::", "NO_FLUSH", "or", "not", "data", ".", "em...
Performs the deflate operation and leaves the compressed data in the output buffer
[ "Performs", "the", "deflate", "operation", "and", "leaves", "the", "compressed", "data", "in", "the", "output", "buffer" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L654-L664
1,709
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.Deflate.params
def params(level, strategy) err = Zlib.deflateParams pointer, level, strategy raise Zlib::BufError, 'buffer expansion not implemented' if err == Zlib::BUF_ERROR Zlib.handle_error err, message nil end
ruby
def params(level, strategy) err = Zlib.deflateParams pointer, level, strategy raise Zlib::BufError, 'buffer expansion not implemented' if err == Zlib::BUF_ERROR Zlib.handle_error err, message nil end
[ "def", "params", "(", "level", ",", "strategy", ")", "err", "=", "Zlib", ".", "deflateParams", "pointer", ",", "level", ",", "strategy", "raise", "Zlib", "::", "BufError", ",", "'buffer expansion not implemented'", "if", "err", "==", "Zlib", "::", "BUF_ERROR",...
Changes the parameters of the deflate stream. See zlib.h for details. The output from the stream by changing the params is preserved in output buffer.
[ "Changes", "the", "parameters", "of", "the", "deflate", "stream", ".", "See", "zlib", ".", "h", "for", "details", ".", "The", "output", "from", "the", "stream", "by", "changing", "the", "params", "is", "preserved", "in", "output", "buffer", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L692-L701
1,710
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.GzipReader.check_footer
def check_footer @zstream.flags |= Zlib::GzipFile::FOOTER_FINISHED footer = @zstream.input.slice! 0, 8 rest = @io.read 8 - footer.length footer << rest if rest raise NoFooter, 'footer is not found' unless footer.length == 8 crc, length = footer.unpack 'VV' @zstream[:total_i...
ruby
def check_footer @zstream.flags |= Zlib::GzipFile::FOOTER_FINISHED footer = @zstream.input.slice! 0, 8 rest = @io.read 8 - footer.length footer << rest if rest raise NoFooter, 'footer is not found' unless footer.length == 8 crc, length = footer.unpack 'VV' @zstream[:total_i...
[ "def", "check_footer", "@zstream", ".", "flags", "|=", "Zlib", "::", "GzipFile", "::", "FOOTER_FINISHED", "footer", "=", "@zstream", ".", "input", ".", "slice!", "0", ",", "8", "rest", "=", "@io", ".", "read", "8", "-", "footer", ".", "length", "footer",...
HACK use a buffer class Creates a GzipReader object associated with +io+. The GzipReader object reads gzipped data from +io+, and parses/decompresses them. At least, +io+ must have a +read+ method that behaves same as the +read+ method in IO class. If the gzip file header is incorrect, raises an Zlib::GzipFile:...
[ "HACK", "use", "a", "buffer", "class" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L961-L978
1,711
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.GzipWriter.make_header
def make_header flags = 0 extra_flags = 0 flags |= Zlib::GzipFile::FLAG_ORIG_NAME if @orig_name flags |= Zlib::GzipFile::FLAG_COMMENT if @comment extra_flags |= Zlib::GzipFile::EXTRAFLAG_FAST if @level == Zlib::BEST_SPEED extra_flags |= Zlib::GzipFile::EXTRAFLAG_SLOW if ...
ruby
def make_header flags = 0 extra_flags = 0 flags |= Zlib::GzipFile::FLAG_ORIG_NAME if @orig_name flags |= Zlib::GzipFile::FLAG_COMMENT if @comment extra_flags |= Zlib::GzipFile::EXTRAFLAG_FAST if @level == Zlib::BEST_SPEED extra_flags |= Zlib::GzipFile::EXTRAFLAG_SLOW if ...
[ "def", "make_header", "flags", "=", "0", "extra_flags", "=", "0", "flags", "|=", "Zlib", "::", "GzipFile", "::", "FLAG_ORIG_NAME", "if", "@orig_name", "flags", "|=", "Zlib", "::", "GzipFile", "::", "FLAG_COMMENT", "if", "@comment", "extra_flags", "|=", "Zlib",...
Writes out a gzip header
[ "Writes", "out", "a", "gzip", "header" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L1178-L1207
1,712
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.GzipWriter.make_footer
def make_footer footer = [ @crc, # bytes 0-3 @zstream.total_in, # bytes 4-7 ].pack 'VV' @io.write footer @zstream.flags |= Zlib::GzipFile::FOOTER_FINISHED end
ruby
def make_footer footer = [ @crc, # bytes 0-3 @zstream.total_in, # bytes 4-7 ].pack 'VV' @io.write footer @zstream.flags |= Zlib::GzipFile::FOOTER_FINISHED end
[ "def", "make_footer", "footer", "=", "[", "@crc", ",", "# bytes 0-3", "@zstream", ".", "total_in", ",", "# bytes 4-7", "]", ".", "pack", "'VV'", "@io", ".", "write", "footer", "@zstream", ".", "flags", "|=", "Zlib", "::", "GzipFile", "::", "FOOTER_FINISHED",...
Writes out a gzip footer
[ "Writes", "out", "a", "gzip", "footer" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L1212-L1221
1,713
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.GzipWriter.write
def write(data) make_header unless header_finished? data = String data if data.length > 0 or sync? then @crc = Zlib.crc32_c @crc, data, data.length flush = sync? ? Zlib::SYNC_FLUSH : Zlib::NO_FLUSH @zstream.run data, flush end write_raw end
ruby
def write(data) make_header unless header_finished? data = String data if data.length > 0 or sync? then @crc = Zlib.crc32_c @crc, data, data.length flush = sync? ? Zlib::SYNC_FLUSH : Zlib::NO_FLUSH @zstream.run data, flush end write_raw end
[ "def", "write", "(", "data", ")", "make_header", "unless", "header_finished?", "data", "=", "String", "data", "if", "data", ".", "length", ">", "0", "or", "sync?", "then", "@crc", "=", "Zlib", ".", "crc32_c", "@crc", ",", "data", ",", "data", ".", "len...
Same as IO.
[ "Same", "as", "IO", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L1241-L1255
1,714
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb
Zlib.Inflate.<<
def <<(string) string = StringValue string unless string.nil? if finished? then unless string.nil? then @input ||= '' @input << string end else run string, Zlib::SYNC_FLUSH end end
ruby
def <<(string) string = StringValue string unless string.nil? if finished? then unless string.nil? then @input ||= '' @input << string end else run string, Zlib::SYNC_FLUSH end end
[ "def", "<<", "(", "string", ")", "string", "=", "StringValue", "string", "unless", "string", ".", "nil?", "if", "finished?", "then", "unless", "string", ".", "nil?", "then", "@input", "||=", "''", "@input", "<<", "string", "end", "else", "run", "string", ...
Creates a new inflate stream for decompression. See zlib.h for details of the argument. If +window_bits+ is +nil+, the default value is used. Inputs +string+ into the inflate stream just like Zlib::Inflate#inflate, but returns the Zlib::Inflate object itself. The output from the stream is preserved in output buf...
[ "Creates", "a", "new", "inflate", "stream", "for", "decompression", ".", "See", "zlib", ".", "h", "for", "details", "of", "the", "argument", ".", "If", "+", "window_bits", "+", "is", "+", "nil", "+", "the", "default", "value", "is", "used", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/platform/i386-solaris/zlib.rb#L1327-L1338
1,715
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rexml/element.rb
REXML.Element.each_with_something
def each_with_something( test, max=0, name=nil ) num = 0 child=nil @elements.each( name ){ |child| yield child if test.call(child) and num += 1 return if max>0 and num == max } end
ruby
def each_with_something( test, max=0, name=nil ) num = 0 child=nil @elements.each( name ){ |child| yield child if test.call(child) and num += 1 return if max>0 and num == max } end
[ "def", "each_with_something", "(", "test", ",", "max", "=", "0", ",", "name", "=", "nil", ")", "num", "=", "0", "child", "=", "nil", "@elements", ".", "each", "(", "name", ")", "{", "|", "child", "|", "yield", "child", "if", "test", ".", "call", ...
A private helper method
[ "A", "private", "helper", "method" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rexml/element.rb#L705-L712
1,716
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/xmlrpc/server.rb
XMLRPC.BasicServer.check_arity
def check_arity(obj, n_args) ary = obj.arity if ary >= 0 n_args == ary else n_args >= (ary+1).abs end end
ruby
def check_arity(obj, n_args) ary = obj.arity if ary >= 0 n_args == ary else n_args >= (ary+1).abs end end
[ "def", "check_arity", "(", "obj", ",", "n_args", ")", "ary", "=", "obj", ".", "arity", "if", "ary", ">=", "0", "n_args", "==", "ary", "else", "n_args", ">=", "(", "ary", "+", "1", ")", ".", "abs", "end", "end" ]
returns true, if the arity of "obj" matches
[ "returns", "true", "if", "the", "arity", "of", "obj", "matches" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/xmlrpc/server.rb#L354-L362
1,717
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/security.rb
Gem::Security.Policy.verify_gem
def verify_gem(signature, data, chain, time = Time.now) Gem.ensure_ssl_available cert_class = OpenSSL::X509::Certificate exc = Gem::Security::Exception chain ||= [] chain = chain.map{ |str| cert_class.new(str) } signer, ch_len = chain[-1], chain.size # make sure signature is ...
ruby
def verify_gem(signature, data, chain, time = Time.now) Gem.ensure_ssl_available cert_class = OpenSSL::X509::Certificate exc = Gem::Security::Exception chain ||= [] chain = chain.map{ |str| cert_class.new(str) } signer, ch_len = chain[-1], chain.size # make sure signature is ...
[ "def", "verify_gem", "(", "signature", ",", "data", ",", "chain", ",", "time", "=", "Time", ".", "now", ")", "Gem", ".", "ensure_ssl_available", "cert_class", "=", "OpenSSL", "::", "X509", "::", "Certificate", "exc", "=", "Gem", "::", "Security", "::", "...
Verify that the gem data with the given signature and signing chain matched this security policy at the specified time.
[ "Verify", "that", "the", "gem", "data", "with", "the", "given", "signature", "and", "signing", "chain", "matched", "this", "security", "policy", "at", "the", "specified", "time", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/security.rb#L419-L509
1,718
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/yamlnode.rb
YAML.YamlNode.transform
def transform t = nil if @value.is_a? Hash t = {} @value.each { |k,v| t[ k ] = v[1].transform } elsif @value.is_a? Array t = [] @value.each { |v| t.push v.transform...
ruby
def transform t = nil if @value.is_a? Hash t = {} @value.each { |k,v| t[ k ] = v[1].transform } elsif @value.is_a? Array t = [] @value.each { |v| t.push v.transform...
[ "def", "transform", "t", "=", "nil", "if", "@value", ".", "is_a?", "Hash", "t", "=", "{", "}", "@value", ".", "each", "{", "|", "k", ",", "v", "|", "t", "[", "k", "]", "=", "v", "[", "1", "]", ".", "transform", "}", "elsif", "@value", ".", ...
Transform this node fully into a native type
[ "Transform", "this", "node", "fully", "into", "a", "native", "type" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/yamlnode.rb#L34-L50
1,719
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.collect_first_comment
def collect_first_comment skip_tkspace res = '' first_line = true tk = get_tk while tk.kind_of?(TkCOMMENT) if first_line && /\A#!/ =~ tk.text skip_tkspace tk = get_tk elsif first_line && /\A#\s*-\*-/ =~ tk.text first_line = false ski...
ruby
def collect_first_comment skip_tkspace res = '' first_line = true tk = get_tk while tk.kind_of?(TkCOMMENT) if first_line && /\A#!/ =~ tk.text skip_tkspace tk = get_tk elsif first_line && /\A#\s*-\*-/ =~ tk.text first_line = false ski...
[ "def", "collect_first_comment", "skip_tkspace", "res", "=", "''", "first_line", "=", "true", "tk", "=", "get_tk", "while", "tk", ".", "kind_of?", "(", "TkCOMMENT", ")", "if", "first_line", "&&", "/", "\\A", "/", "=~", "tk", ".", "text", "skip_tkspace", "tk...
Look for the first comment in a file that isn't a shebang line.
[ "Look", "for", "the", "first", "comment", "in", "a", "file", "that", "isn", "t", "a", "shebang", "line", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L1542-L1568
1,720
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.parse_method_parameters
def parse_method_parameters(method) res = parse_method_or_yield_parameters(method) res = "(" + res + ")" unless res[0] == ?( method.params = res unless method.params if method.block_params.nil? skip_tkspace(false) read_documentation_modifiers(method, METHOD_MODIFIERS) end ...
ruby
def parse_method_parameters(method) res = parse_method_or_yield_parameters(method) res = "(" + res + ")" unless res[0] == ?( method.params = res unless method.params if method.block_params.nil? skip_tkspace(false) read_documentation_modifiers(method, METHOD_MODIFIERS) end ...
[ "def", "parse_method_parameters", "(", "method", ")", "res", "=", "parse_method_or_yield_parameters", "(", "method", ")", "res", "=", "\"(\"", "+", "res", "+", "\")\"", "unless", "res", "[", "0", "]", "==", "?(", "method", ".", "params", "=", "res", "unles...
Capture the method's parameters. Along the way, look for a comment containing # yields: .... and add this as the block_params for the method
[ "Capture", "the", "method", "s", "parameters", ".", "Along", "the", "way", "look", "for", "a", "comment", "containing" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L2016-L2024
1,721
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.skip_optional_do_after_expression
def skip_optional_do_after_expression skip_tkspace(false) tk = get_tk case tk when TkLPAREN, TkfLPAREN end_token = TkRPAREN else end_token = TkNL end nest = 0 @scanner.instance_eval{@continue = false} loop do puts("\nWhile: #{tk}, #{@scanne...
ruby
def skip_optional_do_after_expression skip_tkspace(false) tk = get_tk case tk when TkLPAREN, TkfLPAREN end_token = TkRPAREN else end_token = TkNL end nest = 0 @scanner.instance_eval{@continue = false} loop do puts("\nWhile: #{tk}, #{@scanne...
[ "def", "skip_optional_do_after_expression", "skip_tkspace", "(", "false", ")", "tk", "=", "get_tk", "case", "tk", "when", "TkLPAREN", ",", "TkfLPAREN", "end_token", "=", "TkRPAREN", "else", "end_token", "=", "TkNL", "end", "nest", "=", "0", "@scanner", ".", "i...
while, until, and for have an optional
[ "while", "until", "and", "for", "have", "an", "optional" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L2088-L2125
1,722
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.get_class_specification
def get_class_specification tk = get_tk return "self" if tk.kind_of?(TkSELF) res = "" while tk.kind_of?(TkCOLON2) || tk.kind_of?(TkCOLON3) || tk.kind_of?(TkCONSTANT) res += tk.text tk = get_tk end unget_tk(tk) skip_tks...
ruby
def get_class_specification tk = get_tk return "self" if tk.kind_of?(TkSELF) res = "" while tk.kind_of?(TkCOLON2) || tk.kind_of?(TkCOLON3) || tk.kind_of?(TkCONSTANT) res += tk.text tk = get_tk end unget_tk(tk) skip_tks...
[ "def", "get_class_specification", "tk", "=", "get_tk", "return", "\"self\"", "if", "tk", ".", "kind_of?", "(", "TkSELF", ")", "res", "=", "\"\"", "while", "tk", ".", "kind_of?", "(", "TkCOLON2", ")", "||", "tk", ".", "kind_of?", "(", "TkCOLON3", ")", "||...
Return a superclass, which can be either a constant of an expression
[ "Return", "a", "superclass", "which", "can", "be", "either", "a", "constant", "of", "an", "expression" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L2130-L2158
1,723
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.get_constant
def get_constant res = "" skip_tkspace(false) tk = get_tk while tk.kind_of?(TkCOLON2) || tk.kind_of?(TkCOLON3) || tk.kind_of?(TkCONSTANT) res += tk.text tk = get_tk end # if res.empty? # warn("Unexpected token #{tk} in ...
ruby
def get_constant res = "" skip_tkspace(false) tk = get_tk while tk.kind_of?(TkCOLON2) || tk.kind_of?(TkCOLON3) || tk.kind_of?(TkCONSTANT) res += tk.text tk = get_tk end # if res.empty? # warn("Unexpected token #{tk} in ...
[ "def", "get_constant", "res", "=", "\"\"", "skip_tkspace", "(", "false", ")", "tk", "=", "get_tk", "while", "tk", ".", "kind_of?", "(", "TkCOLON2", ")", "||", "tk", ".", "kind_of?", "(", "TkCOLON3", ")", "||", "tk", ".", "kind_of?", "(", "TkCONSTANT", ...
Parse a constant, which might be qualified by one or more class or module names
[ "Parse", "a", "constant", "which", "might", "be", "qualified", "by", "one", "or", "more", "class", "or", "module", "names" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L2202-L2220
1,724
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.get_constant_with_optional_parens
def get_constant_with_optional_parens skip_tkspace(false) nest = 0 while (tk = peek_tk).kind_of?(TkLPAREN) || tk.kind_of?(TkfLPAREN) get_tk skip_tkspace(true) nest += 1 end name = get_constant while nest > 0 skip_tkspace(true) tk = get_tk ...
ruby
def get_constant_with_optional_parens skip_tkspace(false) nest = 0 while (tk = peek_tk).kind_of?(TkLPAREN) || tk.kind_of?(TkfLPAREN) get_tk skip_tkspace(true) nest += 1 end name = get_constant while nest > 0 skip_tkspace(true) tk = get_tk ...
[ "def", "get_constant_with_optional_parens", "skip_tkspace", "(", "false", ")", "nest", "=", "0", "while", "(", "tk", "=", "peek_tk", ")", ".", "kind_of?", "(", "TkLPAREN", ")", "||", "tk", ".", "kind_of?", "(", "TkfLPAREN", ")", "get_tk", "skip_tkspace", "("...
Get a constant that may be surrounded by parens
[ "Get", "a", "constant", "that", "may", "be", "surrounded", "by", "parens" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L2224-L2241
1,725
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb
RDoc.RubyParser.read_directive
def read_directive(allowed) tk = get_tk puts "directive: #{tk.inspect}" if $DEBUG result = nil if tk.kind_of?(TkCOMMENT) if tk.text =~ /\s*:?(\w+):\s*(.*)/ directive = $1.downcase if allowed.include?(directive) result = [directive, $2] end ...
ruby
def read_directive(allowed) tk = get_tk puts "directive: #{tk.inspect}" if $DEBUG result = nil if tk.kind_of?(TkCOMMENT) if tk.text =~ /\s*:?(\w+):\s*(.*)/ directive = $1.downcase if allowed.include?(directive) result = [directive, $2] end ...
[ "def", "read_directive", "(", "allowed", ")", "tk", "=", "get_tk", "puts", "\"directive: #{tk.inspect}\"", "if", "$DEBUG", "result", "=", "nil", "if", "tk", ".", "kind_of?", "(", "TkCOMMENT", ")", "if", "tk", ".", "text", "=~", "/", "\\s", "\\w", "\\s", ...
Directives are modifier comments that can appear after class, module, or method names. For example def fred # :yields: a, b or class SM # :nodoc: we return the directive name and any parameters as a two element array
[ "Directives", "are", "modifier", "comments", "that", "can", "appear", "after", "class", "module", "or", "method", "names", ".", "For", "example" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/parsers/parse_rb.rb#L2254-L2269
1,726
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/soap/wsdlDriver.rb
SOAP.WSDLDriverFactory.create_driver
def create_driver(servicename = nil, portname = nil) warn("WSDLDriverFactory#create_driver is depricated. Use create_rpc_driver instead.") port = find_port(servicename, portname) WSDLDriver.new(@wsdl, port, nil) end
ruby
def create_driver(servicename = nil, portname = nil) warn("WSDLDriverFactory#create_driver is depricated. Use create_rpc_driver instead.") port = find_port(servicename, portname) WSDLDriver.new(@wsdl, port, nil) end
[ "def", "create_driver", "(", "servicename", "=", "nil", ",", "portname", "=", "nil", ")", "warn", "(", "\"WSDLDriverFactory#create_driver is depricated. Use create_rpc_driver instead.\"", ")", "port", "=", "find_port", "(", "servicename", ",", "portname", ")", "WSDLDri...
depricated old interface
[ "depricated", "old", "interface" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/soap/wsdlDriver.rb#L45-L49
1,727
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.MarkUp.markup
def markup(str, remove_para=false) return '' unless str unless defined? @markup @markup = SM::SimpleMarkup.new # class names, variable names, or instance variables @markup.add_special(/( \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))? # A::B.meth(**)...
ruby
def markup(str, remove_para=false) return '' unless str unless defined? @markup @markup = SM::SimpleMarkup.new # class names, variable names, or instance variables @markup.add_special(/( \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))? # A::B.meth(**)...
[ "def", "markup", "(", "str", ",", "remove_para", "=", "false", ")", "return", "''", "unless", "str", "unless", "defined?", "@markup", "@markup", "=", "SM", "::", "SimpleMarkup", ".", "new", "# class names, variable names, or instance variables", "@markup", ".", "a...
Convert a string in markup format into HTML. We keep a cached SimpleMarkup object lying around after the first time we're called per object.
[ "Convert", "a", "string", "in", "markup", "format", "into", "HTML", ".", "We", "keep", "a", "cached", "SimpleMarkup", "object", "lying", "around", "after", "the", "first", "time", "we", "re", "called", "per", "object", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L209-L252
1,728
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.ContextUser.build_method_detail_list
def build_method_detail_list(section) outer = [] methods = @methods.sort for singleton in [true, false] for vis in [ :public, :protected, :private ] res = [] methods.each do |m| if m.section == section and m.document_self and m...
ruby
def build_method_detail_list(section) outer = [] methods = @methods.sort for singleton in [true, false] for vis in [ :public, :protected, :private ] res = [] methods.each do |m| if m.section == section and m.document_self and m...
[ "def", "build_method_detail_list", "(", "section", ")", "outer", "=", "[", "]", "methods", "=", "@methods", ".", "sort", "for", "singleton", "in", "[", "true", ",", "false", "]", "for", "vis", "in", "[", ":public", ",", ":protected", ",", ":private", "]"...
Build an array of arrays of method details. The outer array has up to six entries, public, private, and protected for both class methods, the other for instance methods. The inner arrays contain a hash for each method
[ "Build", "an", "array", "of", "arrays", "of", "method", "details", ".", "The", "outer", "array", "has", "up", "to", "six", "entries", "public", "private", "and", "protected", "for", "both", "class", "methods", "the", "other", "for", "instance", "methods", ...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L432-L492
1,729
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.ContextUser.build_class_list
def build_class_list(level, from, section, infile=nil) res = "" prefix = "&nbsp;&nbsp;::" * level; from.modules.sort.each do |mod| next unless mod.section == section next if infile && !mod.defined_in?(infile) if mod.document_self res << prefix << ...
ruby
def build_class_list(level, from, section, infile=nil) res = "" prefix = "&nbsp;&nbsp;::" * level; from.modules.sort.each do |mod| next unless mod.section == section next if infile && !mod.defined_in?(infile) if mod.document_self res << prefix << ...
[ "def", "build_class_list", "(", "level", ",", "from", ",", "section", ",", "infile", "=", "nil", ")", "res", "=", "\"\"", "prefix", "=", "\"&nbsp;&nbsp;::\"", "*", "level", ";", "from", ".", "modules", ".", "sort", ".", "each", "do", "|", "mod", "|", ...
Build the structured list of classes and modules contained in this context.
[ "Build", "the", "structured", "list", "of", "classes", "and", "modules", "contained", "in", "this", "context", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L497-L528
1,730
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.HTMLGenerator.load_html_template
def load_html_template template = @options.template unless template =~ %r{/|\\} template = File.join("rdoc/generators/template", @options.generator.key, template) end require template extend RDoc::Page rescue LoadError $stderr.puts "Could not ...
ruby
def load_html_template template = @options.template unless template =~ %r{/|\\} template = File.join("rdoc/generators/template", @options.generator.key, template) end require template extend RDoc::Page rescue LoadError $stderr.puts "Could not ...
[ "def", "load_html_template", "template", "=", "@options", ".", "template", "unless", "template", "=~", "%r{", "\\\\", "}", "template", "=", "File", ".", "join", "(", "\"rdoc/generators/template\"", ",", "@options", ".", "generator", ".", "key", ",", "template", ...
Load up the HTML template specified in the options. If the template name contains a slash, use it literally
[ "Load", "up", "the", "HTML", "template", "specified", "in", "the", "options", ".", "If", "the", "template", "name", "contains", "a", "slash", "use", "it", "literally" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L1206-L1217
1,731
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.HTMLGenerator.write_style_sheet
def write_style_sheet template = TemplatePage.new(RDoc::Page::STYLE) unless @options.css File.open(CSS_NAME, "w") do |f| values = { "fonts" => RDoc::Page::FONTS } template.write_html_on(f, values) end end end
ruby
def write_style_sheet template = TemplatePage.new(RDoc::Page::STYLE) unless @options.css File.open(CSS_NAME, "w") do |f| values = { "fonts" => RDoc::Page::FONTS } template.write_html_on(f, values) end end end
[ "def", "write_style_sheet", "template", "=", "TemplatePage", ".", "new", "(", "RDoc", "::", "Page", "::", "STYLE", ")", "unless", "@options", ".", "css", "File", ".", "open", "(", "CSS_NAME", ",", "\"w\"", ")", "do", "|", "f", "|", "values", "=", "{", ...
Write out the style sheet used by the main frames
[ "Write", "out", "the", "style", "sheet", "used", "by", "the", "main", "frames" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L1223-L1231
1,732
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.HTMLGenerator.main_url
def main_url main_page = @options.main_page ref = nil if main_page ref = AllReferences[main_page] if ref ref = ref.path else $stderr.puts "Could not find main page #{main_page}" end end unless ref for file in @files if ...
ruby
def main_url main_page = @options.main_page ref = nil if main_page ref = AllReferences[main_page] if ref ref = ref.path else $stderr.puts "Could not find main page #{main_page}" end end unless ref for file in @files if ...
[ "def", "main_url", "main_page", "=", "@options", ".", "main_page", "ref", "=", "nil", "if", "main_page", "ref", "=", "AllReferences", "[", "main_page", "]", "if", "ref", "ref", "=", "ref", ".", "path", "else", "$stderr", ".", "puts", "\"Could not find main p...
return the url of the main page
[ "return", "the", "url", "of", "the", "main", "page" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L1361-L1389
1,733
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb
Generators.HTMLGeneratorInOne.generate_xml
def generate_xml values = { 'charset' => @options.charset, 'files' => gen_into(@files), 'classes' => gen_into(@classes), 'title' => CGI.escapeHTML(@options.title), } # this method is defined in the template file write_extra_pages if defined? write...
ruby
def generate_xml values = { 'charset' => @options.charset, 'files' => gen_into(@files), 'classes' => gen_into(@classes), 'title' => CGI.escapeHTML(@options.title), } # this method is defined in the template file write_extra_pages if defined? write...
[ "def", "generate_xml", "values", "=", "{", "'charset'", "=>", "@options", ".", "charset", ",", "'files'", "=>", "gen_into", "(", "@files", ")", ",", "'classes'", "=>", "gen_into", "(", "@classes", ")", ",", "'title'", "=>", "CGI", ".", "escapeHTML", "(", ...
Generate all the HTML. For the one-file case, we generate all the information in to one big hash
[ "Generate", "all", "the", "HTML", ".", "For", "the", "one", "-", "file", "case", "we", "generate", "all", "the", "information", "in", "to", "one", "big", "hash" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/html_generator.rb#L1451-L1470
1,734
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/diagram.rb
RDoc.Diagram.draw
def draw unless @options.quiet $stderr.print "Diagrams: " $stderr.flush end @info.each_with_index do |i, file_count| @done_modules = {} @local_names = find_names(i) @global_names = [] @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel', ...
ruby
def draw unless @options.quiet $stderr.print "Diagrams: " $stderr.flush end @info.each_with_index do |i, file_count| @done_modules = {} @local_names = find_names(i) @global_names = [] @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel', ...
[ "def", "draw", "unless", "@options", ".", "quiet", "$stderr", ".", "print", "\"Diagrams: \"", "$stderr", ".", "flush", "end", "@info", ".", "each_with_index", "do", "|", "i", ",", "file_count", "|", "@done_modules", "=", "{", "}", "@local_names", "=", "find_...
Pass in the set of top level objects. The method also creates the subdirectory to hold the images Draw the diagrams. We traverse the files, drawing a diagram for each. We also traverse each top-level class and module in that file drawing a diagram for these too.
[ "Pass", "in", "the", "set", "of", "top", "level", "objects", ".", "The", "method", "also", "creates", "the", "subdirectory", "to", "hold", "the", "images" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/diagram.rb#L50-L103
1,735
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/code_objects.rb
RDoc.Context.find_symbol
def find_symbol(symbol, method=nil) result = nil case symbol when /^::(.*)/ result = toplevel.find_symbol($1) when /::/ modules = symbol.split(/::/) unless modules.empty? module_name = modules.shift result = find_module_named(module_name) if ...
ruby
def find_symbol(symbol, method=nil) result = nil case symbol when /^::(.*)/ result = toplevel.find_symbol($1) when /::/ modules = symbol.split(/::/) unless modules.empty? module_name = modules.shift result = find_module_named(module_name) if ...
[ "def", "find_symbol", "(", "symbol", ",", "method", "=", "nil", ")", "result", "=", "nil", "case", "symbol", "when", "/", "/", "result", "=", "toplevel", ".", "find_symbol", "(", "$1", ")", "when", "/", "/", "modules", "=", "symbol", ".", "split", "(...
allow us to sort modules by name Look up the given symbol. If method is non-nil, then we assume the symbol references a module that contains that method
[ "allow", "us", "to", "sort", "modules", "by", "name", "Look", "up", "the", "given", "symbol", ".", "If", "method", "is", "non", "-", "nil", "then", "we", "assume", "the", "symbol", "references", "a", "module", "that", "contains", "that", "method" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/code_objects.rb#L377-L420
1,736
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb
ActiveSupport.MessageVerifier.secure_compare
def secure_compare(a, b) if a.length == b.length result = 0 for i in 0..(a.length - 1) result |= a[i] ^ b[i] end result == 0 else false end end
ruby
def secure_compare(a, b) if a.length == b.length result = 0 for i in 0..(a.length - 1) result |= a[i] ^ b[i] end result == 0 else false end end
[ "def", "secure_compare", "(", "a", ",", "b", ")", "if", "a", ".", "length", "==", "b", ".", "length", "result", "=", "0", "for", "i", "in", "0", "..", "(", "a", ".", "length", "-", "1", ")", "result", "|=", "a", "[", "i", "]", "^", "b", "["...
constant-time comparison algorithm to prevent timing attacks
[ "constant", "-", "time", "comparison", "algorithm", "to", "prevent", "timing", "attacks" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb#L42-L52
1,737
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rss/parser.rb
RSS.ListenerMixin.parse_pi_content
def parse_pi_content(content) params = {} content.scan(CONTENT_PATTERN) do |name, quote, value| params[name] = value end params end
ruby
def parse_pi_content(content) params = {} content.scan(CONTENT_PATTERN) do |name, quote, value| params[name] = value end params end
[ "def", "parse_pi_content", "(", "content", ")", "params", "=", "{", "}", "content", ".", "scan", "(", "CONTENT_PATTERN", ")", "do", "|", "name", ",", "quote", ",", "value", "|", "params", "[", "name", "]", "=", "value", "end", "params", "end" ]
Extract the first name="value" pair from content. Works with single quotes according to the constant CONTENT_PATTERN. Return a Hash.
[ "Extract", "the", "first", "name", "=", "value", "pair", "from", "content", ".", "Works", "with", "single", "quotes", "according", "to", "the", "constant", "CONTENT_PATTERN", ".", "Return", "a", "Hash", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rss/parser.rb#L379-L385
1,738
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rss/parser.rb
RSS.Parser.normalize_rss
def normalize_rss(rss) return rss if maybe_xml?(rss) uri = to_uri(rss) if uri.respond_to?(:read) uri.read elsif !rss.tainted? and File.readable?(rss) File.open(rss) {|f| f.read} else rss end end
ruby
def normalize_rss(rss) return rss if maybe_xml?(rss) uri = to_uri(rss) if uri.respond_to?(:read) uri.read elsif !rss.tainted? and File.readable?(rss) File.open(rss) {|f| f.read} else rss end end
[ "def", "normalize_rss", "(", "rss", ")", "return", "rss", "if", "maybe_xml?", "(", "rss", ")", "uri", "=", "to_uri", "(", "rss", ")", "if", "uri", ".", "respond_to?", "(", ":read", ")", "uri", ".", "read", "elsif", "!", "rss", ".", "tainted?", "and",...
Try to get the XML associated with +rss+. Return +rss+ if it already looks like XML, or treat it as a URI, or a file to get the XML,
[ "Try", "to", "get", "the", "XML", "associated", "with", "+", "rss", "+", ".", "Return", "+", "rss", "+", "if", "it", "already", "looks", "like", "XML", "or", "treat", "it", "as", "a", "URI", "or", "a", "file", "to", "get", "the", "XML" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rss/parser.rb#L97-L109
1,739
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rcov-0.9.8-java/lib/rcov/rcovtask.rb
Rcov.RcovTask.define
def define lib_path = @libs.join(File::PATH_SEPARATOR) actual_name = Hash === name ? name.keys.first : name unless Rake.application.last_comment desc "Analyze code coverage with tests" + (@name==:rcov ? "" : " for #{actual_name}") end task @name do run_code = '' ...
ruby
def define lib_path = @libs.join(File::PATH_SEPARATOR) actual_name = Hash === name ? name.keys.first : name unless Rake.application.last_comment desc "Analyze code coverage with tests" + (@name==:rcov ? "" : " for #{actual_name}") end task @name do run_code = '' ...
[ "def", "define", "lib_path", "=", "@libs", ".", "join", "(", "File", "::", "PATH_SEPARATOR", ")", "actual_name", "=", "Hash", "===", "name", "?", "name", ".", "keys", ".", "first", ":", "name", "unless", "Rake", ".", "application", ".", "last_comment", "...
Create a testing task. Create the tasks defined by this task lib.
[ "Create", "a", "testing", "task", ".", "Create", "the", "tasks", "defined", "by", "this", "task", "lib", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rcov-0.9.8-java/lib/rcov/rcovtask.rb#L98-L134
1,740
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb
RDoc.RDoc.update_output_dir
def update_output_dir(op_dir, time) File.open(output_flag_file(op_dir), "w") {|f| f.puts time.rfc2822 } end
ruby
def update_output_dir(op_dir, time) File.open(output_flag_file(op_dir), "w") {|f| f.puts time.rfc2822 } end
[ "def", "update_output_dir", "(", "op_dir", ",", "time", ")", "File", ".", "open", "(", "output_flag_file", "(", "op_dir", ")", ",", "\"w\"", ")", "{", "|", "f", "|", "f", ".", "puts", "time", ".", "rfc2822", "}", "end" ]
Update the flag file in an output directory.
[ "Update", "the", "flag", "file", "in", "an", "output", "directory", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb#L105-L107
1,741
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb
RDoc.RDoc.normalized_file_list
def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern = nil) file_list = [] relative_files.each do |rel_file_name| next if exclude_pattern && exclude_pattern =~ rel_file_name stat = File.stat(rel_file_name) case type = stat...
ruby
def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern = nil) file_list = [] relative_files.each do |rel_file_name| next if exclude_pattern && exclude_pattern =~ rel_file_name stat = File.stat(rel_file_name) case type = stat...
[ "def", "normalized_file_list", "(", "options", ",", "relative_files", ",", "force_doc", "=", "false", ",", "exclude_pattern", "=", "nil", ")", "file_list", "=", "[", "]", "relative_files", ".", "each", "do", "|", "rel_file_name", "|", "next", "if", "exclude_pa...
Given a list of files and directories, create a list of all the Ruby files they contain. If +force_doc+ is true we always add the given files, if false, only add files that we guarantee we can parse. It is true when looking at files given on the command line, false when recursing through subdirectories. The ef...
[ "Given", "a", "list", "of", "files", "and", "directories", "create", "a", "list", "of", "all", "the", "Ruby", "files", "they", "contain", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb#L146-L174
1,742
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb
RDoc.RDoc.list_files_in_directory
def list_files_in_directory(dir, options) files = Dir.glob File.join(dir, "*") normalized_file_list options, files, false, options.exclude end
ruby
def list_files_in_directory(dir, options) files = Dir.glob File.join(dir, "*") normalized_file_list options, files, false, options.exclude end
[ "def", "list_files_in_directory", "(", "dir", ",", "options", ")", "files", "=", "Dir", ".", "glob", "File", ".", "join", "(", "dir", ",", "\"*\"", ")", "normalized_file_list", "options", ",", "files", ",", "false", ",", "options", ".", "exclude", "end" ]
Return a list of the files to be processed in a directory. We know that this directory doesn't have a .document file, so we're looking for real files. However we may well contain subdirectories which must be tested for .document files.
[ "Return", "a", "list", "of", "the", "files", "to", "be", "processed", "in", "a", "directory", ".", "We", "know", "that", "this", "directory", "doesn", "t", "have", "a", ".", "document", "file", "so", "we", "re", "looking", "for", "real", "files", ".", ...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb#L182-L186
1,743
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb
RDoc.RDoc.parse_files
def parse_files(options) @stats = Stats.new options.verbosity files = options.files files = ["."] if files.empty? file_list = normalized_file_list(options, files, true, options.exclude) return [] if file_list.empty? file_info = [] file_list.each do |filename| @stat...
ruby
def parse_files(options) @stats = Stats.new options.verbosity files = options.files files = ["."] if files.empty? file_list = normalized_file_list(options, files, true, options.exclude) return [] if file_list.empty? file_info = [] file_list.each do |filename| @stat...
[ "def", "parse_files", "(", "options", ")", "@stats", "=", "Stats", ".", "new", "options", ".", "verbosity", "files", "=", "options", ".", "files", "files", "=", "[", "\".\"", "]", "if", "files", ".", "empty?", "file_list", "=", "normalized_file_list", "(",...
Parse each file on the command line, recursively entering directories.
[ "Parse", "each", "file", "on", "the", "command", "line", "recursively", "entering", "directories", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb#L191-L229
1,744
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb
RDoc.RDoc.document
def document(argv) TopLevel::reset @options = Options.new GENERATORS @options.parse argv @last_created = nil unless @options.all_one_file then @last_created = setup_output_dir @options.op_dir, @options.force_update end start_time = Time.now file_info = parse_...
ruby
def document(argv) TopLevel::reset @options = Options.new GENERATORS @options.parse argv @last_created = nil unless @options.all_one_file then @last_created = setup_output_dir @options.op_dir, @options.force_update end start_time = Time.now file_info = parse_...
[ "def", "document", "(", "argv", ")", "TopLevel", "::", "reset", "@options", "=", "Options", ".", "new", "GENERATORS", "@options", ".", "parse", "argv", "@last_created", "=", "nil", "unless", "@options", ".", "all_one_file", "then", "@last_created", "=", "setup...
Format up one or more files according to the given arguments. For simplicity, _argv_ is an array of strings, equivalent to the strings that would be passed on the command line. (This isn't a coincidence, as we _do_ pass in ARGV when running interactively). For a list of options, see rdoc/rdoc.rb. By default, outpu...
[ "Format", "up", "one", "or", "more", "files", "according", "to", "the", "given", "arguments", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/rdoc.rb#L243-L290
1,745
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rss/utils.rb
RSS.Utils.new_with_value_if_need
def new_with_value_if_need(klass, value) if value.is_a?(klass) value else klass.new(value) end end
ruby
def new_with_value_if_need(klass, value) if value.is_a?(klass) value else klass.new(value) end end
[ "def", "new_with_value_if_need", "(", "klass", ",", "value", ")", "if", "value", ".", "is_a?", "(", "klass", ")", "value", "else", "klass", ".", "new", "(", "value", ")", "end", "end" ]
If +value+ is an instance of class +klass+, return it, else create a new instance of +klass+ with value +value+.
[ "If", "+", "value", "+", "is", "an", "instance", "of", "class", "+", "klass", "+", "return", "it", "else", "create", "a", "new", "instance", "of", "+", "klass", "+", "with", "value", "+", "value", "+", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rss/utils.rb#L27-L33
1,746
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb
RDoc.Context.methods_matching
def methods_matching(methods, singleton = false) count = 0 @method_list.each do |m| if methods.include? m.name and m.singleton == singleton then yield m count += 1 end end return if count == methods.size || singleton # perhaps we need to look at attri...
ruby
def methods_matching(methods, singleton = false) count = 0 @method_list.each do |m| if methods.include? m.name and m.singleton == singleton then yield m count += 1 end end return if count == methods.size || singleton # perhaps we need to look at attri...
[ "def", "methods_matching", "(", "methods", ",", "singleton", "=", "false", ")", "count", "=", "0", "@method_list", ".", "each", "do", "|", "m", "|", "if", "methods", ".", "include?", "m", ".", "name", "and", "m", ".", "singleton", "==", "singleton", "t...
Yields Method and Attr entries matching the list of names in +methods+. Attributes are only returned when +singleton+ is false.
[ "Yields", "Method", "and", "Attr", "entries", "matching", "the", "list", "of", "names", "in", "+", "methods", "+", ".", "Attributes", "are", "only", "returned", "when", "+", "singleton", "+", "is", "false", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb#L249-L266
1,747
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb
RDoc.Context.find_module_named
def find_module_named(name) # First check the enclosed modules, then check the module itself, # then check the enclosing modules (this mirrors the check done by # the Ruby parser) res = @modules[name] || @classes[name] return res if res return self if self.name == name find_enc...
ruby
def find_module_named(name) # First check the enclosed modules, then check the module itself, # then check the enclosing modules (this mirrors the check done by # the Ruby parser) res = @modules[name] || @classes[name] return res if res return self if self.name == name find_enc...
[ "def", "find_module_named", "(", "name", ")", "# First check the enclosed modules, then check the module itself,", "# then check the enclosing modules (this mirrors the check done by", "# the Ruby parser)", "res", "=", "@modules", "[", "name", "]", "||", "@classes", "[", "name", ...
Find a named module
[ "Find", "a", "named", "module" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb#L429-L437
1,748
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb
RDoc.TopLevel.add_class_or_module
def add_class_or_module(collection, class_type, name, superclass) cls = collection[name] if cls then cls.superclass = superclass unless cls.module? puts "Reusing class/module #{cls.full_name}" if $DEBUG_RDOC else if class_type == NormalModule then all = @@all_modules...
ruby
def add_class_or_module(collection, class_type, name, superclass) cls = collection[name] if cls then cls.superclass = superclass unless cls.module? puts "Reusing class/module #{cls.full_name}" if $DEBUG_RDOC else if class_type == NormalModule then all = @@all_modules...
[ "def", "add_class_or_module", "(", "collection", ",", "class_type", ",", "name", ",", "superclass", ")", "cls", "=", "collection", "[", "name", "]", "if", "cls", "then", "cls", ".", "superclass", "=", "superclass", "unless", "cls", ".", "module?", "puts", ...
Adding a class or module to a TopLevel is special, as we only want one copy of a particular top-level class. For example, if both file A and file B implement class C, we only want one ClassModule object for C. This code arranges to share classes and modules between files.
[ "Adding", "a", "class", "or", "module", "to", "a", "TopLevel", "is", "special", "as", "we", "only", "want", "one", "copy", "of", "a", "particular", "top", "-", "level", "class", ".", "For", "example", "if", "both", "file", "A", "and", "file", "B", "i...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb#L618-L653
1,749
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb
RDoc.ClassModule.superclass
def superclass raise NoMethodError, "#{full_name} is a module" if module? scope = self begin superclass = scope.classes.find { |c| c.name == @superclass } return superclass.full_name if superclass scope = scope.parent end until scope.nil? or TopLevel === scope @...
ruby
def superclass raise NoMethodError, "#{full_name} is a module" if module? scope = self begin superclass = scope.classes.find { |c| c.name == @superclass } return superclass.full_name if superclass scope = scope.parent end until scope.nil? or TopLevel === scope @...
[ "def", "superclass", "raise", "NoMethodError", ",", "\"#{full_name} is a module\"", "if", "module?", "scope", "=", "self", "begin", "superclass", "=", "scope", ".", "classes", ".", "find", "{", "|", "c", "|", "c", ".", "name", "==", "@superclass", "}", "retu...
Get the superclass of this class. Attempts to retrieve the superclass' real name by following module nesting.
[ "Get", "the", "superclass", "of", "this", "class", ".", "Attempts", "to", "retrieve", "the", "superclass", "real", "name", "by", "following", "module", "nesting", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/code_objects.rb#L748-L761
1,750
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/response.rb
Rack.Response.write
def write(str) s = str.to_s @length += Rack::Utils.bytesize(s) @writer.call s header["Content-Length"] = @length.to_s str end
ruby
def write(str) s = str.to_s @length += Rack::Utils.bytesize(s) @writer.call s header["Content-Length"] = @length.to_s str end
[ "def", "write", "(", "str", ")", "s", "=", "str", ".", "to_s", "@length", "+=", "Rack", "::", "Utils", ".", "bytesize", "(", "s", ")", "@writer", ".", "call", "s", "header", "[", "\"Content-Length\"", "]", "=", "@length", ".", "to_s", "str", "end" ]
Append to body and update Content-Length. NOTE: Do not mix #write and direct #body access!
[ "Append", "to", "body", "and", "update", "Content", "-", "Length", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/response.rb#L125-L132
1,751
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rexml/attribute.rb
REXML.Attribute.to_s
def to_s return @normalized if @normalized doctype = nil if @element doc = @element.document doctype = doc.doctype if doc end @normalized = Text::normalize( @unnormalized, doctype ) @unnormalized = nil @normalized end
ruby
def to_s return @normalized if @normalized doctype = nil if @element doc = @element.document doctype = doc.doctype if doc end @normalized = Text::normalize( @unnormalized, doctype ) @unnormalized = nil @normalized end
[ "def", "to_s", "return", "@normalized", "if", "@normalized", "doctype", "=", "nil", "if", "@element", "doc", "=", "@element", ".", "document", "doctype", "=", "doc", ".", "doctype", "if", "doc", "end", "@normalized", "=", "Text", "::", "normalize", "(", "@...
Returns the attribute value, with entities replaced
[ "Returns", "the", "attribute", "value", "with", "entities", "replaced" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rexml/attribute.rb#L114-L126
1,752
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rexml/attribute.rb
REXML.Attribute.value
def value return @unnormalized if @unnormalized doctype = nil if @element doc = @element.document doctype = doc.doctype if doc end @unnormalized = Text::unnormalize( @normalized, doctype ) @normalized = nil @unnormalized end
ruby
def value return @unnormalized if @unnormalized doctype = nil if @element doc = @element.document doctype = doc.doctype if doc end @unnormalized = Text::unnormalize( @normalized, doctype ) @normalized = nil @unnormalized end
[ "def", "value", "return", "@unnormalized", "if", "@unnormalized", "doctype", "=", "nil", "if", "@element", "doc", "=", "@element", ".", "document", "doctype", "=", "doc", ".", "doctype", "if", "doc", "end", "@unnormalized", "=", "Text", "::", "unnormalize", ...
Returns the UNNORMALIZED value of this attribute. That is, entities have been expanded to their values
[ "Returns", "the", "UNNORMALIZED", "value", "of", "this", "attribute", ".", "That", "is", "entities", "have", "been", "expanded", "to", "their", "values" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rexml/attribute.rb#L130-L140
1,753
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb
Rake.TaskManager.resolve_args_with_dependencies
def resolve_args_with_dependencies(args, hash) # :nodoc: fail "Task Argument Error" if hash.size != 1 key, value = hash.map { |k, v| [k,v] }.first if args.empty? task_name = key arg_names = [] deps = value elsif key == :needs task_name = args.shift arg_nam...
ruby
def resolve_args_with_dependencies(args, hash) # :nodoc: fail "Task Argument Error" if hash.size != 1 key, value = hash.map { |k, v| [k,v] }.first if args.empty? task_name = key arg_names = [] deps = value elsif key == :needs task_name = args.shift arg_nam...
[ "def", "resolve_args_with_dependencies", "(", "args", ",", "hash", ")", "# :nodoc:", "fail", "\"Task Argument Error\"", "if", "hash", ".", "size", "!=", "1", "key", ",", "value", "=", "hash", ".", "map", "{", "|", "k", ",", "v", "|", "[", "k", ",", "v"...
Resolve task arguments for a task or rule when there are dependencies declared. The patterns recognized by this argument resolving function are: task :t => [:d] task :t, [a] => [:d] task :t, :needs => [:d] (deprecated) task :t, :a, :needs => [:d] (deprecated)
[ "Resolve", "task", "arguments", "for", "a", "task", "or", "rule", "when", "there", "are", "dependencies", "declared", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb#L1777-L1795
1,754
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb
Rake.Application.top_level
def top_level standard_exception_handling do if options.show_tasks display_tasks_and_comments elsif options.show_prereqs display_prerequisites else top_level_tasks.each { |task_name| invoke_task(task_name) } end end end
ruby
def top_level standard_exception_handling do if options.show_tasks display_tasks_and_comments elsif options.show_prereqs display_prerequisites else top_level_tasks.each { |task_name| invoke_task(task_name) } end end end
[ "def", "top_level", "standard_exception_handling", "do", "if", "options", ".", "show_tasks", "display_tasks_and_comments", "elsif", "options", ".", "show_prereqs", "display_prerequisites", "else", "top_level_tasks", ".", "each", "{", "|", "task_name", "|", "invoke_task", ...
Run the top level tasks of a Rake application.
[ "Run", "the", "top", "level", "tasks", "of", "a", "Rake", "application", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb#L2022-L2032
1,755
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/ri_generator.rb
Generators.RIGenerator.method_list
def method_list(cls) list = cls.method_list unless @options.show_all list = list.find_all do |m| m.visibility == :public || m.visibility == :protected || m.force_documentation end end c = [] i = [] list.sort.each do |m| if m.singleton c <<...
ruby
def method_list(cls) list = cls.method_list unless @options.show_all list = list.find_all do |m| m.visibility == :public || m.visibility == :protected || m.force_documentation end end c = [] i = [] list.sort.each do |m| if m.singleton c <<...
[ "def", "method_list", "(", "cls", ")", "list", "=", "cls", ".", "method_list", "unless", "@options", ".", "show_all", "list", "=", "list", ".", "find_all", "do", "|", "m", "|", "m", ".", "visibility", "==", ":public", "||", "m", ".", "visibility", "=="...
return a list of class and instance methods that we'll be documenting
[ "return", "a", "list", "of", "class", "and", "instance", "methods", "that", "we", "ll", "be", "documenting" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/ri_generator.rb#L171-L189
1,756
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rcov-0.9.8-java/lib/rcov/differential_analyzer.rb
Rcov.DifferentialAnalyzer.reset
def reset @@mutex.synchronize do if self.class.hook_level == 0 # Unfortunately there's no way to report this as covered with rcov: # if we run the tests under rcov self.class.hook_level will be >= 1 ! # It is however executed when we run the tests normally. Rcov::RC...
ruby
def reset @@mutex.synchronize do if self.class.hook_level == 0 # Unfortunately there's no way to report this as covered with rcov: # if we run the tests under rcov self.class.hook_level will be >= 1 ! # It is however executed when we run the tests normally. Rcov::RC...
[ "def", "reset", "@@mutex", ".", "synchronize", "do", "if", "self", ".", "class", ".", "hook_level", "==", "0", "# Unfortunately there's no way to report this as covered with rcov:", "# if we run the tests under rcov self.class.hook_level will be >= 1 !", "# It is however executed whe...
Remove the data collected so far. Further collection will start from scratch.
[ "Remove", "the", "data", "collected", "so", "far", ".", "Further", "collection", "will", "start", "from", "scratch", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/rcov-0.9.8-java/lib/rcov/differential_analyzer.rb#L57-L72
1,757
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/net/ftp.rb
Net.FTP.putbinaryfile
def putbinaryfile(localfile, remotefile = File.basename(localfile), blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data if @resume begin rest_offset = size(remotefile) rescue Net::FTPPermError rest_offset = nil end else rest_offset = nil end ...
ruby
def putbinaryfile(localfile, remotefile = File.basename(localfile), blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data if @resume begin rest_offset = size(remotefile) rescue Net::FTPPermError rest_offset = nil end else rest_offset = nil end ...
[ "def", "putbinaryfile", "(", "localfile", ",", "remotefile", "=", "File", ".", "basename", "(", "localfile", ")", ",", "blocksize", "=", "DEFAULT_BLOCKSIZE", ",", "&", "block", ")", "# :yield: data", "if", "@resume", "begin", "rest_offset", "=", "size", "(", ...
Transfers +localfile+ to the server in binary mode, storing the result in +remotefile+. If a block is supplied, calls it, passing in the transmitted data in +blocksize+ chunks.
[ "Transfers", "+", "localfile", "+", "to", "the", "server", "in", "binary", "mode", "storing", "the", "result", "in", "+", "remotefile", "+", ".", "If", "a", "block", "is", "supplied", "calls", "it", "passing", "in", "the", "transmitted", "data", "in", "+...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/net/ftp.rb#L602-L620
1,758
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb
RI.ClassEntry.load_from
def load_from(dir) Dir.foreach(dir) do |name| next if name =~ /^\./ # convert from external to internal form, and # extract the instance/class flag if name =~ /^(.*?)-(c|i).yaml$/ external_name = $1 is_class_method = $2 == "c" internal_name = RiWrite...
ruby
def load_from(dir) Dir.foreach(dir) do |name| next if name =~ /^\./ # convert from external to internal form, and # extract the instance/class flag if name =~ /^(.*?)-(c|i).yaml$/ external_name = $1 is_class_method = $2 == "c" internal_name = RiWrite...
[ "def", "load_from", "(", "dir", ")", "Dir", ".", "foreach", "(", "dir", ")", "do", "|", "name", "|", "next", "if", "name", "=~", "/", "\\.", "/", "# convert from external to internal form, and", "# extract the instance/class flag", "if", "name", "=~", "/", "/"...
read in our methods and any classes and modules in our namespace. Methods are stored in files called name-c|i.yaml, where the 'name' portion is the external form of the method name and the c|i is a class|instance flag
[ "read", "in", "our", "methods", "and", "any", "classes", "and", "modules", "in", "our", "namespace", ".", "Methods", "are", "stored", "in", "files", "called", "name", "-", "c|i", ".", "yaml", "where", "the", "name", "portion", "is", "the", "external", "f...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb#L30-L58
1,759
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb
RI.ClassEntry.recursively_find_methods_matching
def recursively_find_methods_matching(name, is_class_method) res = local_methods_matching(name, is_class_method) @inferior_classes.each do |c| res.concat(c.recursively_find_methods_matching(name, is_class_method)) end res end
ruby
def recursively_find_methods_matching(name, is_class_method) res = local_methods_matching(name, is_class_method) @inferior_classes.each do |c| res.concat(c.recursively_find_methods_matching(name, is_class_method)) end res end
[ "def", "recursively_find_methods_matching", "(", "name", ",", "is_class_method", ")", "res", "=", "local_methods_matching", "(", "name", ",", "is_class_method", ")", "@inferior_classes", ".", "each", "do", "|", "c", "|", "res", ".", "concat", "(", "c", ".", "r...
Find methods matching 'name' in ourselves and in any classes we contain
[ "Find", "methods", "matching", "name", "in", "ourselves", "and", "in", "any", "classes", "we", "contain" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb#L85-L91
1,760
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb
RI.ClassEntry.all_method_names
def all_method_names res = @class_methods.map {|m| m.full_name } @instance_methods.each {|m| res << m.full_name} res end
ruby
def all_method_names res = @class_methods.map {|m| m.full_name } @instance_methods.each {|m| res << m.full_name} res end
[ "def", "all_method_names", "res", "=", "@class_methods", ".", "map", "{", "|", "m", "|", "m", ".", "full_name", "}", "@instance_methods", ".", "each", "{", "|", "m", "|", "res", "<<", "m", ".", "full_name", "}", "res", "end" ]
Return a list of all out method names
[ "Return", "a", "list", "of", "all", "out", "method", "names" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb#L102-L106
1,761
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb
RI.ClassEntry.local_methods_matching
def local_methods_matching(name, is_class_method) list = case is_class_method when nil then @class_methods + @instance_methods when true then @class_methods when false then @instance_methods else fail "Unknown is_class_method: #{is_class_method.inspect}" ...
ruby
def local_methods_matching(name, is_class_method) list = case is_class_method when nil then @class_methods + @instance_methods when true then @class_methods when false then @instance_methods else fail "Unknown is_class_method: #{is_class_method.inspect}" ...
[ "def", "local_methods_matching", "(", "name", ",", "is_class_method", ")", "list", "=", "case", "is_class_method", "when", "nil", "then", "@class_methods", "+", "@instance_methods", "when", "true", "then", "@class_methods", "when", "false", "then", "@instance_methods"...
Return a list of all our methods matching a given string. Is +is_class_methods+ if 'nil', we don't care if the method is a class method or not, otherwise we only return those methods that match
[ "Return", "a", "list", "of", "all", "our", "methods", "matching", "a", "given", "string", ".", "Is", "+", "is_class_methods", "+", "if", "nil", "we", "don", "t", "care", "if", "the", "method", "is", "a", "class", "method", "or", "not", "otherwise", "we...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_cache.rb#L114-L124
1,762
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb
RDoc::Generator.MarkUp.markup
def markup(str, remove_para = false) return '' unless str # Convert leading comment markers to spaces, but only if all non-blank # lines have them if str =~ /^(?>\s*)[^\#]/ then content = str else content = str.gsub(/^\s*(#+)/) { $1.tr '#', ' ' } end res = for...
ruby
def markup(str, remove_para = false) return '' unless str # Convert leading comment markers to spaces, but only if all non-blank # lines have them if str =~ /^(?>\s*)[^\#]/ then content = str else content = str.gsub(/^\s*(#+)/) { $1.tr '#', ' ' } end res = for...
[ "def", "markup", "(", "str", ",", "remove_para", "=", "false", ")", "return", "''", "unless", "str", "# Convert leading comment markers to spaces, but only if all non-blank", "# lines have them", "if", "str", "=~", "/", "\\s", "\\#", "/", "then", "content", "=", "st...
Convert a string in markup format into HTML.
[ "Convert", "a", "string", "in", "markup", "format", "into", "HTML", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb#L59-L78
1,763
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb
RDoc::Generator.Context.as_href
def as_href(from_path) if @options.all_one_file "#" + path else RDoc::Markup::ToHtml.gen_relative_url from_path, path end end
ruby
def as_href(from_path) if @options.all_one_file "#" + path else RDoc::Markup::ToHtml.gen_relative_url from_path, path end end
[ "def", "as_href", "(", "from_path", ")", "if", "@options", ".", "all_one_file", "\"#\"", "+", "path", "else", "RDoc", "::", "Markup", "::", "ToHtml", ".", "gen_relative_url", "from_path", ",", "path", "end", "end" ]
Returns a reference to outselves to be used as an href= the form depends on whether we're all in one file or in multiple files
[ "Returns", "a", "reference", "to", "outselves", "to", "be", "used", "as", "an", "href", "=", "the", "form", "depends", "on", "whether", "we", "re", "all", "in", "one", "file", "or", "in", "multiple", "files" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb#L179-L185
1,764
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb
RDoc::Generator.Context.collect_methods
def collect_methods list = @context.method_list unless @options.show_all then list = list.select do |m| m.visibility == :public or m.visibility == :protected or m.force_documentation end end @methods = list.collect do |m| RDoc::Generato...
ruby
def collect_methods list = @context.method_list unless @options.show_all then list = list.select do |m| m.visibility == :public or m.visibility == :protected or m.force_documentation end end @methods = list.collect do |m| RDoc::Generato...
[ "def", "collect_methods", "list", "=", "@context", ".", "method_list", "unless", "@options", ".", "show_all", "then", "list", "=", "list", ".", "select", "do", "|", "m", "|", "m", ".", "visibility", "==", ":public", "or", "m", ".", "visibility", "==", ":...
Create a list of Method objects for each method in the corresponding context object. If the @options.show_all variable is set (corresponding to the <tt>--all</tt> option, we include all methods, otherwise just the public ones.
[ "Create", "a", "list", "of", "Method", "objects", "for", "each", "method", "in", "the", "corresponding", "context", "object", ".", "If", "the" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb#L193-L207
1,765
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb
RDoc::Generator.Context.add_table_of_sections
def add_table_of_sections toc = [] @context.sections.each do |section| if section.title then toc << { 'secname' => section.title, 'href' => section.sequence } end end @values['toc'] = toc unless toc.empty? end
ruby
def add_table_of_sections toc = [] @context.sections.each do |section| if section.title then toc << { 'secname' => section.title, 'href' => section.sequence } end end @values['toc'] = toc unless toc.empty? end
[ "def", "add_table_of_sections", "toc", "=", "[", "]", "@context", ".", "sections", ".", "each", "do", "|", "section", "|", "if", "section", ".", "title", "then", "toc", "<<", "{", "'secname'", "=>", "section", ".", "title", ",", "'href'", "=>", "section"...
create table of contents if we contain sections
[ "create", "table", "of", "contents", "if", "we", "contain", "sections" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb#L462-L474
1,766
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb
RDoc::Generator.Class.http_url
def http_url(full_name, prefix) path = full_name.dup path.gsub!(/<<\s*(\w*)/, 'from-\1') if path['<<'] ::File.join(prefix, path.split("::")) + ".html" end
ruby
def http_url(full_name, prefix) path = full_name.dup path.gsub!(/<<\s*(\w*)/, 'from-\1') if path['<<'] ::File.join(prefix, path.split("::")) + ".html" end
[ "def", "http_url", "(", "full_name", ",", "prefix", ")", "path", "=", "full_name", ".", "dup", "path", ".", "gsub!", "(", "/", "\\s", "\\w", "/", ",", "'from-\\1'", ")", "if", "path", "[", "'<<'", "]", "::", "File", ".", "join", "(", "prefix", ",",...
Returns the relative file name to store this class in, which is also its url
[ "Returns", "the", "relative", "file", "name", "to", "store", "this", "class", "in", "which", "is", "also", "its", "url" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/rdoc/generator.rb#L512-L518
1,767
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/tools/const_generator.rb
FFI.ConstGenerator.to_ruby
def to_ruby @constants.sort_by { |name,| name }.map do |name, constant| if constant.value.nil? then "# #{name} not available" else constant.to_ruby end end.join "\n" end
ruby
def to_ruby @constants.sort_by { |name,| name }.map do |name, constant| if constant.value.nil? then "# #{name} not available" else constant.to_ruby end end.join "\n" end
[ "def", "to_ruby", "@constants", ".", "sort_by", "{", "|", "name", ",", "|", "name", "}", ".", "map", "do", "|", "name", ",", "constant", "|", "if", "constant", ".", "value", ".", "nil?", "then", "\"# #{name} not available\"", "else", "constant", ".", "to...
Outputs values for discovered constants. If the constant's value was not discovered it is not omitted.
[ "Outputs", "values", "for", "discovered", "constants", ".", "If", "the", "constant", "s", "value", "was", "not", "discovered", "it", "is", "not", "omitted", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/tools/const_generator.rb#L130-L138
1,768
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb
RI.ModuleDescription.merge_in
def merge_in(old) merge(@class_methods, old.class_methods) merge(@instance_methods, old.instance_methods) merge(@attributes, old.attributes) merge(@constants, old.constants) merge(@includes, old.includes) if @comment.nil? || @comment.empty? @comment = old.comment else ...
ruby
def merge_in(old) merge(@class_methods, old.class_methods) merge(@instance_methods, old.instance_methods) merge(@attributes, old.attributes) merge(@constants, old.constants) merge(@includes, old.includes) if @comment.nil? || @comment.empty? @comment = old.comment else ...
[ "def", "merge_in", "(", "old", ")", "merge", "(", "@class_methods", ",", "old", ".", "class_methods", ")", "merge", "(", "@instance_methods", ",", "old", ".", "instance_methods", ")", "merge", "(", "@attributes", ",", "old", ".", "attributes", ")", "merge", ...
merge in another class desscription into this one
[ "merge", "in", "another", "class", "desscription", "into", "this", "one" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb#L89-L103
1,769
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/irb/workspace.rb
IRB.WorkSpace.filter_backtrace
def filter_backtrace(bt) case IRB.conf[:CONTEXT_MODE] when 0 return nil if bt =~ /\(irb_local_binding\)/ when 1 if(bt =~ %r!/tmp/irb-binding! or bt =~ %r!irb/.*\.rb! or bt =~ /irb\.rb/) return nil end when 2 return nil if bt =~ /irb\/.*\.rb/ when 3 return nil if bt =~ /irb\...
ruby
def filter_backtrace(bt) case IRB.conf[:CONTEXT_MODE] when 0 return nil if bt =~ /\(irb_local_binding\)/ when 1 if(bt =~ %r!/tmp/irb-binding! or bt =~ %r!irb/.*\.rb! or bt =~ /irb\.rb/) return nil end when 2 return nil if bt =~ /irb\/.*\.rb/ when 3 return nil if bt =~ /irb\...
[ "def", "filter_backtrace", "(", "bt", ")", "case", "IRB", ".", "conf", "[", ":CONTEXT_MODE", "]", "when", "0", "return", "nil", "if", "bt", "=~", "/", "\\(", "\\)", "/", "when", "1", "if", "(", "bt", "=~", "%r!", "!", "or", "bt", "=~", "%r!", "\\...
error message manipulator
[ "error", "message", "manipulator" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/irb/workspace.rb#L85-L102
1,770
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_reader.rb
RI.RiReader.get_method
def get_method(method_entry) path = method_entry.path_name File.open(path) { |f| RI::Description.deserialize(f) } end
ruby
def get_method(method_entry) path = method_entry.path_name File.open(path) { |f| RI::Description.deserialize(f) } end
[ "def", "get_method", "(", "method_entry", ")", "path", "=", "method_entry", ".", "path_name", "File", ".", "open", "(", "path", ")", "{", "|", "f", "|", "RI", "::", "Description", ".", "deserialize", "(", "f", ")", "}", "end" ]
return the MethodDescription for a given MethodEntry by deserializing the YAML
[ "return", "the", "MethodDescription", "for", "a", "given", "MethodEntry", "by", "deserializing", "the", "YAML" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_reader.rb#L44-L47
1,771
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_reader.rb
RI.RiReader.get_class
def get_class(class_entry) result = nil for path in class_entry.path_names path = RiWriter.class_desc_path(path, class_entry) desc = File.open(path) {|f| RI::Description.deserialize(f) } if result result.merge_in(desc) else result = desc end ...
ruby
def get_class(class_entry) result = nil for path in class_entry.path_names path = RiWriter.class_desc_path(path, class_entry) desc = File.open(path) {|f| RI::Description.deserialize(f) } if result result.merge_in(desc) else result = desc end ...
[ "def", "get_class", "(", "class_entry", ")", "result", "=", "nil", "for", "path", "in", "class_entry", ".", "path_names", "path", "=", "RiWriter", ".", "class_desc_path", "(", "path", ",", "class_entry", ")", "desc", "=", "File", ".", "open", "(", "path", ...
Return a class description
[ "Return", "a", "class", "description" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_reader.rb#L50-L62
1,772
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_options.rb
RI.Options.parse
def parse(args) old_argv = ARGV.dup ARGV.replace(args) begin go = GetoptLong.new(*OptionList.options) go.quiet = true go.each do |opt, arg| case opt when "--help" then OptionList.usage when "--version" then show_version ...
ruby
def parse(args) old_argv = ARGV.dup ARGV.replace(args) begin go = GetoptLong.new(*OptionList.options) go.quiet = true go.each do |opt, arg| case opt when "--help" then OptionList.usage when "--version" then show_version ...
[ "def", "parse", "(", "args", ")", "old_argv", "=", "ARGV", ".", "dup", "ARGV", ".", "replace", "(", "args", ")", "begin", "go", "=", "GetoptLong", ".", "new", "(", "OptionList", ".", "options", ")", "go", ".", "quiet", "=", "true", "go", ".", "each...
Parse command line options.
[ "Parse", "command", "line", "options", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/ri/ri_options.rb#L250-L304
1,773
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/rdoc.rb
RDoc.RDoc.parse_files
def parse_files(options) file_info = [] files = options.files files = ["."] if files.empty? file_list = normalized_file_list(options, files, true) file_list.each do |fn| $stderr.printf("\n%35s: ", File.basename(fn)) unless options.quiet content = File.open(fn,...
ruby
def parse_files(options) file_info = [] files = options.files files = ["."] if files.empty? file_list = normalized_file_list(options, files, true) file_list.each do |fn| $stderr.printf("\n%35s: ", File.basename(fn)) unless options.quiet content = File.open(fn,...
[ "def", "parse_files", "(", "options", ")", "file_info", "=", "[", "]", "files", "=", "options", ".", "files", "files", "=", "[", "\".\"", "]", "if", "files", ".", "empty?", "file_list", "=", "normalized_file_list", "(", "options", ",", "files", ",", "tru...
Parse each file on the command line, recursively entering directories
[ "Parse", "each", "file", "on", "the", "command", "line", "recursively", "entering", "directories" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/rdoc.rb#L210-L231
1,774
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.7-java/lib/jdbc_adapter/missing_functionality_helper.rb
JdbcSpec.MissingFunctionalityHelper.alter_table
def alter_table(table_name, options = {}) #:nodoc: table_name = table_name.to_s.downcase altered_table_name = "altered_#{table_name}" caller = lambda {|definition| yield definition if block_given?} transaction do # A temporary table might improve performance here, but # it doesn...
ruby
def alter_table(table_name, options = {}) #:nodoc: table_name = table_name.to_s.downcase altered_table_name = "altered_#{table_name}" caller = lambda {|definition| yield definition if block_given?} transaction do # A temporary table might improve performance here, but # it doesn...
[ "def", "alter_table", "(", "table_name", ",", "options", "=", "{", "}", ")", "#:nodoc:", "table_name", "=", "table_name", ".", "to_s", ".", "downcase", "altered_table_name", "=", "\"altered_#{table_name}\"", "caller", "=", "lambda", "{", "|", "definition", "|", ...
Taken from SQLite adapter
[ "Taken", "from", "SQLite", "adapter" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.7-java/lib/jdbc_adapter/missing_functionality_helper.rb#L5-L17
1,775
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb
YAML.BaseNode.select
def select( ypath_str ) matches = match_path( ypath_str ) # # Create a new generic view of the elements selected # if matches result = [] matches.each { |m| result.push m.last } ...
ruby
def select( ypath_str ) matches = match_path( ypath_str ) # # Create a new generic view of the elements selected # if matches result = [] matches.each { |m| result.push m.last } ...
[ "def", "select", "(", "ypath_str", ")", "matches", "=", "match_path", "(", "ypath_str", ")", "#", "# Create a new generic view of the elements selected", "#", "if", "matches", "result", "=", "[", "]", "matches", ".", "each", "{", "|", "m", "|", "result", ".", ...
Search for YPath entry and return qualified nodes.
[ "Search", "for", "YPath", "entry", "and", "return", "qualified", "nodes", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb#L17-L30
1,776
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb
YAML.BaseNode.select!
def select!( ypath_str ) matches = match_path( ypath_str ) # # Create a new generic view of the elements selected # if matches result = [] matches.each { |m| result.push m.last.transform } ...
ruby
def select!( ypath_str ) matches = match_path( ypath_str ) # # Create a new generic view of the elements selected # if matches result = [] matches.each { |m| result.push m.last.transform } ...
[ "def", "select!", "(", "ypath_str", ")", "matches", "=", "match_path", "(", "ypath_str", ")", "#", "# Create a new generic view of the elements selected", "#", "if", "matches", "result", "=", "[", "]", "matches", ".", "each", "{", "|", "m", "|", "result", ".",...
Search for YPath entry and return transformed nodes.
[ "Search", "for", "YPath", "entry", "and", "return", "transformed", "nodes", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb#L36-L49
1,777
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb
YAML.BaseNode.search
def search( ypath_str ) matches = match_path( ypath_str ) if matches matches.collect { |m| path = [] m.each_index { |i| path.push m[i] if ( i % 2 ).zero? } "/" + path.compact....
ruby
def search( ypath_str ) matches = match_path( ypath_str ) if matches matches.collect { |m| path = [] m.each_index { |i| path.push m[i] if ( i % 2 ).zero? } "/" + path.compact....
[ "def", "search", "(", "ypath_str", ")", "matches", "=", "match_path", "(", "ypath_str", ")", "if", "matches", "matches", ".", "collect", "{", "|", "m", "|", "path", "=", "[", "]", "m", ".", "each_index", "{", "|", "i", "|", "path", ".", "push", "m"...
Search for YPath entry and return a list of qualified paths.
[ "Search", "for", "YPath", "entry", "and", "return", "a", "list", "of", "qualified", "paths", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb#L55-L67
1,778
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb
YAML.BaseNode.match_path
def match_path( ypath_str ) depth = 0 matches = [] YPath.each_path( ypath_str ) do |ypath| seg = match_segment( ypath, 0 ) matches += seg if seg end matches.uniq end
ruby
def match_path( ypath_str ) depth = 0 matches = [] YPath.each_path( ypath_str ) do |ypath| seg = match_segment( ypath, 0 ) matches += seg if seg end matches.uniq end
[ "def", "match_path", "(", "ypath_str", ")", "depth", "=", "0", "matches", "=", "[", "]", "YPath", ".", "each_path", "(", "ypath_str", ")", "do", "|", "ypath", "|", "seg", "=", "match_segment", "(", "ypath", ",", "0", ")", "matches", "+=", "seg", "if"...
YPath search returning a complete depth array
[ "YPath", "search", "returning", "a", "complete", "depth", "array" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb#L80-L88
1,779
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb
YAML.BaseNode.match_segment
def match_segment( ypath, depth ) deep_nodes = [] seg = ypath.segments[ depth ] if seg == "/" unless String === @value idx = -1 @value.collect { |v| idx += 1 if Hash === @value ...
ruby
def match_segment( ypath, depth ) deep_nodes = [] seg = ypath.segments[ depth ] if seg == "/" unless String === @value idx = -1 @value.collect { |v| idx += 1 if Hash === @value ...
[ "def", "match_segment", "(", "ypath", ",", "depth", ")", "deep_nodes", "=", "[", "]", "seg", "=", "ypath", ".", "segments", "[", "depth", "]", "if", "seg", "==", "\"/\"", "unless", "String", "===", "@value", "idx", "=", "-", "1", "@value", ".", "coll...
Search a node for a single YPath segment
[ "Search", "a", "node", "for", "a", "single", "YPath", "segment" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb#L93-L179
1,780
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb
YAML.BaseNode.[]
def []( *key ) if Hash === @value v = @value.detect { |k,| k.transform == key.first } v[1] if v elsif Array === @value @value.[]( *key ) end end
ruby
def []( *key ) if Hash === @value v = @value.detect { |k,| k.transform == key.first } v[1] if v elsif Array === @value @value.[]( *key ) end end
[ "def", "[]", "(", "*", "key", ")", "if", "Hash", "===", "@value", "v", "=", "@value", ".", "detect", "{", "|", "k", ",", "|", "k", ".", "transform", "==", "key", ".", "first", "}", "v", "[", "1", "]", "if", "v", "elsif", "Array", "===", "@val...
We want the node to act like as Hash if it is.
[ "We", "want", "the", "node", "to", "act", "like", "as", "Hash", "if", "it", "is", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/basenode.rb#L185-L192
1,781
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/markup/simple_markup/to_latex.rb
SM.ToLaTeX.escape
def escape(str) # $stderr.print "FE: ", str s = str. # sub(/\s+$/, ''). gsub(/([_\${}&%#])/, "#{BS}\\1"). gsub(/\\/, BACKSLASH). gsub(/\^/, HAT). gsub(/~/, TILDE). gsub(/</, LESSTHAN). gsub(/>/, GREATERTHAN). gsub(/,,/, ",{},"). gsub(/\`/, ...
ruby
def escape(str) # $stderr.print "FE: ", str s = str. # sub(/\s+$/, ''). gsub(/([_\${}&%#])/, "#{BS}\\1"). gsub(/\\/, BACKSLASH). gsub(/\^/, HAT). gsub(/~/, TILDE). gsub(/</, LESSTHAN). gsub(/>/, GREATERTHAN). gsub(/,,/, ",{},"). gsub(/\`/, ...
[ "def", "escape", "(", "str", ")", "# $stderr.print \"FE: \", str", "s", "=", "str", ".", "# sub(/\\s+$/, '').", "gsub", "(", "/", "\\$", "/", ",", "\"#{BS}\\\\1\"", ")", ".", "gsub", "(", "/", "\\\\", "/", ",", "BACKSLASH", ")", ".", "gsub", "(", ...
Escape a LaTeX string
[ "Escape", "a", "LaTeX", "string" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/markup/simple_markup/to_latex.rb#L64-L78
1,782
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/library.rb
FFI.Library.attach_function
def attach_function(mname, a2, a3, a4=nil, a5 = nil) cname, arg_types, ret_type, opts = (a4 && (a2.is_a?(String) || a2.is_a?(Symbol))) ? [ a2, a3, a4, a5 ] : [ mname.to_s, a2, a3, a4 ] # Convert :foo to the native type arg_types.map! { |e| find_type(e) } options = Hash.new options[:conve...
ruby
def attach_function(mname, a2, a3, a4=nil, a5 = nil) cname, arg_types, ret_type, opts = (a4 && (a2.is_a?(String) || a2.is_a?(Symbol))) ? [ a2, a3, a4, a5 ] : [ mname.to_s, a2, a3, a4 ] # Convert :foo to the native type arg_types.map! { |e| find_type(e) } options = Hash.new options[:conve...
[ "def", "attach_function", "(", "mname", ",", "a2", ",", "a3", ",", "a4", "=", "nil", ",", "a5", "=", "nil", ")", "cname", ",", "arg_types", ",", "ret_type", ",", "opts", "=", "(", "a4", "&&", "(", "a2", ".", "is_a?", "(", "String", ")", "||", "...
Attach C function +name+ to this module. If you want to provide an alternate name for the module function, supply it after the +name+, otherwise the C function name will be used. After the +name+, the C function argument types are provided as an Array. The C function return type is provided last.
[ "Attach", "C", "function", "+", "name", "+", "to", "this", "module", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/site_ruby/shared/ffi/library.rb#L81-L108
1,783
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.qualified_const_defined?
def qualified_const_defined?(path) raise NameError, "#{path.inspect} is not a valid constant name!" unless /^(::)?([A-Z]\w*)(::[A-Z]\w*)*$/ =~ path names = path.to_s.split('::') names.shift if names.first.empty? # We can't use defined? because it will invoke const_missing for the paren...
ruby
def qualified_const_defined?(path) raise NameError, "#{path.inspect} is not a valid constant name!" unless /^(::)?([A-Z]\w*)(::[A-Z]\w*)*$/ =~ path names = path.to_s.split('::') names.shift if names.first.empty? # We can't use defined? because it will invoke const_missing for the paren...
[ "def", "qualified_const_defined?", "(", "path", ")", "raise", "NameError", ",", "\"#{path.inspect} is not a valid constant name!\"", "unless", "/", "\\w", "\\w", "/", "=~", "path", "names", "=", "path", ".", "to_s", ".", "split", "(", "'::'", ")", "names", ".", ...
Is the provided constant path defined?
[ "Is", "the", "provided", "constant", "path", "defined?" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L278-L292
1,784
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.search_for_file
def search_for_file(path_suffix) path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb' load_paths.each do |root| path = File.join(root, path_suffix) return path if File.file? path end nil # Gee, I sure wish we had first_match ;-) end
ruby
def search_for_file(path_suffix) path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb' load_paths.each do |root| path = File.join(root, path_suffix) return path if File.file? path end nil # Gee, I sure wish we had first_match ;-) end
[ "def", "search_for_file", "(", "path_suffix", ")", "path_suffix", "=", "path_suffix", "+", "'.rb'", "unless", "path_suffix", ".", "ends_with?", "'.rb'", "load_paths", ".", "each", "do", "|", "root", "|", "path", "=", "File", ".", "join", "(", "root", ",", ...
Search for a file in load_paths matching the provided suffix.
[ "Search", "for", "a", "file", "in", "load_paths", "matching", "the", "provided", "suffix", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L330-L337
1,785
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.autoload_module!
def autoload_module!(into, const_name, qualified_name, path_suffix) return nil unless base_path = autoloadable_module?(path_suffix) mod = Module.new into.const_set const_name, mod autoloaded_constants << qualified_name unless load_once_paths.include?(base_path) return mod end
ruby
def autoload_module!(into, const_name, qualified_name, path_suffix) return nil unless base_path = autoloadable_module?(path_suffix) mod = Module.new into.const_set const_name, mod autoloaded_constants << qualified_name unless load_once_paths.include?(base_path) return mod end
[ "def", "autoload_module!", "(", "into", ",", "const_name", ",", "qualified_name", ",", "path_suffix", ")", "return", "nil", "unless", "base_path", "=", "autoloadable_module?", "(", "path_suffix", ")", "mod", "=", "Module", ".", "new", "into", ".", "const_set", ...
Attempt to autoload the provided module name by searching for a directory matching the expect path suffix. If found, the module is created and assigned to +into+'s constants with the name +const_name+. Provided that the directory was loaded from a reloadable base path, it is added to the set of constants that are t...
[ "Attempt", "to", "autoload", "the", "provided", "module", "name", "by", "searching", "for", "a", "directory", "matching", "the", "expect", "path", "suffix", ".", "If", "found", "the", "module", "is", "created", "and", "assigned", "to", "+", "into", "+", "s...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L357-L363
1,786
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.qualified_name_for
def qualified_name_for(mod, name) mod_name = to_constant_name mod (%w(Object Kernel).include? mod_name) ? name.to_s : "#{mod_name}::#{name}" end
ruby
def qualified_name_for(mod, name) mod_name = to_constant_name mod (%w(Object Kernel).include? mod_name) ? name.to_s : "#{mod_name}::#{name}" end
[ "def", "qualified_name_for", "(", "mod", ",", "name", ")", "mod_name", "=", "to_constant_name", "mod", "(", "%w(", "Object", "Kernel", ")", ".", "include?", "mod_name", ")", "?", "name", ".", "to_s", ":", "\"#{mod_name}::#{name}\"", "end" ]
Return the constant path for the provided parent and constant name.
[ "Return", "the", "constant", "path", "for", "the", "provided", "parent", "and", "constant", "name", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L390-L393
1,787
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.load_missing_constant
def load_missing_constant(from_mod, const_name) log_call from_mod, const_name if from_mod == Kernel if ::Object.const_defined?(const_name) log "Returning Object::#{const_name} for Kernel::#{const_name}" return ::Object.const_get(const_name) else log "Substitutin...
ruby
def load_missing_constant(from_mod, const_name) log_call from_mod, const_name if from_mod == Kernel if ::Object.const_defined?(const_name) log "Returning Object::#{const_name} for Kernel::#{const_name}" return ::Object.const_get(const_name) else log "Substitutin...
[ "def", "load_missing_constant", "(", "from_mod", ",", "const_name", ")", "log_call", "from_mod", ",", "const_name", "if", "from_mod", "==", "Kernel", "if", "::", "Object", ".", "const_defined?", "(", "const_name", ")", "log", "\"Returning Object::#{const_name} for Ker...
Load the constant named +const_name+ which is missing from +from_mod+. If it is not possible to load the constant into from_mod, try its parent module using const_missing.
[ "Load", "the", "constant", "named", "+", "const_name", "+", "which", "is", "missing", "from", "+", "from_mod", "+", ".", "If", "it", "is", "not", "possible", "to", "load", "the", "constant", "into", "from_mod", "try", "its", "parent", "module", "using", ...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L398-L445
1,788
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.remove_unloadable_constants!
def remove_unloadable_constants! autoloaded_constants.each { |const| remove_constant const } autoloaded_constants.clear explicitly_unloadable_constants.each { |const| remove_constant const } end
ruby
def remove_unloadable_constants! autoloaded_constants.each { |const| remove_constant const } autoloaded_constants.clear explicitly_unloadable_constants.each { |const| remove_constant const } end
[ "def", "remove_unloadable_constants!", "autoloaded_constants", ".", "each", "{", "|", "const", "|", "remove_constant", "const", "}", "autoloaded_constants", ".", "clear", "explicitly_unloadable_constants", ".", "each", "{", "|", "const", "|", "remove_constant", "const",...
Remove the constants that have been autoloaded, and those that have been marked for unloading.
[ "Remove", "the", "constants", "that", "have", "been", "autoloaded", "and", "those", "that", "have", "been", "marked", "for", "unloading", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L449-L453
1,789
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.autoloaded?
def autoloaded?(desc) # No name => anonymous module. return false if desc.is_a?(Module) && desc.name.blank? name = to_constant_name desc return false unless qualified_const_defined? name return autoloaded_constants.include?(name) end
ruby
def autoloaded?(desc) # No name => anonymous module. return false if desc.is_a?(Module) && desc.name.blank? name = to_constant_name desc return false unless qualified_const_defined? name return autoloaded_constants.include?(name) end
[ "def", "autoloaded?", "(", "desc", ")", "# No name => anonymous module.", "return", "false", "if", "desc", ".", "is_a?", "(", "Module", ")", "&&", "desc", ".", "name", ".", "blank?", "name", "=", "to_constant_name", "desc", "return", "false", "unless", "qualif...
Determine if the given constant has been automatically loaded.
[ "Determine", "if", "the", "given", "constant", "has", "been", "automatically", "loaded", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L456-L462
1,790
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb
ActiveSupport.Dependencies.mark_for_unload
def mark_for_unload(const_desc) name = to_constant_name const_desc if explicitly_unloadable_constants.include? name return false else explicitly_unloadable_constants << name return true end end
ruby
def mark_for_unload(const_desc) name = to_constant_name const_desc if explicitly_unloadable_constants.include? name return false else explicitly_unloadable_constants << name return true end end
[ "def", "mark_for_unload", "(", "const_desc", ")", "name", "=", "to_constant_name", "const_desc", "if", "explicitly_unloadable_constants", ".", "include?", "name", "return", "false", "else", "explicitly_unloadable_constants", "<<", "name", "return", "true", "end", "end" ...
Mark the provided constant name for unloading. This constant will be unloaded on each request, not just the next one.
[ "Mark", "the", "provided", "constant", "name", "for", "unloading", ".", "This", "constant", "will", "be", "unloaded", "on", "each", "request", "not", "just", "the", "next", "one", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb#L472-L480
1,791
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/baseemitter.rb
YAML.BaseEmitter.indent_text
def indent_text( text, mod, first_line = true ) return "" if text.to_s.empty? spacing = indent( mod ) text = text.gsub( /\A([^\n])/, "#{ spacing }\\1" ) if first_line return text.gsub( /\n^([^\n])/, "\n#{spacing}\\1" ) end
ruby
def indent_text( text, mod, first_line = true ) return "" if text.to_s.empty? spacing = indent( mod ) text = text.gsub( /\A([^\n])/, "#{ spacing }\\1" ) if first_line return text.gsub( /\n^([^\n])/, "\n#{spacing}\\1" ) end
[ "def", "indent_text", "(", "text", ",", "mod", ",", "first_line", "=", "true", ")", "return", "\"\"", "if", "text", ".", "to_s", ".", "empty?", "spacing", "=", "indent", "(", "mod", ")", "text", "=", "text", ".", "gsub", "(", "/", "\\A", "\\n", "/"...
Write a text block with the current indent
[ "Write", "a", "text", "block", "with", "the", "current", "indent" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/baseemitter.rb#L100-L105
1,792
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.9/yaml/baseemitter.rb
YAML.BaseEmitter.indent
def indent( mod = nil ) #p [ self.id, level, mod, :INDENT ] if level <= 0 mod ||= 0 else mod ||= options(:Indent) mod += ( level - 1 ) * options(:Indent) end return " " * mod end
ruby
def indent( mod = nil ) #p [ self.id, level, mod, :INDENT ] if level <= 0 mod ||= 0 else mod ||= options(:Indent) mod += ( level - 1 ) * options(:Indent) end return " " * mod end
[ "def", "indent", "(", "mod", "=", "nil", ")", "#p [ self.id, level, mod, :INDENT ]", "if", "level", "<=", "0", "mod", "||=", "0", "else", "mod", "||=", "options", "(", ":Indent", ")", "mod", "+=", "(", "level", "-", "1", ")", "*", "options", "(", ":Ind...
Write a current indent
[ "Write", "a", "current", "indent" ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.9/yaml/baseemitter.rb#L110-L119
1,793
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/net/ftp.rb
Net.FTP.getbinaryfile
def getbinaryfile(remotefile, localfile = File.basename(remotefile), blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data if @resume rest_offset = File.size?(localfile) f = open(localfile, "a") else rest_offset = nil f = open(localfile, "w") end begin f.binmode retrbinary("RETR " ...
ruby
def getbinaryfile(remotefile, localfile = File.basename(remotefile), blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data if @resume rest_offset = File.size?(localfile) f = open(localfile, "a") else rest_offset = nil f = open(localfile, "w") end begin f.binmode retrbinary("RETR " ...
[ "def", "getbinaryfile", "(", "remotefile", ",", "localfile", "=", "File", ".", "basename", "(", "remotefile", ")", ",", "blocksize", "=", "DEFAULT_BLOCKSIZE", ",", "&", "block", ")", "# :yield: data", "if", "@resume", "rest_offset", "=", "File", ".", "size?", ...
Retrieves +remotefile+ in binary mode, storing the result in +localfile+. If a block is supplied, it is passed the retrieved data in +blocksize+ chunks.
[ "Retrieves", "+", "remotefile", "+", "in", "binary", "mode", "storing", "the", "result", "in", "+", "localfile", "+", ".", "If", "a", "block", "is", "supplied", "it", "is", "passed", "the", "retrieved", "data", "in", "+", "blocksize", "+", "chunks", "." ...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/net/ftp.rb#L493-L511
1,794
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rinda/ring.rb
Rinda.RingServer.do_write
def do_write(msg) Thread.new do begin tuple, sec = Marshal.load(msg) @ts.write(tuple, sec) rescue end end end
ruby
def do_write(msg) Thread.new do begin tuple, sec = Marshal.load(msg) @ts.write(tuple, sec) rescue end end end
[ "def", "do_write", "(", "msg", ")", "Thread", ".", "new", "do", "begin", "tuple", ",", "sec", "=", "Marshal", ".", "load", "(", "msg", ")", "@ts", ".", "write", "(", "tuple", ",", "sec", ")", "rescue", "end", "end", "end" ]
Extracts the response URI from +msg+ and adds it to TupleSpace where it will be picked up by +reply_service+ for notification.
[ "Extracts", "the", "response", "URI", "from", "+", "msg", "+", "and", "adds", "it", "to", "TupleSpace", "where", "it", "will", "be", "picked", "up", "by", "+", "reply_service", "+", "for", "notification", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rinda/ring.rb#L57-L65
1,795
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rinda/ring.rb
Rinda.RingFinger.lookup_ring
def lookup_ring(timeout=5, &block) return lookup_ring_any(timeout) unless block_given? msg = Marshal.dump([[:lookup_ring, DRbObject.new(block)], timeout]) @broadcast_list.each do |it| soc = UDPSocket.open begin soc.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true) soc.send(msg, 0, it...
ruby
def lookup_ring(timeout=5, &block) return lookup_ring_any(timeout) unless block_given? msg = Marshal.dump([[:lookup_ring, DRbObject.new(block)], timeout]) @broadcast_list.each do |it| soc = UDPSocket.open begin soc.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true) soc.send(msg, 0, it...
[ "def", "lookup_ring", "(", "timeout", "=", "5", ",", "&", "block", ")", "return", "lookup_ring_any", "(", "timeout", ")", "unless", "block_given?", "msg", "=", "Marshal", ".", "dump", "(", "[", "[", ":lookup_ring", ",", "DRbObject", ".", "new", "(", "blo...
Looks up RingServers waiting +timeout+ seconds. RingServers will be given +block+ as a callback, which will be called with the remote TupleSpace.
[ "Looks", "up", "RingServers", "waiting", "+", "timeout", "+", "seconds", ".", "RingServers", "will", "be", "given", "+", "block", "+", "as", "a", "callback", "which", "will", "be", "called", "with", "the", "remote", "TupleSpace", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rinda/ring.rb#L176-L192
1,796
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/chm_generator.rb
Generators.CHMGenerator.create_project_file
def create_project_file template = TemplatePage.new(RDoc::Page::HPP_FILE) values = { "title" => @options.title, "opname" => @op_name } files = [] @files.each do |f| files << { "html_file_name" => f.path } end values['all_html_files'] = files File.open(@project_name, "w...
ruby
def create_project_file template = TemplatePage.new(RDoc::Page::HPP_FILE) values = { "title" => @options.title, "opname" => @op_name } files = [] @files.each do |f| files << { "html_file_name" => f.path } end values['all_html_files'] = files File.open(@project_name, "w...
[ "def", "create_project_file", "template", "=", "TemplatePage", ".", "new", "(", "RDoc", "::", "Page", "::", "HPP_FILE", ")", "values", "=", "{", "\"title\"", "=>", "@options", ".", "title", ",", "\"opname\"", "=>", "@op_name", "}", "files", "=", "[", "]", ...
The project file links together all the various files that go to make up the help.
[ "The", "project", "file", "links", "together", "all", "the", "various", "files", "that", "go", "to", "make", "up", "the", "help", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/chm_generator.rb#L54-L67
1,797
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/chm_generator.rb
Generators.CHMGenerator.create_contents_and_index
def create_contents_and_index contents = [] index = [] (@files+@classes).sort.each do |entry| content_entry = { "c_name" => entry.name, "ref" => entry.path } index << { "name" => entry.name, "aref" => entry.path } internals = [] methods = entry.build_method_summary_list(entry.path) content...
ruby
def create_contents_and_index contents = [] index = [] (@files+@classes).sort.each do |entry| content_entry = { "c_name" => entry.name, "ref" => entry.path } index << { "name" => entry.name, "aref" => entry.path } internals = [] methods = entry.build_method_summary_list(entry.path) content...
[ "def", "create_contents_and_index", "contents", "=", "[", "]", "index", "=", "[", "]", "(", "@files", "+", "@classes", ")", ".", "sort", ".", "each", "do", "|", "entry", "|", "content_entry", "=", "{", "\"c_name\"", "=>", "entry", ".", "name", ",", "\"...
The contents is a list of all files and modules. For each we include as sub-entries the list of methods they contain. As we build the contents we also build an index file
[ "The", "contents", "is", "a", "list", "of", "all", "files", "and", "modules", ".", "For", "each", "we", "include", "as", "sub", "-", "entries", "the", "list", "of", "methods", "they", "contain", ".", "As", "we", "build", "the", "contents", "we", "also"...
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rdoc/generators/chm_generator.rb#L74-L102
1,798
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rinda/tuplespace.rb
Rinda.TupleEntry.get_renewer
def get_renewer(it) case it when Numeric, true, nil return it, nil else begin return it.renew, it rescue Exception return it, nil end end end
ruby
def get_renewer(it) case it when Numeric, true, nil return it, nil else begin return it.renew, it rescue Exception return it, nil end end end
[ "def", "get_renewer", "(", "it", ")", "case", "it", "when", "Numeric", ",", "true", ",", "nil", "return", "it", ",", "nil", "else", "begin", "return", "it", ".", "renew", ",", "it", "rescue", "Exception", "return", "it", ",", "nil", "end", "end", "en...
Returns a valid argument to make_expires and the renewer or nil. Given +true+, +nil+, or Numeric, returns that value and +nil+ (no actual renewer). Otherwise it returns an expiry value from calling +it.renew+ and the renewer.
[ "Returns", "a", "valid", "argument", "to", "make_expires", "and", "the", "renewer", "or", "nil", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rinda/tuplespace.rb#L145-L156
1,799
ThoughtWorksStudios/oauth2_provider
tools/jruby-1.5.1/lib/ruby/1.8/rinda/tuplespace.rb
Rinda.TupleBag.push
def push(tuple) key = bin_key(tuple) @hash[key] ||= TupleBin.new @hash[key].add(tuple) end
ruby
def push(tuple) key = bin_key(tuple) @hash[key] ||= TupleBin.new @hash[key].add(tuple) end
[ "def", "push", "(", "tuple", ")", "key", "=", "bin_key", "(", "tuple", ")", "@hash", "[", "key", "]", "||=", "TupleBin", ".", "new", "@hash", "[", "key", "]", ".", "add", "(", "tuple", ")", "end" ]
Add +tuple+ to the TupleBag.
[ "Add", "+", "tuple", "+", "to", "the", "TupleBag", "." ]
d54702f194edd05389968cf8947465860abccc5d
https://github.com/ThoughtWorksStudios/oauth2_provider/blob/d54702f194edd05389968cf8947465860abccc5d/tools/jruby-1.5.1/lib/ruby/1.8/rinda/tuplespace.rb#L333-L337