iron_worker_ng 0.3.9 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.9
1
+ 0.4.0
data/bin/iron_worker CHANGED
@@ -14,7 +14,7 @@ end
14
14
  command = $*[0]
15
15
  $*.shift
16
16
 
17
- client = IronWorkerNG::Client.new(:token => ENV['IRON_IO_TOKEN'], :project_id => ENV['IRON_IO_PROJECT_ID'])
17
+ client = IronWorkerNG::Client.new
18
18
 
19
19
  if command == 'codes.create'
20
20
  runtimes = IronWorkerNG::Code::Base.registered_types
@@ -72,7 +72,7 @@ if command == 'codes.create'
72
72
  client.codes.create(code)
73
73
  elsif command == 'tasks.create' || command == 'schedules.create'
74
74
  name = nil
75
- params = {}
75
+ payload = nil
76
76
 
77
77
  priority = nil
78
78
  timeout = nil
@@ -92,8 +92,8 @@ elsif command == 'tasks.create' || command == 'schedules.create'
92
92
  name = v
93
93
  end
94
94
 
95
- opts.on('-p', '--param NAME,VALUE', Array, 'parameters to pass') do |v|
96
- params[v[0]] = v[1]
95
+ opts.on('-p', '--payload PAYLOAD', String, 'payload to pass') do |v|
96
+ payload = v
97
97
  end
98
98
 
99
99
  opts.on('--priority PRIORITY', Integer, '0 (default), 1, 2') do |v|
@@ -159,9 +159,9 @@ elsif command == 'tasks.create' || command == 'schedules.create'
159
159
  id = nil
160
160
 
161
161
  if command == 'tasks.create'
162
- id = client.tasks.create(name, params, options).id
162
+ id = client.tasks.create(name, payload, options).id
163
163
  else
164
- id = client.schedules.create(name, params, options).id
164
+ id = client.schedules.create(name, payload, options).id
165
165
  end
166
166
 
167
167
  print id if print_id
@@ -1,151 +1,22 @@
1
- require 'rest-client'
2
- require 'rest'
3
- require 'json'
4
1
  require 'time'
5
2
 
6
- require_relative 'api_client_error'
3
+ require 'iron_core'
7
4
 
8
5
  module IronWorkerNG
9
- class APIClient
6
+ class APIClient < IronCore::Client
10
7
  AWS_US_EAST_HOST = 'worker-aws-us-east-1.iron.io'
11
8
 
12
- attr_accessor :token
13
- attr_accessor :project_id
14
- attr_accessor :scheme
15
- attr_accessor :host
16
- attr_accessor :port
17
- attr_accessor :api_version
18
- attr_accessor :user_agent
19
-
20
- attr_reader :options
21
-
22
9
  def initialize(options = {})
23
- load_from_hash(options)
24
- load_from_config(options[:config_file] || options['config_file'])
25
- load_from_config('iron.json')
26
- load_from_env('IRON_WORKER')
27
- load_from_env('IRON')
28
- load_from_config('~/.iron.json')
29
- load_from_hash(:scheme => 'https', :host => IronWorkerNG::APIClient::AWS_US_EAST_HOST, :port => 443, :api_version => 2, :user_agent => 'iron_worker_ng-' + IronWorkerNG.version)
30
-
31
- if (not @token) || (not @project_id)
32
- IronWorkerNG::Logger.error 'Both iron.io token and project_id must be specified'
33
- raise 'Both iron.io token and project_id must be specified'
34
- end
35
-
36
- @options = {
37
- :token => @token,
38
- :project_id => @project_id,
10
+ super('worker', options)
39
11
 
40
- :scheme => @scheme,
41
- :host => @host,
42
- :port => @port,
43
- :api_version => @api_version,
44
- :user_agent => @user_agent
45
- }
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 + ')')
46
13
 
