sexp

sexp(src, filename = '-', lineno = 1) Class Public methods EXPERIMENTAL Parses src and create S-exp tree. Returns more readable tree rather than ::sexp_raw. This method is mainly for developer use. require 'ripper' require 'pp' pp Ripper.sexp("def m(a) nil end") #=> [:program, [[:def, [:@ident, "m", [1, 4]], [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil]], [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]]

http_header

http_header(content_type_string="text/html")http_header(headers_hash) Instance Public methods Create an HTTP header block as a string. Includes the empty line that ends the header block. content_type_string If this form is used, this string is the Content-Type headers_hash A Hash of header values. The following header keys are recognized: type The Content-Type header. Defaults to âtext/htmlâ charset The charset of the body, appended to the Content-Type header. nph A

classname

classname(win) Class Public methods

header_row?

header_row?() Instance Public methods Returns true if the next row read will be a header row.

revert

revert(*migration_classes) Instance Public methods Reverses the migration commands for the given block and the given migrations. The following migration will remove the table 'horses' and create the table 'apples' on the way up, and the reverse on the way down. class FixTLMigration < ActiveRecord::Migration def change revert do create_table(:horses) do |t| t.text :content t.datetime :remind_at end end create_table(:apples) do |t| t

string_length

string_length( string ) Class Public methods UNTESTED

mon_synchronize

mon_synchronize() Instance Public methods Enters exclusive section and executes the block. Leaves the exclusive section automatically when the block exits. See example under MonitorMixin. synchronize

getaddress

getaddress(name) Instance Public methods Gets the IP address of name from the hosts file.

touch

touch(list, options = {}) Class Public methods Options: noop verbose Updates modification time (mtime) and access time (atime) of file(s) in list. Files are created if they don't exist. FileUtils.touch 'timestamp' FileUtils.touch Dir.glob('*.c'); system 'make'

divmod

divmod(p1) Instance Public methods Divides by the specified value, and returns the quotient and modulus as BigDecimal numbers. The quotient is rounded towards negative infinity. For example: require 'bigdecimal' a = ::new(â42â) b = ::new(â9â) q,m = a.divmod(b) c = q * b + m a == c -> true The quotient q is (a/b).floor, and the modulus is the amount that must be added to q * b to get a.