Skip to content
Browse files

Another workerfile name scheme and version bump.

  • Loading branch information...
1 parent 521cb78 commit 315a275445746d3bc27dd43fb6fc8ba4770d3db2 Andrew Kirilenko committed May 1, 2012
View
2 VERSION
@@ -1 +1 @@
-0.4.0
+0.4.1
View
6 bin/iron_worker
@@ -59,11 +59,7 @@ if command == 'codes.create'
runtime = runtimes[0][:name] if runtime.nil?
- code = runtimes.find { |r| r[:name] == runtime }[:klass].new
-
- unless name.nil?
- code.name = name
- end
+ code = runtimes.find { |r| r[:name] == runtime }[:klass].new(:name => name)
execute_features.each do |f|
code.send(f[:name], *f[:args])
View
8 lib/iron_worker_ng/code/base.rb
@@ -38,10 +38,8 @@ def initialize(*args, &block)
@name = nil
@features = []
- if args.length == 1 && args[0].class == String && File.exists?(args[0])
+ if args.length == 1 && args[0].class == String
merge_exec(args[0])
- elsif args.length == 1 && args[0].class == String
- @name = args[0]
elsif args.length == 1 && args[0].class == Hash
@name = args[0][:name] || args[0]['name']
@@ -52,6 +50,10 @@ def initialize(*args, &block)
if args.length == 1 && args[0].class == Hash && ((not args[0][:workerfile].nil?) || (not args[0]['workerfile'].nil?))
eval(File.read(File.expand_path(args[0][:workerfile] || args[0]['workerfile'])))
else
+ if (not @name.nil?) && File.exists?(@name + '.worker')
+ eval(File.read(@name + '.worker'))
+ end
+
if File.exists?('Workerfile')
eval(File.read('Workerfile'))
end
View
6 lib/iron_worker_ng/feature/common/merge_dir.rb
@@ -9,7 +9,11 @@ class Feature < IronWorkerNG::Feature::Base
attr_reader :dest
def initialize(path, dest)
- raise 'No such directory - ' + path unless Dir.exist? path
+ unless Dir.exist?(path)
+ IronCore::Logger.error 'IronWorkerNG', "Can't find directory with path='#{path}'"
+ raise IronCore::IronError.new("Can't find directory with path='#{path}'")
+ end
+
@path = File.expand_path(path)
@dest = dest
@dest = Pathname.new(dest).cleanpath.to_s + '/' unless @dest.empty?
View
6 lib/iron_worker_ng/feature/common/merge_file.rb
@@ -9,7 +9,11 @@ class Feature < IronWorkerNG::Feature::Base
attr_reader :dest
def initialize(path, dest)
- raise 'No such file - ' + path unless File.exist? path
+ unless File.exist?(path)
+ IronCore::Logger.error 'IronWorkerNG', "Can't find file with path='#{path}'"
+ raise IronCore::IronError.new("Can't find file with path='#{path}'")
+ end
+
@path = File.expand_path(path)
@dest = dest
@dest = Pathname.new(dest).cleanpath.to_s + '/' unless @dest.empty?

0 comments on commit 315a275

Please sign in to comment.
Something went wrong with that request. Please try again.