47
- @rest = Rest::Client.new
48
- end
49
-
50
- def load_from_hash(hash)
51
- return if hash.nil?
52
-
53
- @token ||= hash[:token] || hash['token']
54
- @project_id ||= hash[:project_id] || hash['project_id']
55
-
56
- @scheme ||= hash[:scheme] || hash['scheme']
57
- @host ||= hash[:host] || hash['host']
58
- @port ||= hash[:port] || hash['port']
59
- @api_version ||= hash[:api_version] || hash['api_version']
60
- @user_agent ||= hash[:user_agent] || hash['user_agent']
61
- end
62
-
63
- def load_from_env(prefix)
64
- @token ||= ENV[prefix + '_TOKEN']
65
- @project_id ||= ENV[prefix + '_PROJECT_ID']
66
-
67
- @scheme ||= ENV[prefix + '_SCHEME']
68
- @host ||= ENV[prefix + '_HOST']
69
- @port ||= ENV[prefix + '_PORT']
70
- @api_version ||= ENV[prefix + '_API_VERSION']
71
- @user_agent ||= ENV[prefix + '_USER_AGENT']
72
- end
73
-
74
- def load_from_config(config_file)
75
- return if config_file.nil?
76
-
77
- if File.exists?(File.expand_path(config_file))
78
- config = JSON.load(File.read(File.expand_path(config_file)))
79
-
80
- load_from_hash(config['iron_worker'])
81
- load_from_hash(config['iron'])
82
- load_from_hash(config)
14
+ if (not @token) || (not @project_id)
15
+ IronCore::Logger.error 'IronWorkerNG', 'Both token and project_id must be specified'
16
+ raise IronCore::IronError.new('Both token and project_id must be specified')
83
17
  end
84
18
  end
85
19
 
86
- def common_request_hash
87
- {
88
- 'Content-Type' => 'application/json',
89
- 'Authorization' => "OAuth #{@token}",
90
- 'User-Agent' => @user_agent
91
- }
92
- end
93
-
94
- def url
95
- "#{scheme}://#{host}:#{port}/#{api_version}/"
96
- end
97
-
98
- def get(method, params = {})
99
- request_hash = {}
100
- request_hash[:headers] = common_request_hash
101
- request_hash[:params] = params
102
-
103
- IronWorkerNG::Logger.debug "GET #{url + method} with params='#{request_hash.to_s}'"
104
-
105
- @rest.get(url + method, request_hash)
106
- end
107
-
108
- def post(method, params = {})
109
- request_hash = {}
110
- request_hash[:headers] = common_request_hash
111
- request_hash[:body] = params.to_json
112
-
113
- IronWorkerNG::Logger.debug "POST #{url + method} with params='#{request_hash.to_s}'"
114
-
115
- @rest.post(url + method, request_hash)
116
- end
117
-
118
- def delete(method, params = {})
119
- request_hash = {}
120
- request_hash[:headers] = common_request_hash
121
- request_hash[:params] = params
122
-
123
- IronWorkerNG::Logger.debug "DELETE #{url + method} with params='#{request_hash.to_s}'"
124
-
125
- @rest.delete(url + method, request_hash)
126
- end
127
-
128
- # FIXME: retries support
129
- # FIXME: user agent support
130
- def post_file(method, file, params = {})
131
- request_hash = {}
132
- request_hash[:data] = params.to_json
133
- request_hash[:file] = file
134
-
135
- IronWorkerNG::Logger.debug "POST #{url + method + "?oauth=" + @token} with params='#{request_hash.to_s}'"
136
-
137
- RestClient.post(url + method + "?oauth=#{@token}", request_hash)
138
- end
139
-
140
- def parse_response(response, parse_json = true)
141
- IronWorkerNG::Logger.debug "GOT #{response.code} with params='#{response.body}'"
142
-
143
- raise IronWorkerNG::APIClientError.new(response.body) if response.code != 200
144
-
145
- return response.body unless parse_json
146
- JSON.parse(response.body)
147
- end
148
-
149
20
  def codes_list(options = {})
150
21
  parse_response(get("projects/#{@project_id}/codes", options))
151
22
  end
@@ -1,4 +1,5 @@
1
1
  require 'ostruct'
2
+ require 'json'
2
3
 
3
4
  require_relative 'api_client'
4
5
 
@@ -84,15 +84,15 @@ module IronWorkerNG
84
84
 
85
85
  def create_zip
