ya_queen 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da0f3c18c135fa7c37a23c757a1d91ea35811dc5
4
- data.tar.gz: 413c03e7f41c53f4d26355aefaa44c22da587cbb
3
+ metadata.gz: 5c3212e3ec85019a29c8bc8e13ce742f47af7e1b
4
+ data.tar.gz: 3c62fb7a83eff7832b5e88c8fd56123bfdb574d4
5
5
  SHA512:
6
- metadata.gz: 3a18eff162e5f202a424d324497c483c2c6a58da7830ce69bee7c45ab34df7ce2170ba1e5e13a83fda9fc01a74633ed7fbe828db29b9584bebc75a8171138c43
7
- data.tar.gz: d40333158e6f91ca99af27981356ff9c01a7c2cdb14702784797a8746dbea3b103ac38bd86607493beebb712f5555f24e7f42c8d2082e8405e4a27905617f924
6
+ metadata.gz: 067df1d738b3a2aa1c959e374d1fec5544932badab420485a3471e97b3e31724be707493179cdd8ae8da8c69eca6aa0e88dd456bc9a8f2c96b3c546a46c658dc
7
+ data.tar.gz: 35a6ae2e4d80cdc9fa6f8ac1bbd1558781b4576e15b3e937bb1b9cc4c57619761ad625f8b7b08876351f5d1d6ea760603577207ee65b3316ee061859315b8fcd
data/lib/ya_queen/base.rb CHANGED
@@ -5,6 +5,7 @@ module YaQueen
5
5
  class Base
6
6
  attr_reader :context, :name, :config, :root, :servers
7
7
  def initialize(context, name, configs)
8
+ raise ArgumentError, "name must be given" if name.nil? || name.empty? || (name =~ /\A\@\s*\Z/)
8
9
  @context = context
9
10
  @name = name
10
11
  @root = configs
@@ -29,15 +30,17 @@ module YaQueen
29
30
 
30
31
  def define_tasks
31
32
  return if servers.nil? or servers.empty?
32
-
33
33
  define_role_task
34
+ define_each_tasks
35
+ define_common_task
36
+ end
34
37
 
38
+ def define_each_tasks
35
39
  servers.each do |host, options|
36
40
  after :"@#{name}", :"@#{name}/#{host}"
37
41
  define_each_task(host, options)
38
42
  after :"@#{name}/#{host}", :"@#{name}/common"
39
43
  end
40
- define_common_task
41
44
  end
42
45
 
43
46
  def role_task(&block) ; @role_task = block; end
@@ -57,7 +60,7 @@ module YaQueen
57
60
  t = self
58
61
  task(:"@#{name}/common") do
59
62
  t.implement_common_task
60
- t.set_deploy_target("@#{name}")
63
+ t.set_deploy_target("@#{t.name}")
61
64
  end
62
65
  end
63
66
 
@@ -76,7 +79,7 @@ module YaQueen
76
79
  when tgt
77
80
  # OK, do nothing
78
81
  else
79
- raise "already selected deploy target: #{selected}"
82
+ raise "#{tgt} given but already selected deploy target: #{selected}"
80
83
  end
81
84
  end
82
85
  end
@@ -1,3 +1,3 @@
1
1
  module YaQueen
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ya_queen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - akima