Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Blocks support for Code/Client.

  • Loading branch information...
commit 1cf101b85300cd544ee6196cc90927cab10e280c 1 parent cd61f79
Andrew Kirilenko iced authored
Showing with 10 additions and 2 deletions.
  1. +5 −1 lib/iron_worker_ng/client.rb
  2. +5 −1 lib/iron_worker_ng/code/base.rb
6 lib/iron_worker_ng/client.rb
View
@@ -22,8 +22,12 @@ def method_missing(name, *args, &block)
class Client
attr_reader :api
- def initialize(options = {})
+ def initialize(options = {}, &block)
@api = IronWorkerNG::APIClient.new(options)
+
+ unless block.nil?
+ instance_eval(&block)
+ end
end
def method_missing(name, *args, &block)
6 lib/iron_worker_ng/code/base.rb
View
@@ -34,7 +34,7 @@ def self.register_feature(feature)
include IronWorkerNG::Feature::Common::MergeFile::InstanceMethods
include IronWorkerNG::Feature::Common::MergeDir::InstanceMethods
- def initialize(*args)
+ def initialize(*args, &block)
@name = nil
@features = []
@@ -48,6 +48,10 @@ def initialize(*args)
exec = args[0][:exec] || args[0]['exec'] || args[0][:worker] || args[0]['worker']
merge_exec(exec) unless exec.nil?
end
+
+ unless block.nil?
+ instance_eval(&block)
+ end
end
def fixate
Please sign in to comment.
Something went wrong with that request. Please try again.