Skip to content

Commit 89ac2b9

Browse files
remorerabbah
authored andcommitted
add recogniztion for ruby (.rb) files (#352)
1 parent 993a75a commit 89ac2b9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

commands/action.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ const (
5353
SWIFT_EXT = ".swift"
5454
ZIP_EXT = ".zip"
5555
PHP_EXT = ".php"
56+
RUBY_EXT = ".rb"
5657
NODE_JS = "nodejs"
5758
PYTHON = "python"
5859
JAVA = "java"
5960
SWIFT = "swift"
6061
PHP = "php"
62+
RUBY = "ruby"
6163
DEFAULT = "default"
6264
BLACKBOX = "blackbox"
6365
SEQUENCE = "sequence"
@@ -623,6 +625,8 @@ func getExec(args []string, params ActionFlags) (*whisk.Exec, error) {
623625
exec.Kind = fmt.Sprintf("%s:%s", JAVA, DEFAULT)
624626
} else if ext == PHP_EXT {
625627
exec.Kind = fmt.Sprintf("%s:%s", PHP, DEFAULT)
628+
} else if ext == RUBY_EXT {
629+
exec.Kind = fmt.Sprintf("%s:%s", RUBY, DEFAULT)
626630
} else {
627631
if ext == ZIP_EXT {
628632
return nil, zipKindError()
@@ -664,6 +668,8 @@ func getKindExtension(runtime string) (extension string) {
664668
fallthrough
665669
case PHP:
666670
extension = fmt.Sprintf(".%s", runtime)
671+
case RUBY:
672+
extension = RUBY_EXT
667673
}
668674

669675
return extension

0 commit comments

Comments
 (0)