Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -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"
```
Expand Down Expand Up @@ -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'
Expand Down
8 changes: 7 additions & 1 deletion lib/iron_worker_ng/code/base.rb
Expand Up @@ -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?
Expand All @@ -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
Expand Down