You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2018/07/29 13:20:35 UTC

[incubator-openwhisk-cli] branch master updated: add recogniztion for ruby (.rb) files (#352)

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

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new 89ac2b9  add recogniztion for ruby (.rb) files (#352)
89ac2b9 is described below

commit 89ac2b9ab3e0fa6917fbee3a820576795b3d260d
Author: Kei Sawada <ri...@lunanet.gr.jp>
AuthorDate: Sun Jul 29 22:20:33 2018 +0900

    add recogniztion for ruby (.rb) files (#352)
---
 commands/action.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/commands/action.go b/commands/action.go
index c21d946..615f56b 100644
--- a/commands/action.go
+++ b/commands/action.go
@@ -53,11 +53,13 @@ const (
 	SWIFT_EXT         = ".swift"
 	ZIP_EXT           = ".zip"
 	PHP_EXT           = ".php"
+	RUBY_EXT          = ".rb"
 	NODE_JS           = "nodejs"
 	PYTHON            = "python"
 	JAVA              = "java"
 	SWIFT             = "swift"
 	PHP               = "php"
+	RUBY              = "ruby"
 	DEFAULT           = "default"
 	BLACKBOX          = "blackbox"
 	SEQUENCE          = "sequence"
@@ -623,6 +625,8 @@ func getExec(args []string, params ActionFlags) (*whisk.Exec, error) {
 		exec.Kind = fmt.Sprintf("%s:%s", JAVA, DEFAULT)
 	} else if ext == PHP_EXT {
 		exec.Kind = fmt.Sprintf("%s:%s", PHP, DEFAULT)
+	} else if ext == RUBY_EXT {
+		exec.Kind = fmt.Sprintf("%s:%s", RUBY, DEFAULT)
 	} else {
 		if ext == ZIP_EXT {
 			return nil, zipKindError()
@@ -664,6 +668,8 @@ func getKindExtension(runtime string) (extension string) {
 		fallthrough
 	case PHP:
 		extension = fmt.Sprintf(".%s", runtime)
+	case RUBY:
+		extension = RUBY_EXT
 	}
 
 	return extension