itamae-mitsurin 0.44 → 0.45

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: d7be84b6642248f24fe6389fa727bad605dcd241
4
- data.tar.gz: 1b05b9e8c54d61ff0bb2c04a189f50f2c9153184
3
+ metadata.gz: ec2c9668277bd1b04553438f10d215cc0c996c21
4
+ data.tar.gz: 47bdc2fd6ad9ac8218a9ce7607303ae587d95299
5
5
  SHA512:
6
- metadata.gz: 8111c423991c63de87f50a0055523edd439f7146ebe13ae4f6108ff80b30324adcb89117638c69cb122dd79f1c93c62c0a67b5876114e569b3f1f9443e9f944b
7
- data.tar.gz: 836311b6c7cb3b3e6c81565412e3d51cc23112f04cd9d40544b04a502752559f9083c4d17eb9dadeb3a0ed97b8f1ffcaa697d04bba1c8e8621adbe6e1fa4fa87
6
+ metadata.gz: 76665bda355bf49f0fa5e6e3b43477ddfa7661a6b2313a9b0af7e363db16ab71d00d12104927cabd00af419348c94a047345acc230d114fa8815d345b5fb2dcb
7
+ data.tar.gz: 45687ee91f3f4b576e132cc28536cf9dee92b115197157ea3c60bbda8ad636c0cc8b108ed484c98b4a6972400eba1854fa53d4de754a5d2dd440c239004ea878
@@ -107,23 +107,27 @@ module ItamaeMitsurin
107
107
  command << " -l debug" if ENV['debug'] == "true"
108
108
  command << " -c logs/config/itamae_task.config"
109
109
 
110
- # recipes load to_command
110
+ # Pass to read the recipe command
111
111
  command_recipe = []
112
112
  recipes.each do |recipe_h|
113
113
  target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h[recipe_h.keys.join]}.rb"
114
+ if Dir.glob(target_recipe).empty?
115
+ raise "Recipe load error, nodefile: #{node_file}, reason: Does not exist " +
116
+ recipe_h.keys.join + '::' +recipe_h.values.join
117
+ end
114
118
  Dir.glob(target_recipe).join("\s").split.each do |target|
115
119
  unless File.exists?(target)
116
120
  ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
117
- raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
121
+ raise "Recipe load error, nodefile:#{node_file}, reason: Does not exist #{ex_recipe}"
118
122
  end
119
123
  command_recipe << " #{target}"
120
124
  end
121
125
  end
122
126
 
123
- command_recipe.sort_by! {|item| File.dirname(item)}
127
+ command_recipe.sort_by! {|item| File.dirname(item) }
124
128
  command << command_recipe.join
125
129
 
