Permalink
Browse files

added stack version to runtime, now you could set stack via "runtime …

…'ruby', '2.1'"
  • Loading branch information...
1 parent fa9c218 commit 855e5e609f8a8c9a09359c4551c6c3afc1f0ba87 @rkononov rkononov committed Mar 13, 2014
Showing with 17 additions and 5 deletions.
  1. +1 −1 Gemfile.lock
  2. +8 −2 README.md
  3. +7 −1 lib/iron_worker_ng/code/base.rb
  4. +1 −1 lib/iron_worker_ng/version.rb
View
2 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- iron_worker_ng (1.3.1)
+ iron_worker_ng (1.4.2)
bundler
iron_core (>= 1.0.0)
rubyzip (= 0.9.9)
View
10 README.md
@@ -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"
```
@@ -429,7 +430,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'
View
8 lib/iron_worker_ng/code/base.rb
@@ -176,7 +176,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?
@@ -186,6 +186,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
View
2 lib/iron_worker_ng/version.rb
@@ -1,5 +1,5 @@
module IronWorkerNG
- VERSION = '1.4.1'
+ VERSION = '1.4.2'
def self.version
VERSION

0 comments on commit 855e5e6

Please sign in to comment.