A log for dependency graph actions
# File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb, line 51 def delete_edge(graph, origin_name, destination_name, requirement) push_action(graph, DeleteEdge.new(origin_name, destination_name, requirement)) end
{include:DependencyGraph#delete_edge} @param [Graph] graph the graph to perform the action on @param [String] origin_name @param [String] destination_name @param [Object] requirement @return (see DependencyGraph#delete_edge
)
# File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb, line 63 def pop!(graph) return unless action = @current_action unless @current_action = action.previous @first_action = nil end action.down(graph) action end
Pops the most recent action from the log and undoes the action @param [DependencyGraph] graph @return [Action] the action that was popped off the log
# File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb, line 91 def reverse_each return enum_for(:reverse_each) unless block_given? action = @current_action loop do break unless action yield action action = action.previous end self end
@!visibility private Enumerates each action in the log in reverse order @yield [Action]
# File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb, line 117 def push_action(graph, action) action.previous = @current_action @current_action.next = action if @current_action @current_action = action @first_action ||= action action.up(graph) end
Adds the given action to the log, running the action @param [DependencyGraph] graph @param [Action] action @return The value returned by `action.up`
Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.