86
86
  unless @exec
87
- IronWorkerNG::Logger.error 'No exec specified'
88
- raise 'No exec specified'
87
+ IronCore::Logger.error 'IronWorkerNG', 'No exec specified'
88
+ raise IronCore::IronError.new('No exec specified')
89
89
  end
90
90
 
91
91
  fixate
92
92
 
93
93
  zip_name = Dir.tmpdir + '/' + Dir::Tmpname.make_tmpname("iron-worker-ng-", "code.zip")
94
94
 
95
- IronWorkerNG::Logger.debug "Creating code zip '#{zip_name}'"
95
+ IronCore::Logger.debug 'IronWorkerNG', "Creating code zip '#{zip_name}'"
96
96
 
97
97
  Zip::ZipFile.open(zip_name, Zip::ZipFile::CREATE) do |zip|
98
98
  bundle(zip)
@@ -18,7 +18,7 @@ module IronWorkerNG
18
18
 
19
19
  classpath = classpath_array.join(':')
20
20
 
21
- IronWorkerNG::Logger.info "Collected '#{classpath}' classpath"
21
+ IronCore::Logger.info 'IronWorkerNG', "Collected '#{classpath}' classpath"
22
22
 
23
23
  zip.get_output_stream(runner) do |runner|
24
24
  runner.write <<RUNNER
@@ -14,7 +14,7 @@ module IronWorkerNG
14
14
  end
15
15
 
16
16
  def bundle(zip)
17
- IronWorkerNG::Logger.debug "Bundling binary exec with path='#{@path}'"
17
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling binary exec with path='#{@path}'"
18
18
 
19
19
  zip.add(File.basename(@path), @path)
20
20
  end
@@ -25,7 +25,7 @@ module IronWorkerNG
25
25
  @exec ||= nil
26
26
 
27
27
  unless @exec.nil?
28
- IronWorkerNG::Logger.warn "Ignoring attempt to merge binary exec with path='#{path}'"
28
+ IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge binary exec with path='#{path}'"
29
29
  return
30
30
  end
31
31
 
@@ -33,7 +33,7 @@ module IronWorkerNG
33
33
 
34
34
  @exec = IronWorkerNG::Feature::Binary::MergeExec::Feature.new(path)
35
35
 
36
- IronWorkerNG::Logger.info "Merging binary exec with path='#{path}'"
36
+ IronCore::Logger.info 'IronWorkerNG', "Merging binary exec with path='#{path}'"
37
37
 
38
38
  @features << @exec
39
39
  end
@@ -9,7 +9,6 @@ module IronWorkerNG
9
9
  attr_reader :dest
10
10
 
11
11
  def initialize(path, dest)
12
- raise 'No such directory - ' + path unless Dir.exist? path
13
12
  @path = File.expand_path(path)
14
13
  @dest = dest
15
14
  @dest = Pathname.new(dest).cleanpath.to_s + '/' unless @dest.empty?
@@ -26,7 +25,7 @@ module IronWorkerNG
26
25
  end
27
26
 
28
27
  def bundle(zip)
29
- IronWorkerNG::Logger.debug "Bundling dir with path='#{@path}' and dest='#{@dest}'"
28
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling dir with path='#{@path}' and dest='#{@dest}'"
30
29
 
31
30
  Dir.glob(@path + '/**/**') do |path|
32
31
  zip.add(@dest + File.basename(@path) + path[@path.length .. -1], path)
@@ -36,7 +35,7 @@ module IronWorkerNG
36
35
 
37
36
  module InstanceMethods
38
37
  def merge_dir(path, dest = '')
39
- IronWorkerNG::Logger.info "Merging dir with path='#{path}' and dest='#{dest}'"
38
+ IronCore::Logger.info 'IronWorkerNG', "Merging dir with path='#{path}' and dest='#{dest}'"
40
39
 
41
40
  @features << IronWorkerNG::Feature::Common::MergeDir::Feature.new(path, dest)
42
41
  end
@@ -19,7 +19,7 @@ module IronWorkerNG
19
19
  end
20
20
 
21
21
  def bundle(zip)
