iron_worker_ng 0.3.0 → 0.3.1

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.0
1
+ 0.3.1
@@ -22,8 +22,12 @@ module IronWorkerNG
22
22
  class Client
23
23
  attr_reader :api
24
24
 
25
- def initialize(options = {})
25
+ def initialize(options = {}, &block)
26
26
  @api = IronWorkerNG::APIClient.new(options)
27
+
28
+ unless block.nil?
29
+ instance_eval(&block)
30
+ end
27
31
  end
28
32
 
29
33
  def method_missing(name, *args, &block)
@@ -34,7 +34,7 @@ module IronWorkerNG
34
34
  include IronWorkerNG::Feature::Common::MergeFile::InstanceMethods
35
35
  include IronWorkerNG::Feature::Common::MergeDir::InstanceMethods
36
36
 
37
- def initialize(*args)
37
+ def initialize(*args, &block)
38
38
  @name = nil
39
39
  @features = []
40
40
 
@@ -48,6 +48,10 @@ module IronWorkerNG
48
48
  exec = args[0][:exec] || args[0]['exec'] || args[0][:worker] || args[0]['worker']
49
49
  merge_exec(exec) unless exec.nil?
50
50
  end
51
+
52
+ unless block.nil?
53
+ instance_eval(&block)
54
+ end
51
55
  end
52
56
 
53
57
  def fixate
@@ -40,7 +40,10 @@ module IronWorkerNG
40
40
  @features << @exec
41
41
  end
42
42
 
43
+ alias :exec :merge_exec
44
+
43
45
  alias :merge_worker :merge_exec
46
+ alias :worker :merge_worker
44
47
 
45
48
  def self.included(base)
46
49
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_exec', :for_klass => base, :args => 'PATH')
@@ -41,6 +41,8 @@ module IronWorkerNG
41
41
  @features << IronWorkerNG::Feature::Common::MergeDir::Feature.new(path, dest)
42
42
  end
43
43
 
44
+ alias :dir :merge_dir
45
+
44
46
  def self.included(base)
45
47
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_dir', :for_klass => base, :args => 'PATH[,DEST]')
46
48
  end
@@ -32,6 +32,8 @@ module IronWorkerNG
32
32
  @features << IronWorkerNG::Feature::Common::MergeFile::Feature.new(path, dest)
33
33
  end
34
34
 
35
+ alias :file :merge_file
36
+
35
37
  def self.included(base)
36
38
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_file', :for_klass => base, :args => 'PATH[,DEST]')
37
39
  end
@@ -50,7 +50,10 @@ module IronWorkerNG
50
50
  @features << @exec
51
51
  end
52
52
 
53
+ alias :exec :merge_exec
54
+
53
55
  alias :merge_worker :merge_exec
56
+ alias :worker :merge_worker
54
57
 
55
58
  def self.included(base)
56
59
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_exec', :for_klass => base, :args => 'PATH,CLASS')
@@ -31,6 +31,8 @@ module IronWorkerNG
31
31
  @features << IronWorkerNG::Feature::Java::MergeJar::Feature.new(path)
32
32
  end
33
33
 
34
+ alias :jar :merge_jar
35
+
34
36
  def self.included(base)
35
37
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_jar', :for_klass => base, :args => 'PATH')
36
38
  end
@@ -40,7 +40,10 @@ module IronWorkerNG
40
40
  @features << @exec
41
41
  end
42
42
 
43
+ alias :exec :merge_exec
44
+
43
45
  alias :merge_worker :merge_exec
46
+ alias :worker :merge_worker
44
47
 
45
48
  def self.included(base)
46
49
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_exec', :for_klass => base, :args => 'PATH')
@@ -46,7 +46,10 @@ module IronWorkerNG
46
46
  @features << @exec
47
47
  end
48
48
 
49
+ alias :exec :merge_exec
50
+
49
51
  alias :merge_worker :merge_exec
52
+ alias :worker :merge_worker
50
53
 
51
54
  def self.included(base)
52
55
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_exec', :for_klass => base, :args => 'PATH[,CLASS]')
@@ -70,6 +70,8 @@ module IronWorkerNG
70
70
  @merge_gem_reqs << Bundler::Dependency.new(name, version.split(', '))
71
71
  end
72
72
 
73
+ alias :gem :merge_gem
74
+
73
75
  def merge_gem_fixate
74
76
  IronWorkerNG::Logger.info 'Fixating gems dependencies'
75
77
 
@@ -34,6 +34,8 @@ module IronWorkerNG
34
34
  @features << IronWorkerNG::Feature::Ruby::MergeGemfile::Feature.new(path, groups)
35
35
  end
36
36
 
37
+ alias :gemfile :merge_gemfile
38
+
37
39
  def self.included(base)
38
40
  IronWorkerNG::Code::Base.register_feature(:name => 'merge_gemfile', :for_klass => base, :args => 'PATH[,GROUP...]')
39
41
  end
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.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  segments:
174
174
  - 0
175
- hash: -806070963
175
+ hash: 658273197
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements: