itamae-plugin-recipe-anyenv 0.3.27 → 0.3.28

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: 17575c08b4d46808d6518fa8a42cc3d325f88fd4
4
- data.tar.gz: 8525d9048225f4a2a7962ceeffd749a013b70350
3
+ metadata.gz: 82678f915847ba064e7fdf607d193d815424e158
4
+ data.tar.gz: 0d530923780d0d958d21fdc2866b8bdda1982a91
5
5
  SHA512:
6
- metadata.gz: f8ded909ab103103c9618984f4882557ccf2ab33d37f8c016e1a13fb1416e4ecacc57926430d77ff7ac6f08100e14bce4448bcf1e4bfdc710a725b44141c54e8
7
- data.tar.gz: 8772e32e90da2c5cee57e593013c5bcea2995a80d11f272ce128be386ad4b06802698e944a41694251e4a502389fb6ee5a94824fcb07c98ba2a0acf6bad92e05
6
+ metadata.gz: 5aba2b08b7af06ed3c6f50b4246a0ebb3dfb32d487b7d22bfd68d005e74b23bac2c3875a05385e379b8f236c8d0549fead4a4765d5b71c9faa70ac7e77216892
7
+ data.tar.gz: f0771d09f9a35ad5378a51ebbf3598fabaff699a1592904e0244e70d0871fe7427f89cbcfab439e5aaa3cf81e85bce101895d82bbb65ff260530bb4b99560e6a
@@ -8,19 +8,19 @@ def run(attributes, username = ENV['USER'])
8
8
  p :ANYENV_ROOT
9
9
  p ENV['ANYENV_ROOT']
10
10
 
11
- clone_anyenv(@root_path)
12
- clone_anyenv_update(@root_path)
11
+ clone_anyenv
12
+ clone_anyenv_update
13
13
 
14
14
  directory "#{@root_path}/envs"
15
15
 
16
- install('anyenv', 'rbenv')
17
- install('rbenv', '2.3.1')
18
- install('anyenv', 'exenv')
19
- install('exenv', '1.3.2')
16
+ # install('anyenv', 'rbenv')
17
+ # install('rbenv', '2.3.1')
18
+ # install('anyenv', 'exenv')
19
+ # install('exenv', '1.3.2')
20
20
 
21
21
 
22
22
 
23
- # install_envs(attributes)
23
+ install_envs(attributes)
24
24
  end
25
25
 
26
26
  private
@@ -29,6 +29,18 @@ def scheme
29
29
  @scheme ||= node[:anyenv][:scheme] || 'git'
30
30
  end
31
31
 
32
+ def install_envs
33
+ attributes[:install_versions].each do |envs|
34
+ envs.each do |env, vers|
35
+ install('anyenv', env)
36
+
37
+ vers.each { |ver| install(env, ver) }
38
+
39
+ global_version(env, vers.first)
40
+ end
41
+ end
42
+ end
43
+
32
44
  def install(from, to)
33
45
  execute <<-"EOS".gsub("\n", ' ')
34
46
  export ANYENV_ROOT=#{@root_path};
@@ -85,13 +97,13 @@ def clone_repository(install_path, repo_path)
85
97
  end
86
98
  end
87
99
 
88
- def clone_anyenv(root_path)
100
+ def clone_anyenv
89
101
  repo_path = "#{scheme}://github.com/riywo/anyenv.git"
90
- clone_repository(root_path, repo_path)
102
+ clone_repository(@root_path, repo_path)
91
103
  end
92
104
 
93
- def clone_anyenv_update(root_path)
94
- install_path = "#{root_path}/plugins/anyenv-update"
105
+ def clone_anyenv_update
106
+ install_path = "#{@root_path}/plugins/anyenv-update"
95
107
  repo_path = "#{scheme}://github.com/znz/anyenv-update.git"
96
108
  clone_repository(install_path, repo_path)
97
109
  end
@@ -127,11 +139,13 @@ end
127
139
  # end
128
140
  # end
129
141
 
130
- # def global_version(envname, version)
131
- # execute "#{envname} global #{version}" do
132
- # user @username if @username
133
- # command "#{@init_cmd} #{envname} global #{version}; " \
134
- # "#{@init_cmd} #{envname} rehash"
135
- # not_if "#{@init_cmd} #{envname} global | grep #{version}"
136
- # end
137
- # end
142
+ def global_version(envname, version)
143
+ execute "#{envname} global #{version}" do
144
+ user @username if @username
145
+ command <<-EOS
146
+ #{envname} global #{version};
147
+ #{envname} rehash;
148
+ EOS
149
+ not_if "#{envname} global | grep #{version}"
150
+ end
151
+ end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Anyenv
5
- VERSION = '0.3.27'.freeze
5
+ VERSION = '0.3.28'.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.27
4
+ version: 0.3.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Surume