lib/grumlin/shortcuts.rb in grumlin-0.14.3 vs lib/grumlin/shortcuts.rb in grumlin-0.14.4
- old
+ new
@@ -21,10 +21,10 @@
def shortcut(name, &block)
name = name.to_sym
# TODO: blocklist of names to avoid conflicts with standard methods?
raise ArgumentError, "cannot use names of standard gremlin steps" if Grumlin.supported_steps.include?(name)
- raise ArgumentError, "shortcut '#{name}' already exists" if shortcuts.key?(name)
+ raise ArgumentError, "shortcut '#{name}' already exists" if shortcuts.key?(name) && shortcuts[name] != block
shortcuts[name] = block
end
def shortcuts_from(other_shortcuts)