itamae-plugin-recipe-anyenv 0.3.38 → 0.3.39

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: 801ae8f700f2417dd1f44e9f22ea6b91e024c790
4
- data.tar.gz: aee4a0633e64b2a3e4b676dffc4831c2b62d1c1c
3
+ metadata.gz: bdf92242740d8c8ea6fa9008989491ef97ed240c
4
+ data.tar.gz: eea7e6b2445e57d87a96a57ab5f36d070612730f
5
5
  SHA512:
6
- metadata.gz: 4a6f921f4e433c45bf9bc4f50a0f9b1fba1b0d09f6369b62414fd6a4bcf8b5a1c3f479e69faa1c6482e700bfbf579187b293bcd58352ff789645d02fe52ec00a
7
- data.tar.gz: 911b3e894a41f22daccbf8ab712ed95425ee917ccdff72a6c94aedf4e1ea521c6be6dd8cb444007eb080c2cfbafa864e5a86541d778617c0b76079817784ca51
6
+ metadata.gz: 38213b85eda3af495227a86e058ff87c5b5bd62fc4fb4c7944fcb2c4d87f245281ed965225cee874b29c81f771136f6d9755271bcce360549ec1ffad246bc82e
7
+ data.tar.gz: a5e598744febe482485daf6c26fc7f40a6113d793fb6eac72985a8c27a52b23a796ee38c4edde024992d3f61770607932834959137a4a6c6ef095636982fc43a
@@ -22,21 +22,21 @@ def scheme
22
22
  @scheme ||= node[:anyenv][:scheme] || 'git'
23
23
  end
24
24
 
25
- def install_envs(attributes)
26
- attributes[:install_versions].each do |envs|
27
- envs.each do |env, vers|
28
- install('anyenv', env)
25
+ # def install_envs(attributes)
26
+ # attributes[:install_versions].each do |envs|
27
+ # envs.each do |env, vers|
28
+ # install('anyenv', env)
29
29
 
30
- vers.each { |ver| install(env, ver) }
30
+ # vers.each { |ver| install(env, ver) }
31
31
 
32
- global_version(env, vers.first)
33
- end
34
- end
35
- end
32
+ # global_version(env, vers.first)
33
+ # end
34
+ # end
35
+ # end
36
36
 
37
- def install(from, to)
38
- execute anyenv_init_with(@root_path, "yes | #{from} install #{to};")
39
- end
37
+ # def install(from, to)
38
+ # execute anyenv_init_with(@root_path, "yes | #{from} install #{to};")
39
+ # end
40
40
 
41
41
  def init(username)
42
42
  @username = username
@@ -103,46 +103,57 @@ def clone_anyenv_update
103
103
  clone_repository(install_path, repo_path)
104
104
  end
105
105
 
106
- # def install_envs(attributes)
107
- # attributes[:install_versions].each do |envs|
108
- # envs.each do |env, vers|
109
- # install_env(env)
106
+ def install_envs(attributes)
107
+ attributes[:install_versions].each do |envs|
108
+ envs.each do |env, vers|
109
+ install_env(env)
110
110
 
111
- # vers.each do |ver|
112
- # install_env_version(env, ver)
113
- # end
111
+ vers.each do |ver|
112
+ install_env_version(env, ver)
113
+ end
114
114
 
115
- # global_version(env, vers.first)
116
- # end
117
- # end
118
- # end
115
+ global_version(env, vers.first)
116
+ end
117
+ end
118
+ end
119
119
 
120
- # def install_env(envname)
121
- # execute "install #{envname}" do
122
- # user @username if @username
123
- # command @init_cmd
124
- # command "#{@init_cmd} yes | anyenv install #{envname};"
125
- # not_if "type #{envname}"
126
- # end
127
- # end
120
+ def install_env(envname)
121
+ exec = anyenv_init_with @root_path, <<-EOS
122
+ "yes | anyenv install #{version}"
123
+ EOS
124
+ is_exec = anyenv_init_with @root_path, "type #{envname}"
128
125
 
129
- # def install_env_version(envname, version)
130
- # execute "#{envname} install #{version}" do
131
- # user @username if @username
132
- # command "#{@init_cmd} yes | #{envname} install #{version}"
133
- # not_if "#{@init_cmd} #{envname} versions | grep #{version}"
134
- # end
135
- # end
126
+ execute "install #{envname}" do
127
+ user @username if @username
128
+ command exec
129
+ not_if is_exec
130
+ end
131
+ end
132
+
133
+ def install_env_version(envname, version)
134
+ exec = anyenv_init_with @root_path, <<-EOS
135
+ "yes | #{envname} install #{version}"
136
+ EOS
137
+ is_exec = anyenv_init_with @root_path, "#{envname} versions | grep #{version}"
138
+
139
+ execute "#{envname} install #{version}" do
140
+ user @username if @username
141
+ command exec
142
+ not_if is_exec
143
+ end
144
+ end
136
145
 
137
146
  def global_version(envname, version)
138
147
  exec = anyenv_init_with @root_path, <<-EOS
139
- #{envname} global;
140
- #{version}; #{envname} rehash;
141
- EOS
148
+ #{envname} global;
149
+ #{version}; #{envname} rehash;
150
+ EOS
151
+ is_exec = anyenv_init_with @root_path, "#{envname} global | grep #{version}"
152
+
142
153
  execute "#{envname} global #{version}" do
143
- # user @username if @username
154
+ user @username if @username
144
155
  command exec
145
- # not_if anyenv_init_with "#{envname} global | grep #{version}"
156
+ not_if is_exec
146
157
  end
147
158
  # execute "#{envname} global #{version}" do
148
159
  # user @username if @username
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Anyenv
5
- VERSION = '0.3.38'.freeze
5
+ VERSION = '0.3.39'.freeze
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-anyenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.38
4
+ version: 0.3.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Surume