Sets files to files
, ensuring it is an array.
the spec of the gem to be uninstalled
Display an informational alert. Will ask question
if it is not nil.
Means the line was marked as “invisible” Confusingly, “empty” lines are visible…they just don’t contain any source code other than a newline (“n”).
Returns true
if the process terminated because of an uncaught signal, false
otherwise.
Returns true
if the process generated a coredump when it terminated, false
if not.
Not available on all platforms.
Releases the lock and sleeps timeout
seconds if it is given and non-nil or forever. Raises ThreadError
if mutex
wasn’t locked by the current thread.
When the thread is next woken up, it will attempt to reacquire the lock.
Note that this method can wakeup without explicit Thread#wakeup
call. For example, receiving signal and so on.
Returns the slept time in seconds if woken up, or nil
if timed out.
Removes all objects from the queue.
Returns the length of the queue.
Removes all objects from the queue.
Returns the length of the queue.
Deletes the entry for the given key
and returns its associated value.
If no block is given and key
is found, deletes the entry and returns the associated value:
m = ObjectSpace::WeakMap.new key = "foo" m[key] = 1 m.delete(key) # => 1 m[key] # => nil
If no block is given and key
is not found, returns nil
.
If a block is given and key
is found, ignores the block, deletes the entry, and returns the associated value:
m = ObjectSpace::WeakMap.new key = "foo" m[key] = 2 m.delete(key) { |key| raise 'Will never happen'} # => 2
If a block is given and key
is not found, yields the key
to the block and returns the block’s return value:
m = ObjectSpace::WeakMap.new m.delete("nosuch") { |key| "Key #{key} not found" } # => "Key nosuch not found"
Returns the number of referenced objects
Deletes the entry for the given key
and returns its associated value.
If no block is given and key
is found, deletes the entry and returns the associated value:
m = ObjectSpace::WeakKeyMap.new key = "foo" # to hold reference to the key m[key] = 1 m.delete("foo") # => 1 m["foo"] # => nil
If no block given and key
is not found, returns nil
.
If a block is given and key
is found, ignores the block, deletes the entry, and returns the associated value:
m = ObjectSpace::WeakKeyMap.new key = "foo" # to hold reference to the key m[key] = 2 m.delete("foo") { |key| raise 'Will never happen'} # => 2
If a block is given and key
is not found, yields the key
to the block and returns the block’s return value:
m = ObjectSpace::WeakKeyMap.new m.delete("nosuch") { |key| "Key #{key} not found" } # => "Key nosuch not found"
Removes all map entries; returns self
.
Escape
only the tags of certain HTML elements in string
.
Takes an element or elements or array of elements. Each element is specified by the name of the element, without angle brackets. This matches both the start and the end tag of that element. The attribute list of the open tag will also be escaped (for instance, the double-quotes surrounding attribute values).
print CGI.escapeElement('<BR><A HREF="url"></A>', "A", "IMG") # "<BR><A HREF="url"></A>" print CGI.escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"]) # "<BR><A HREF="url"></A>"
Returns digest_obj.digest_length().