vagrant-layout 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-layout/command.rb +2 -1
- data/lib/vagrant-layout/command_init.rb +17 -16
- data/lib/vagrant-layout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2852387e8df22703fd65a71dc3194a8c817bf1af
|
4
|
+
data.tar.gz: dee5f017bee57fb699658e33d978da3181ee88c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8c1d1c4e3b4166cab1750a7b36cc967922c076efe2d456e1c89f73e11d0e51aaacbd270d6a2b5280339f7e50282500008602b346d4ccda487651423fe91a35b
|
7
|
+
data.tar.gz: f2e9020c888f981a26b7b0ba62d3da7cec27d25d33f2a0c23feabd3daa1e9c9295f284b1360899e89bbdb7a6eda138469ed8b95c84cef4e199177b16ecc68d6d
|
@@ -6,8 +6,7 @@ module VagrantPlugins
|
|
6
6
|
# init command
|
7
7
|
#
|
8
8
|
class CommandInit
|
9
|
-
|
10
|
-
DEFAULT_REPOSITORY = ['koseki', 'vagrant-layout', 'master']
|
9
|
+
DEFAULT_REPOSITORY = %w{koseki vagrant-layout master}
|
11
10
|
|
12
11
|
def initialize(argv)
|
13
12
|
@argv = argv
|
@@ -26,9 +25,7 @@ module VagrantPlugins
|
|
26
25
|
end
|
27
26
|
|
28
27
|
def parse_target(target)
|
29
|
-
unless target
|
30
|
-
return github_target(DEFAULT_REPOSITORY)
|
31
|
-
end
|
28
|
+
return github_target(DEFAULT_REPOSITORY) unless target
|
32
29
|
|
33
30
|
if target =~ %r{\A(https://gist\.github\.com/[^/]+/[0-9a-f]+)(/(download)?)?}
|
34
31
|
url = Regexp.last_match[1]
|
@@ -41,7 +38,7 @@ module VagrantPlugins
|
|
41
38
|
url += path
|
42
39
|
end
|
43
40
|
|
44
|
-
|
41
|
+
[:gist, url]
|
45
42
|
end
|
46
43
|
|
47
44
|
target = target.split('/')
|
@@ -53,12 +50,12 @@ module VagrantPlugins
|
|
53
50
|
target = target[0..3]
|
54
51
|
end
|
55
52
|
|
56
|
-
|
53
|
+
github_target(target)
|
57
54
|
end
|
58
55
|
|
59
56
|
def github_target(target)
|
60
57
|
url = "https://github.com/#{ target[0] }/#{ target[1] }/archive/#{ target[2] }.tar.gz"
|
61
|
-
|
58
|
+
[:github, url]
|
62
59
|
end
|
63
60
|
|
64
61
|
def download_layout(root, target)
|
@@ -114,7 +111,7 @@ module VagrantPlugins
|
|
114
111
|
else
|
115
112
|
msg = 'Illegal base url. Base URL must be like '
|
116
113
|
msg += 'https://github.com/{user}/{repos}/tree/[0-9a-f]{40}'
|
117
|
-
|
114
|
+
fail msg
|
118
115
|
end
|
119
116
|
end
|
120
117
|
end
|
@@ -129,13 +126,17 @@ module VagrantPlugins
|
|
129
126
|
|
130
127
|
def copy_gist_files(gist_dir, github_dir)
|
131
128
|
Dir.chdir(gist_dir) do
|
132
|
-
Dir.glob('*')
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
129
|
+
files = Dir.glob('*')
|
130
|
+
if files.include?('patch')
|
131
|
+
apply_patch(File.join(gist_dir, 'patch'), github_dir)
|
132
|
+
files.delete('patch')
|
133
|
+
end
|
134
|
+
files.each do |file|
|
135
|
+
dest_path = file.gsub('__', '/').gsub('//', '/')
|
136
|
+
next if dest_path =~ /\.\.|\r|\n/
|
137
|
+
dest_file = File.join(github_dir, dest_path)
|
138
|
+
FileUtils.mkdir_p(File.dirname(dest_file))
|
139
|
+
FileUtils.cp(File.join(gist_dir, file), dest_file, preserve: true)
|
139
140
|
end
|
140
141
|
end
|
141
142
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOSEKI Kengo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|