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 +4 -4
- data/lib/ya_queen/base.rb +7 -4
- data/lib/ya_queen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c3212e3ec85019a29c8bc8e13ce742f47af7e1b
|
4
|
+
data.tar.gz: 3c62fb7a83eff7832b5e88c8fd56123bfdb574d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/ya_queen/version.rb
CHANGED