22
- IronWorkerNG::Logger.debug "Bundling file with path='#{@path}' and dest='#{@dest}'"
22
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling file with path='#{@path}' and dest='#{@dest}'"
23
23
 
24
24
  zip.add(@dest + File.basename(@path), @path)
25
25
  end
@@ -27,7 +27,7 @@ module IronWorkerNG
27
27
 
28
28
  module InstanceMethods
29
29
  def merge_file(path, dest = '')
30
- IronWorkerNG::Logger.info "Merging file with path='#{path}' and dest='#{dest}'"
30
+ IronCore::Logger.info 'IronWorkerNG', "Merging file with path='#{path}' and dest='#{dest}'"
31
31
 
32
32
  @features << IronWorkerNG::Feature::Common::MergeFile::Feature.new(path, dest)
33
33
  end
@@ -16,7 +16,7 @@ module IronWorkerNG
16
16
  end
17
17
 
18
18
  def bundle(zip)
19
- IronWorkerNG::Logger.debug "Bundling java exec with path='#{@path}' and class='#{@klass}'"
19
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling java exec with path='#{@path}' and class='#{@klass}'"
20
20
 
21
21
  zip.add(File.basename(@path), @path)
22
22
  end
@@ -31,7 +31,7 @@ module IronWorkerNG
31
31
  @exec ||= nil
32
32
 
33
33
  unless @exec.nil?
34
- IronWorkerNG::Logger.warn "Ignoring attempt to merge java exec with path='#{path}' and class='#{klass}'"
34
+ IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge java exec with path='#{path}' and class='#{klass}'"
35
35
  return
36
36
  end
37
37
 
@@ -43,7 +43,7 @@ module IronWorkerNG
43
43
 
44
44
  @exec = IronWorkerNG::Feature::Java::MergeExec::Feature.new(path, klass)
45
45
 
46
- IronWorkerNG::Logger.info "Merging java exec with path='#{path}' and class='#{klass}'"
46
+ IronCore::Logger.info 'IronWorkerNG', "Merging java exec with path='#{path}' and class='#{klass}'"
47
47
 
48
48
  @features << @exec
49
49
  end
@@ -14,7 +14,7 @@ module IronWorkerNG
14
14
  end
15
15
 
16
16
  def bundle(zip)
17
- IronWorkerNG::Logger.debug "Bundling java jar with path='#{@path}'"
17
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling java jar with path='#{@path}'"
18
18
 
19
19
  zip.add(File.basename(@path), @path)
20
20
  end
@@ -26,7 +26,7 @@ module IronWorkerNG
26
26
 
27
27
  module InstanceMethods
28
28
  def merge_jar(path)
29
- IronWorkerNG::Logger.info "Merging java jar with path='#{path}'"
29
+ IronCore::Logger.info 'IronWorkerNG', "Merging java jar with path='#{path}'"
30
30
 
31
31
  @features << IronWorkerNG::Feature::Java::MergeJar::Feature.new(path)
32
32
  end
@@ -14,7 +14,7 @@ module IronWorkerNG
14
14
  end
15
15
 
16
16
  def bundle(zip)
17
- IronWorkerNG::Logger.debug "Bundling node exec with path='#{@path}'"
17
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling node exec with path='#{@path}'"
18
18
 
19
19
  zip.add(File.basename(@path), @path)
20
20
  end
@@ -25,7 +25,7 @@ module IronWorkerNG
25
25
  @exec ||= nil
26
26
 
27
27
  unless @exec.nil?
28
- IronWorkerNG::Logger.warn "Ignoring attempt to merge node exec with path='#{path}'"
28
+ IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge node exec with path='#{path}'"
29
29
  return
30
30
  end
31
31
 
@@ -33,7 +33,7 @@ module IronWorkerNG
33
33
 
34
34
  @exec = IronWorkerNG::Feature::Node::MergeExec::Feature.new(path)
35
35
 
36
- IronWorkerNG::Logger.info "Merging node exec with path='#{path}'"
36
+ IronCore::Logger.info 'IronWorkerNG', "Merging node exec with path='#{path}'"
37
37
 
38
38
  @features << @exec
39
39
  end
@@ -16,7 +16,7 @@ module IronWorkerNG
16
16
  end
17
17
 
18
18
  def bundle(zip)
19
- IronWorkerNG::Logger.debug "Bundling ruby exec with path='#{path}' and class='#{klass}'"
19
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling ruby exec with path='#{path}' and class='#{klass}'"
20
20
 
21
21
  zip.add(File.basename(@path), @path)
22
22
  end
@@ -31,7 +31,7 @@ module IronWorkerNG
31
31
  end
32
32
 
33
33
  unless @exec.nil?
34
- IronWorkerNG::Logger.warn "Ignoring attempt to merge ruby exec with path='#{path}' and class='#{klass}'"
34
+ IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge ruby exec with path='#{path}' and class='#{klass}'"
35
35
  return
36
36
  end
37
37
 
@@ -39,7 +39,7 @@ module IronWorkerNG
39
39
 
40
40
  @exec = IronWorkerNG::Feature::Ruby::MergeExec::Feature.new(path, klass)
41
41
 
42
- IronWorkerNG::Logger.info "Merging ruby exec with path='#{path}' and class='#{klass}'"
42
+ IronCore::Logger.info 'IronWorkerNG', "Merging ruby exec with path='#{path}' and class='#{klass}'"
43
43
 
44
44
  @features << @exec
45
45
  end
@@ -40,14 +40,14 @@ module IronWorkerNG
40
40
 
41
41
  def bundle(zip)
42
42
  if @spec.extensions.length == 0 || IronWorkerNG::Feature::Ruby::MergeGem.merge_binary?
43
- IronWorkerNG::Logger.debug "Bundling ruby gem with name='#{@spec.name}' and version='#{@spec.version}'"
43
+ IronCore::Logger.debug 'IronWorkerNG', "Bundling ruby gem with name='#{@spec.name}' and version='#{@spec.version}'"
44
44
 
45
45
  zip.add('__gems__/' + @spec.full_name, gem_path)
46
46
  Dir.glob(gem_path + '/**/**') do |path|
47
47
  zip.add('__gems__/' + @spec.full_name + path[gem_path.length .. -1], path)
48
48
  end
49
49
  else
50
- IronWorkerNG::Logger.warn "Skipping ruby gem with name='#{@spec.name}' and version='#{@spec.version}' as it contains native extensions"
50
+ IronCore::Logger.warn 'IronWorkerNG', "Skipping ruby gem with name='#{@spec.name}' and version='#{@spec.version}' as it contains native extensions"
51
51
  end
52
52
  end
53
53
 
@@ -64,7 +64,7 @@ module IronWorkerNG
64
64
  attr_reader :merge_gem_reqs
65
65
 
66
66
  def merge_gem(name, version = '>= 0')
67
- IronWorkerNG::Logger.info "Adding ruby gem dependency with name='#{name}' and version='#{version}'"
67
+ IronCore::Logger.info 'IronWorkerNG', "Adding ruby gem dependency with name='#{name}' and version='#{version}'"
68
68
 
69
69
  @merge_gem_reqs ||= []
70
70
  @merge_gem_reqs << Bundler::Dependency.new(name, version.split(', '))
@@ -73,7 +73,7 @@ module IronWorkerNG
73
73
  alias :gem :merge_gem
74
74
 
75
75
  def merge_gem_fixate
76
- IronWorkerNG::Logger.info 'Fixating gems dependencies'
76
+ IronCore::Logger.info 'IronWorkerNG', 'Fixating gems dependencies'
77
77
 
78
78
  @merge_gem_reqs ||= []
79
79
 
@@ -99,7 +99,7 @@ module IronWorkerNG
99
99
  spec_set.to_a.each do |spec|
100
100
  spec.__materialize__
101
101
 
102
- IronWorkerNG::Logger.info "Merging ruby gem with name='#{spec.name}' and version='#{spec.version}'"
102
+ IronCore::Logger.info 'IronWorkerNG', "Merging ruby gem with name='#{spec.name}' and version='#{spec.version}'"
103
103
 
104
104
  @features << IronWorkerNG::Feature::Ruby::MergeGem::Feature.new(spec)
105
105
  end
@@ -23,7 +23,7 @@ module IronWorkerNG
23
23
  groups = groups.map { |g| g.to_sym }
24
24
  groups << :default if groups.length == 0
25
25
 
26
- IronWorkerNG::Logger.info "Adding ruby gems dependencies from #{groups.join(', ')} group#{groups.length > 1 ? 's' : ''} of #{path}"
26
+ IronCore::Logger.info 'IronWorkerNG', "Adding ruby gems dependencies from #{groups.join(', ')} group#{groups.length > 1 ? 's' : ''} of #{path}"
27
27
 
28
28
  specs = Bundler::Definition.build(path, path + '.lock', nil).specs_for(groups)
29
29
 
@@ -1,5 +1,4 @@
1
1
  require_relative 'iron_worker_ng/version'
2
- require_relative 'iron_worker_ng/logger'
3
2
  require_relative 'iron_worker_ng/client'
4
3
  require_relative 'iron_worker_ng/code/base'
5
4
  require_relative 'iron_worker_ng/code/ruby'
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.3.9
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,10 +10,10 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-24 00:00:00.000000000 Z
13
+ date: 2012-04-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: zip
16
+ name: iron_core
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
@@ -29,23 +29,7 @@ dependencies:
29
29
  - !ruby/object:Gem::Version
30
30
  version: '0'
31
31
  - !ruby/object:Gem::Dependency
32
- name: rest-client
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: '0'
39
- type: :runtime
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: rest
32
+ name: zip
49
33
  requirement: !ruby/object:Gem::Requirement
50
34
  none: false
51
35
  requirements:
@@ -123,7 +107,6 @@ files:
123
107
  - bin/iron_worker
124
108
  - lib/iron_worker_ng.rb
125
109
  - lib/iron_worker_ng/api_client.rb
126
- - lib/iron_worker_ng/api_client_error.rb
127
110
  - lib/iron_worker_ng/client.rb
128
111
  - lib/iron_worker_ng/code/base.rb
129
112
  - lib/iron_worker_ng/code/binary.rb
@@ -140,7 +123,6 @@ files:
140
123
  - lib/iron_worker_ng/feature/ruby/merge_exec.rb
141
124
  - lib/iron_worker_ng/feature/ruby/merge_gem.rb
142
125
  - lib/iron_worker_ng/feature/ruby/merge_gemfile.rb
143
- - lib/iron_worker_ng/logger.rb
144
126
  - lib/iron_worker_ng/version.rb
145
127
  homepage: https://github.com/iron-io/iron_worker_ruby_ng
146
128
  licenses: []
@@ -156,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
138
  version: '0'
157
139
  segments:
158
140
  - 0
159
- hash: -543812495
141
+ hash: 422396125
160
142
  required_rubygems_version: !ruby/object:Gem::Requirement
161
143
  none: false
162
144
  requirements:
@@ -1,4 +0,0 @@
1
- module IronWorkerNG
2
- class APIClientError < Exception
3
- end
4
- end
@@ -1,38 +0,0 @@
1
- require 'logger'
2
-
3
- module IronWorkerNG
4
- module Logger
5
- def self.logger
6
- unless @logger
7
- @logger = ::Logger.new(STDOUT)
8
- @logger.level = ::Logger::INFO
9
- end
10
-
11
- @logger
12
- end
13
-
14
- def self.logger=(logger)
15
- @logger = logger
16
- end
17
-
18
- def self.fatal(msg)
19
- self.logger.fatal("IronWorkerNG") { msg }
20
- end
21
-
22
- def self.error(msg)
23
- self.logger.error("IronWorkerNG") { msg }
24
- end
25
-
26
- def self.warn(msg)
27
- self.logger.warn("IronWorkerNG") { msg }
28
- end
29
-
30
- def self.info(msg)
31
- self.logger.info("IronWorkerNG") { msg }
32
- end
33
-
34
- def self.debug(msg)
35
- self.logger.debug("IronWorkerNG") { msg }
36
- end
37
- end
38
- end