-
Notifications
You must be signed in to change notification settings - Fork 40
/
vagrant-vmware-desktop.gemspec
36 lines (31 loc) · 1.41 KB
/
vagrant-vmware-desktop.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
Gem::Specification.new do |s|
s.name = "vagrant-vmware-desktop"
s.version = File.read(File.expand_path("../versions/desktop.txt", __FILE__))
s.platform = Gem::Platform::RUBY
s.authors = "Vagrant Team"
s.email = "vagrant@hashicorp.com"
s.homepage = "http://www.vagrantup.com"
s.license = "MPL-2.0"
s.summary = "Enables Vagrant to power VMware Workstation/Fusion machines."
s.description = "Enables Vagrant to power VMware Workstation/Fusion machines."
s.required_rubygems_version = ">= 1.3.6"
root_path = File.dirname(__FILE__)
all_files = Dir.chdir(root_path) { Dir.glob("lib/**/*") }
all_files.concat(Dir.chdir(root_path) { Dir.glob("locales/**/*") })
all_files.reject! { |file| file.start_with?("lib/hashicorp") }
all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
gitignore_path = File.join(root_path, ".gitignore")
gitignore = File.readlines(gitignore_path)
gitignore.map! { |line| line.chomp.strip }
gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
unignored_files = all_files.reject do |file|
next true if File.directory?(file)
gitignore.any? do |ignore|
File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
end
end
s.files = unignored_files
s.executables = []
s.require_path = 'lib'
end