iron_worker_ng 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
data/bin/iron_worker CHANGED
@@ -59,11 +59,7 @@ if command == 'codes.create'
59
59
 
60
60
  runtime = runtimes[0][:name] if runtime.nil?
61
61
 
62
- code = runtimes.find { |r| r[:name] == runtime }[:klass].new
63
-
64
- unless name.nil?
65
- code.name = name
66
- end
62
+ code = runtimes.find { |r| r[:name] == runtime }[:klass].new(:name => name)
67
63
 
68
64
  execute_features.each do |f|
69
65
  code.send(f[:name], *f[:args])
@@ -9,7 +9,11 @@ module IronWorkerNG
9
9
  def initialize(options = {})
10
10
  super('worker', options)
11
11
 
12
- load_from_hash(:scheme => 'https', :host => IronWorkerNG::APIClient::AWS_US_EAST_HOST, :port => 443, :api_version => 2, :user_agent => 'iron_worker_ruby_ng-' + IronWorkerNG.version + ' (iron_core_ruby-' + IronCore.version + ')')
12
+ load_from_hash(:scheme => 'https',
13
+ :host => IronWorkerNG::APIClient::AWS_US_EAST_HOST,
14
+ :port => 443,
15
+ :api_version => 2,
16
+ :user_agent => 'iron_worker_ruby_ng-' + IronWorkerNG.version + ' (iron_core_ruby-' + IronCore.version + ')')
13
17
 
14
18
  if (not @token) || (not @project_id)
15
19
  IronCore::Logger.error 'IronWorkerNG', 'Both token and project_id must be specified'
@@ -38,10 +38,8 @@ module IronWorkerNG
38
38
  @name = nil
39
39
  @features = []
40
40
 
41
- if args.length == 1 && args[0].class == String && File.exists?(args[0])
41
+ if args.length == 1 && args[0].class == String
42
42
  merge_exec(args[0])
43
- elsif args.length == 1 && args[0].class == String
44
- @name = args[0]
45
43
  elsif args.length == 1 && args[0].class == Hash
46
44
  @name = args[0][:name] || args[0]['name']
47
45
 
@@ -52,6 +50,10 @@ module IronWorkerNG
52
50
  if args.length == 1 && args[0].class == Hash && ((not args[0][:workerfile].nil?) || (not args[0]['workerfile'].nil?))
53
51
  eval(File.read(File.expand_path(args[0][:workerfile] || args[0]['workerfile'])))
54
52
  else
53
+ if (not @name.nil?) && File.exists?(@name + '.worker')
54
+ eval(File.read(@name + '.worker'))
55
+ end
56
+
55
57
  if File.exists?('Workerfile')
56
58
  eval(File.read('Workerfile'))
57
59
  end
@@ -9,6 +9,11 @@ module IronWorkerNG
9
9
  attr_reader :dest
10
10
 
11
11
  def initialize(path, dest)
12
+ unless Dir.exist?(path)
13
+ IronCore::Logger.error 'IronWorkerNG', "Can't find directory with path='#{path}'"
14
+ raise IronCore::IronError.new("Can't find directory with path='#{path}'")
15
+ end
16
+
12
17
  @path = File.expand_path(path)
13
18
  @dest = dest
14
19
  @dest = Pathname.new(dest).cleanpath.to_s + '/' unless @dest.empty?
@@ -9,6 +9,11 @@ module IronWorkerNG
9
9
  attr_reader :dest
10
10
 
11
11
  def initialize(path, dest)
12
+ unless File.exist?(path)
13
+ IronCore::Logger.error 'IronWorkerNG', "Can't find file with path='#{path}'"
14
+ raise IronCore::IronError.new("Can't find file with path='#{path}'")
15
+ end
16
+
12
17
  @path = File.expand_path(path)
13
18
  @dest = dest
14
19
  @dest = Pathname.new(dest).cleanpath.to_s + '/' unless @dest.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_worker_ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-27 00:00:00.000000000 Z
13
+ date: 2012-05-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: iron_core
@@ -138,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  segments:
140
140
  - 0
141
- hash: 422396125
141
+ hash: -520853037
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  none: false
144
144
  requirements: