You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2018/10/26 16:29:01 UTC

[tinkerpop] branch TINKERPOP-2059 updated: wip

This is an automated email from the ASF dual-hosted git repository.

dkuppitz pushed a commit to branch TINKERPOP-2059
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/TINKERPOP-2059 by this push:
     new 61d1ea2  wip
61d1ea2 is described below

commit 61d1ea24c48bf4f2d3c3287c666064b66e3572d1
Author: Daniel Kuppitz <da...@hotmail.com>
AuthorDate: Fri Oct 26 09:28:55 2018 -0700

    wip
---
 gremlin-javascript/glv/TraversalSource.template                  | 8 +++-----
 .../src/main/javascript/gremlin-javascript/index.js              | 3 ++-
 .../main/javascript/gremlin-javascript/lib/process/traversal.js  | 9 ++-------
 .../javascript/gremlin-javascript/test/cucumber/feature-steps.js | 3 ++-
 gremlin-test/features/map/ValueMap.feature                       | 2 +-
 5 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/gremlin-javascript/glv/TraversalSource.template b/gremlin-javascript/glv/TraversalSource.template
index 7fc716a..32a69ec 100644
--- a/gremlin-javascript/glv/TraversalSource.template
+++ b/gremlin-javascript/glv/TraversalSource.template
@@ -254,11 +254,9 @@ module.exports = {
   IO,
   Traversal,
   TraversalSideEffects,
-  Traverser<%
-withOptions.each { option ->
-    out.print ",\n  " + option.name + ": " + "WithOption." + option.name
-}
-%><%
+  Traverser,
+  withOptions: WithOptions,
+  //withOptions: toEnum('WithOptions', '<%= withOptions.collect {it.name}.join(' ') %>')<%
 enums.each{ enumClass ->
     out.print ",\n  " + decapitalize.call(enumClass.simpleName) + ": toEnum('" + enumClass.simpleName + "', '" +
         enumClass.getEnumConstants().sort { a, b -> a.name() <=> b.name() }.collect { toJs.call(it.name()) }.join(' ') + "')"
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
index 8c89b2b..6cc4004 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
@@ -71,7 +71,8 @@ module.exports = {
     GraphTraversal: gt.GraphTraversal,
     GraphTraversalSource: gt.GraphTraversalSource,
     statics: gt.statics,
-    Translator: Translator
+    Translator: Translator,
+    WithOptions: t.withOptions
   },
   structure: {
     io: {
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
index 0a732ad..5e9f5ea 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
@@ -440,13 +440,8 @@ module.exports = {
   Traversal,
   TraversalSideEffects,
   Traverser,
-  tokens: WithOption.tokens,
-  none: WithOption.none,
-  ids: WithOption.ids,
-  labels: WithOption.labels,
-  keys: WithOption.keys,
-  values: WithOption.values,
-  all: WithOption.all,
+  withOptions: WithOptions
+  //withOptions: toEnum('WithOptions', 'tokens none ids labels keys values all'),
   barrier: toEnum('Barrier', 'normSack'),
   cardinality: toEnum('Cardinality', 'list set single'),
   column: toEnum('Column', 'keys values'),
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
index d1d5b52..5f63bff 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
@@ -225,7 +225,8 @@ function getSandbox(g, parameters) {
     Scope: traversalModule.scope,
     Operator: traversalModule.operator,
     T: traversalModule.t,
-    toLong: utils.toLong
+    toLong: utils.toLong,
+    WithOptions: traversalModule.withOptions
   };
   // Pass the parameter to the sandbox
   Object.keys(parameters).forEach(paramName => sandbox[paramName] = parameters[paramName]);
diff --git a/gremlin-test/features/map/ValueMap.feature b/gremlin-test/features/map/ValueMap.feature
index d9e5034..2d315a4 100644
--- a/gremlin-test/features/map/ValueMap.feature
+++ b/gremlin-test/features/map/ValueMap.feature
@@ -97,7 +97,7 @@ Feature: Step - valueMap()
     Given the modern graph
     And the traversal of
       """
-      g.V().hasLabel("person").filter(__.outE("created")).valueMap().with(tokens)
+      g.V().hasLabel("person").filter(__.outE("created")).valueMap().with(WithOptions.tokens)
       """
     When iterated to list
     Then the result should be unordered