forked from vmware-archive/salty-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant-salt.gemspec
43 lines (34 loc) · 1.64 KB
/
vagrant-salt.gemspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "vagrant-salt"
s.version = "0.4.0"
s.authors = ["Alec Koumjian", "Kiall Mac Innes", "Pedro Algarvio"]
s.homepage = "https://github.com/saltstack/salty-vagrant"
s.summary = %q{Vagrant Salt Stack provisioner plugin}
s.description = %q{Vagrant Salt Stack provisioner plugin}
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib", "templates"]
s.add_runtime_dependency "vagrant"
# get an array of submodule dirs by executing 'pwd' inside each submodule
`git submodule --quiet foreach pwd`.split($\).each do |submodule_path|
# for each submodule, change working directory to that submodule
Dir.chdir(submodule_path) do
# issue git ls-files in submodule's directory
submodule_files = `git ls-files`.split("\n")
# prepend the submodule path to create absolute file paths
submodule_files_fullpaths = submodule_files.map do |filename|
"#{submodule_path}/#{filename}"
end
# remove leading path parts to get paths relative to the gem's root dir
submodule_files_paths = submodule_files_fullpaths.map do |filename|
filename.gsub "#{File.dirname(File.expand_path(File.dirname(__FILE__)))}/", ""
end
# add relative paths to gem.files
s.files += submodule_files_paths
end
end
end