126
- puts TaskBase.hl.color(%!Run Itamae to \"#{bname}\"!, :red)
130
+ puts TaskBase.hl.color(%!Run Itamae to "#{bname}"!, :red)
127
131
  run_list_noti = []
128
132
  command_recipe.each { |c_recipe|
129
133
  unless c_recipe.split("/")[4].split(".")[0] == 'default'
@@ -116,23 +116,27 @@ module ItamaeMitsurin
116
116
  command << " -l debug" if ENV['debug'] == "true"
117
117
  command << " -c logs/config/itamae_with_git_task.config"
118
118
 
119
- # recipe load to_command
119
+ # Pass to read the recipe command
120
120
  command_recipe = []
121
121
  recipes.each do |recipe_h|
122
122
  target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h[recipe_h.keys.join]}.rb"
123
+ if Dir.glob(target_recipe).empty?
124
+ raise "Recipe load error, nodefile: #{node_file}, reason: Does not exist " +
125
+ recipe_h.keys.join + '::' +recipe_h.values.join
126
+ end
123
127
  Dir.glob(target_recipe).join("\s").split.each do |target|
124
128
  unless File.exists?(target)
125
129
  ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
126
- raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
130
+ raise "Recipe load error, nodefile:#{node_file}, reason: Does not exist #{ex_recipe}"
127
131
  end
128
132
  command_recipe << " #{target}"
129
133
  end
130
134
  end
131
135
 
132
- command_recipe.sort_by! {|item| File.dirname(item)}
136
+ command_recipe.sort_by! {|item| File.dirname(item) }
133
137
  command << command_recipe.join
134
138
 
135
- puts TaskBase.hl.color(%!Run Itamae to \"#{bname}\"!, :red)
139
+ puts TaskBase.hl.color(%!Run Itamae to "#{bname}"!, :red)
136
140
  run_list_noti = []
137
141
  command_recipe.each { |c_recipe|
138
142
  unless c_recipe.split("/")[4].split(".")[0] == 'default'
@@ -134,23 +134,27 @@ module ItamaeMitsurin
134
134
  command << " -l debug" if ENV['debug'] == "true"
135
135
  command << " -c logs/config/itamae_with_target_task.config"
136
136
 
137
- # recipe load to_command
137
+ # Pass to read the recipe command
138
138
  command_recipe = []
139
139
  recipes.each do |recipe_h|
140
140
  target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h[recipe_h.keys.join]}.rb"
141
+ if Dir.glob(target_recipe).empty?
142
+ raise "Recipe load error, nodefile: #{node_file}, reason: Does not exist " +
143
+ recipe_h.keys.join + '::' +recipe_h.values.join
144
+ end
141
145
  Dir.glob(target_recipe).join("\s").split.each do |target|
142
146
  unless File.exists?(target)
143
147
  ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
144
- raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
148
+ raise "Recipe load error, nodefile:#{node_file}, reason: Does not exist #{ex_recipe}"
145
149
  end
146
150
  command_recipe << " #{target}"
147
151
  end
148
152
  end
149
153
 
150
- command_recipe.sort_by! {|item| File.dirname(item)}
154
+ command_recipe.sort_by! {|item| File.dirname(item) }
151
155
  command << command_recipe.join
152
156
 
153
- puts TaskBase.hl.color(%!Run Itamae to \"#{bname}\"!, :red)
157
+ puts TaskBase.hl.color(%!Run Itamae to "#{bname}"!, :red)
154
158
  run_list_noti = []
155
159
  command_recipe.each { |c_recipe|
156
160
  unless c_recipe.split("/")[4].split(".")[0] == 'default'
@@ -102,23 +102,27 @@ module ItamaeMitsurin
102
102
  command << " -l debug" if ENV['debug'] == "true"
103
103
  command << " -c logs/config/local_task.config"
104
104
 
105
- # recipe load to_command
105
+ # Pass to read the recipe command
106
106
  command_recipe = []
107
107
  recipes.each do |recipe_h|
108
108
  target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h[recipe_h.keys.join]}.rb"
109
+ if Dir.glob(target_recipe).empty?
110
+ raise "Recipe load error, nodefile: #{node_file}, reason: Does not exist " +
111
+ recipe_h.keys.join + '::' +recipe_h.values.join
112
+ end
109
113
  Dir.glob(target_recipe).join("\s").split.each do |target|
110
114
  unless File.exists?(target)
111
115
  ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
112
- raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
116
+ raise "Recipe load error, nodefile:#{node_file}, reason: Does not exist #{ex_recipe}"
113
117
  end
114
118
  command_recipe << " #{target}"
115
119
  end
116
120
  end
117
121
 
118
- command_recipe.sort_by! {|item| File.dirname(item)}
122
+ command_recipe.sort_by! {|item| File.dirname(item) }
119
123
  command << command_recipe.join
120
124
 
121
- puts TaskBase.hl.color(%!Run Itamae to \"#{bname}\"!, :red)
125
+ puts TaskBase.hl.color(%!Run Itamae to "#{bname}"!, :red)
122
126
  run_list_noti = []
123
127
  command_recipe.each { |c_recipe|
124
128
  unless c_recipe.split("/")[4].split(".")[0] == 'default'
@@ -62,33 +62,40 @@ module Itamae
62
62
 
63
63
  specs = "bundle exec rspec"
64
64
 
65
- # recipe load to_spec
66
- spec_pattern = []
67
- recipes.each do |spec_h|
68
- target_spec = "site-cookbooks/**/#{spec_h.keys.join}/spec/#{spec_h[spec_h.keys.join]}_spec.rb"
69
- Dir.glob(target_spec).join("\s").split.each do |target|
65
+ # Pass to read the spec command
66
+ command_recipe = []
67
+ recipes.each do |recipe_h|
68
+ target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/spec/#{recipe_h[recipe_h.keys.join]}_spec.rb"
69
+ if Dir.glob(target_recipe).empty?
70
+ raise "Spec load error, nodefile: #{node_file}, reason: Does not exist " +
71
+ recipe_h.keys.join + '::' + recipe_h.values.join
72
+ end
73
+ Dir.glob(target_recipe).join("\s").split.each do |target|
70
74
  unless File.exists?(target)
71
- ex_spec = spec_h.to_s.gsub('=>', '::').gsub('"', '')
72
- raise "Spec load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_spec}"
75
+ ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
76
+ raise "Spec load error, nodefile: #{node_file}, reason: Does not exist #{ex_recipe}"
73
77
  end
74
- spec_pattern << " #{target}"
78
+ command_recipe << " #{target}"
75
79
  end
76
80
  end
77
81
 
78
- spec_pattern.sort_by! {|item| File.dirname(item)}
79
- specs << spec_pattern.join
82
+ command_recipe.sort_by! {|item| File.dirname(item)}
83
+ command << command_recipe.join
84
+
85
+ puts TaskBase.hl.color(%!Run Serverspec to "#{bname}"!, :red)
80
86
  run_list_noti = []
81
- spec_pattern.each { |c_spec|
82
- unless c_spec.split("/")[4].split(".")[0] == 'default_spec'
83
- run_list_noti << c_spec.split("/")[2] + "::#{c_spec.split("/")[4].split(".")[0].split("_spec")[0]}"
87
+ command_recipe.each { |c_recipe|
88
+ unless c_recipe.split('/')[4].split('.')[0] == 'default_spec'
89
+ subspec = c_recipe.split('/')[4].split('.')[0].split('_')[0..-2].join('_')
90
+ run_list_noti << c_recipe.split('/')[2] + "::#{subspec}"
84
91
  else
85
- run_list_noti << c_spec.split("/")[2]
92
+ run_list_noti << c_recipe.split('/')[2]
86
93
  end
87
94
  }
88
95
 
89
- puts TaskBase.hl.color(%!Run Serverspec to \"#{node_name}\"!, :red)
90
96
  puts TaskBase.hl.color(%!Run List to \"#{run_list_noti.uniq.join(", ")}\"!, :green)
91
- st = system specs
97
+ puts TaskBase.hl.color(%!#{command}!, :white)
98
+ st = system command
92
99
  exit 1 unless st
93
100
  end
94
101
  end
@@ -127,14 +127,18 @@ module ItamaeMitsurin
127
127
 
128
128
  command = "bundle exec rspec"
129
129
 
130
- # spec load to_command
130
+ # Pass to read the spec command
131
131
  command_recipe = []
132
132
  recipes.each do |recipe_h|
133
133
  target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/spec/#{recipe_h[recipe_h.keys.join]}_spec.rb"
134
+ if Dir.glob(target_recipe).empty?
135
+ raise "Spec load error, nodefile: #{node_file}, reason: Does not exist " +
136
+ recipe_h.keys.join + '::' + recipe_h.values.join
137
+ end
134
138
  Dir.glob(target_recipe).join("\s").split.each do |target|
135
139
  unless File.exists?(target)
136
140
  ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
137
- raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
141
+ raise "Spec load error, nodefile: #{node_file}, reason: Does not exist #{ex_recipe}"
138
142
  end
139
143
  command_recipe << " #{target}"
140
144
  end
@@ -143,13 +147,14 @@ module ItamaeMitsurin
143
147
  command_recipe.sort_by! {|item| File.dirname(item)}
144
148
  command << command_recipe.join
145
149
 
146
- puts TaskBase.hl.color(%!Run Spec to \"#{bname}\"!, :red)
150
+ puts TaskBase.hl.color(%!Run Serverspec to "#{bname}"!, :red)
147
151
  run_list_noti = []
148
152
  command_recipe.each { |c_recipe|
149
- unless c_recipe.split("/")[4].split(".")[0] == 'default_spec'
150
- run_list_noti << c_recipe.split("/")[2] + "::#{c_recipe.split("/")[4].split(".")[0]}"
153
+ unless c_recipe.split('/')[4].split('.')[0] == 'default_spec'
154
+ subspec = c_recipe.split('/')[4].split('.')[0].split('_')[0..-2].join('_')
155
+ run_list_noti << c_recipe.split('/')[2] + "::#{subspec}"
151
156
  else
152
- run_list_noti << c_recipe.split("/")[2]
157
+ run_list_noti << c_recipe.split('/')[2]
153
158
  end
154
159
  }
155
160
 
@@ -1 +1 @@
1
- 0.44
1
+ 0.45
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-mitsurin
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.44'
4
+ version: '0.45'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akihiro Kamiyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-30 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor