itamae-mitsurin 0.45 → 0.46

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: ec2c9668277bd1b04553438f10d215cc0c996c21
4
- data.tar.gz: 47bdc2fd6ad9ac8218a9ce7607303ae587d95299
3
+ metadata.gz: 9d1f6d29ae9b227945bb222e0eb972c819039c5b
4
+ data.tar.gz: 9acdc555933504a72946673268da92c337ee7647
5
5
  SHA512:
6
- metadata.gz: 76665bda355bf49f0fa5e6e3b43477ddfa7661a6b2313a9b0af7e363db16ab71d00d12104927cabd00af419348c94a047345acc230d114fa8815d345b5fb2dcb
7
- data.tar.gz: 45687ee91f3f4b576e132cc28536cf9dee92b115197157ea3c60bbda8ad636c0cc8b108ed484c98b4a6972400eba1854fa53d4de754a5d2dd440c239004ea878
6
+ metadata.gz: 618c953d6cac86794aa74fcc8637e48b9a079848a44fba14dfa17f644fedac7ed78e576637b0aa3995d6e4cf55f654547fe1ea47be0bea2c69e435b690b32581
7
+ data.tar.gz: f20681d4563b280058249ae489677edaf94534fd587bd85d50f424ff719d6cb43eeb6da342d7a625bf36d1b760fac044a7524625c8c96dd406238edbda02dc39
@@ -111,9 +111,9 @@ module ItamaeMitsurin
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
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
117
  end
118
118
  Dir.glob(target_recipe).join("\s").split.each do |target|
119
119
  unless File.exists?(target)
@@ -120,9 +120,9 @@ module ItamaeMitsurin
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
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
126
  end
127
127
  Dir.glob(target_recipe).join("\s").split.each do |target|
128
128
  unless File.exists?(target)
@@ -138,9 +138,9 @@ module ItamaeMitsurin
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
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
144
  end
145
145
  Dir.glob(target_recipe).join("\s").split.each do |target|
146
146
  unless File.exists?(target)
@@ -84,23 +84,22 @@ module ItamaeMitsurin
84
84
  end
85
85
 
86
86
  def action_edit(options)
87
- if attributes.mode
88
- run_specinfra(:change_file_mode, @temppath, attributes.mode)
89
- else
90
- mode = run_specinfra(:get_file_mode, attributes.path).stdout.chomp
91
- run_specinfra(:change_file_mode, @temppath, mode)
87
+ change_target = attributes.modified ? @temppath : attributes.path
88
+
89
+ if attributes.mode || attributes.modified
90
+ mode = attributes.mode || run_specinfra(:get_file_mode, attributes.path).stdout.chomp
91
+ run_specinfra(:change_file_mode, change_target, mode)
92
92
  end
93
93
 
94
- if attributes.owner || attributes.group
95
- run_specinfra(:change_file_owner, @temppath, attributes.owner, attributes.group)
96
- else
97
- owner = run_specinfra(:get_file_owner_user, attributes.path).stdout.chomp
98
- group = run_specinfra(:get_file_owner_group, attributes.path).stdout.chomp
99
- run_specinfra(:change_file_owner, @temppath, owner)
100
- run_specinfra(:change_file_group, @temppath, group)
94
+ if attributes.owner || attributes.group || attributes.modified
95
+ owner = attributes.owner || run_specinfra(:get_file_owner_user, attributes.path).stdout.chomp
96
+ group = attributes.group || run_specinfra(:get_file_owner_group, attributes.path).stdout.chomp
97
+ run_specinfra(:change_file_owner, change_target, owner, group)
101
98
  end
102
99
 
103
- run_specinfra(:move_file, @temppath, attributes.path)
100
+ if attributes.modified
101
+ run_specinfra(:move_file, @temppath, attributes.path)
102
+ end
104
103
  end
105
104
 
106
105
  private
@@ -1 +1 @@
1
- 0.45
1
+ 0.46
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.45'
4
+ version: '0.46'
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-07-05 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor