Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

added stack version to runtime, now you could set stack via "runtime 'ru... #174

Merged
merged 2 commits into from Dec 4, 2014
Jump to file or symbol
Failed to load files and symbols.
+15 −3
Split
View
@@ -43,7 +43,8 @@ supplementary data, and other dependencies with it. `.worker` files make it easy
```ruby
# define the runtime language, this can be ruby, java, node, php, go, etc.
-runtime "ruby"
+# also you could set version of language(check of available versions via iron_worker stacks)
+runtime "ruby","2.1"
# exec is the file that will be executed:
exec "hello_worker.rb"
```
@@ -437,7 +438,12 @@ iron_worker stacks
And to specify stack add following line in your .worker file
```ruby
-# define the runtime language, this can be ruby, java, node, php, go, etc.
+runtime 'ruby', '2.1'
+```
+Or
+
+```ruby
+exec 'java.sh'
runtime 'binary'
stack 'java-1.7'
exec 'java.sh'
@@ -179,7 +179,7 @@ def remote
@full_remote_build = true
end
- def runtime(runtime = nil)
+ def runtime(runtime = nil, version = nil)
return @runtime unless runtime
unless @runtime.nil?
@@ -189,6 +189,12 @@ def runtime(runtime = nil)
runtime_module = nil
runtime = runtime.to_s
+ if version
+ s = "#{runtime}-#{version}"
+ IronCore::Logger.info 'IronWorkerNG', "Trying to set stack to:#{s}'"
+ stack(s)
+ end
+
begin
runtime_module = IronWorkerNG::Code::Runtime.const_get(runtime.capitalize)
rescue