Dispatch enter and leave events for BlockParametersNode
nodes and continue walking the tree.
Dispatch enter and leave events for ConstantPathNode
nodes and continue walking the tree.
Dispatch enter and leave events for ForwardingParameterNode
nodes and continue walking the tree.
Dispatch enter and leave events for NumberedParametersNode
nodes and continue walking the tree.
Dispatch enter and leave events for RequiredParameterNode
nodes and continue walking the tree.
Dispatch enter and leave events for RestParameterNode
nodes and continue walking the tree.
Get all gem names from the command line.
Get a single gem name from the command line. Fail if there is no gem name or if there is more than one gem name given.
Suggests gems based on the supplied gem_name
. Returns an array of alternative gem names.
Returns every spec that matches name
and optional requirements
.
Find
the best specification matching a full_name
.
@return [Array] specs of default gems that are ‘==` to the given `spec`.
Corrects path
(usually returned by ‘URI.parse().path` on Windows), that comes with a leading slash.
Defines a public singleton method in the receiver. The method parameter can be a Proc
, a Method
or an UnboundMethod
object. If a block is specified, it is used as the method body. If a block or a method has parameters, they’re used as method parameters.
class A class << self def class_name to_s end end end A.define_singleton_method(:who_am_i) do "I am: #{class_name}" end A.who_am_i # ==> "I am: A" guy = "Bob" guy.define_singleton_method(:hello) { "#{self}: Hello there!" } guy.hello #=> "Bob: Hello there!" chris = "Chris" chris.define_singleton_method(:greet) {|greeting| "#{greeting}, I'm Chris!" } chris.greet("Hi") #=> "Hi, I'm Chris!"