You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/03/11 19:26:57 UTC

[41/50] [abbrv] incubator-tinkerpop git commit: SugarLoader 'fix' for GraphTraversalContext.

SugarLoader 'fix' for GraphTraversalContext.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/a78c6793
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/a78c6793
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/a78c6793

Branch: refs/heads/master
Commit: a78c6793c740e64773cfd4329950083ffc7e3474
Parents: 221fe05
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Mar 10 11:43:37 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Mar 10 11:43:37 2015 -0600

----------------------------------------------------------------------
 .../tinkerpop/gremlin/groovy/loaders/SugarLoader.groovy      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/a78c6793/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/SugarLoader.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/SugarLoader.groovy b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/SugarLoader.groovy
index 198dc99..06f3dfe 100644
--- a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/SugarLoader.groovy
+++ b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/SugarLoader.groovy
@@ -57,6 +57,10 @@ class SugarLoader {
                 return ((GraphTraversal) delegate).values(name);
         }
 
+        GraphTraversalContext.metaClass.getProperty = { final String key ->
+            GraphTraversalContextCategory.get((GraphTraversalContext)delegate, key);
+        }
+
         // __.age and __.out
         __.metaClass.static.propertyMissing = { final String name ->
             return null != __.metaClass.getMetaMethod(name) ? __."$name"() : __.values(name);
@@ -74,10 +78,10 @@ class SugarLoader {
         }*/
 
         // select x,y from ...
-        /*Object.metaClass.methodMissing = { final String name, final def args ->
+        Object.metaClass.methodMissing = { final String name, final def args ->
             if (name.toLowerCase().equals(SELECT)) return __.select(*args)
             throw new MissingMethodException(name, delegate.getClass(), args);
-        }*/
+        }
 
         Traverser.metaClass.mixin(TraverserCategory.class);
         GraphTraversalContext.metaClass.mixin(GraphTraversalContextCategory.class);