vagrant-cloudstack 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -19
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +19 -19
  5. data/CHANGELOG.md +179 -171
  6. data/Docker/.dockerignore +2 -0
  7. data/Docker/Dockerfile +51 -0
  8. data/Docker/Dockerfile.chefdk_0_17 +49 -0
  9. data/Docker/Dockerfile.latest_dependencies +49 -0
  10. data/Docker/README.md +67 -0
  11. data/Docker/vac.ps1 +29 -0
  12. data/Docker/vac.sh +30 -0
  13. data/Gemfile +20 -20
  14. data/LICENSE +8 -8
  15. data/README.md +416 -416
  16. data/Rakefile +106 -99
  17. data/bootstrap.key +27 -0
  18. data/build_rpm.sh +7 -7
  19. data/functional-tests/basic/Vagrantfile.basic_networking +45 -45
  20. data/functional-tests/basic/basic_spec.rb +21 -21
  21. data/functional-tests/networking/Vagrantfile.advanced_networking +119 -102
  22. data/functional-tests/networking/networking_spec.rb +14 -0
  23. data/functional-tests/rsync/Vagrantfile.advanced_networking +39 -56
  24. data/functional-tests/rsync/rsync_spec.rb +9 -9
  25. data/functional-tests/vmlifecycle/Vagrantfile.advanced_networking +66 -82
  26. data/functional-tests/vmlifecycle/vmlifecycle_spec.rb +13 -13
  27. data/lib/vagrant-cloudstack/action/connect_cloudstack.rb +47 -47
  28. data/lib/vagrant-cloudstack/action/is_created.rb +18 -18
  29. data/lib/vagrant-cloudstack/action/is_stopped.rb +18 -18
  30. data/lib/vagrant-cloudstack/action/message_already_created.rb +16 -16
  31. data/lib/vagrant-cloudstack/action/message_not_created.rb +16 -16
  32. data/lib/vagrant-cloudstack/action/message_will_not_destroy.rb +16 -16
  33. data/lib/vagrant-cloudstack/action/read_rdp_info.rb +76 -76
  34. data/lib/vagrant-cloudstack/action/read_ssh_info.rb +104 -87
  35. data/lib/vagrant-cloudstack/action/read_state.rb +38 -38
  36. data/lib/vagrant-cloudstack/action/read_winrm_info.rb +103 -103
  37. data/lib/vagrant-cloudstack/action/run_instance.rb +798 -703
  38. data/lib/vagrant-cloudstack/action/start_instance.rb +81 -81
  39. data/lib/vagrant-cloudstack/action/stop_instance.rb +28 -28
  40. data/lib/vagrant-cloudstack/action/terminate_instance.rb +269 -224
  41. data/lib/vagrant-cloudstack/action/timed_provision.rb +21 -21
  42. data/lib/vagrant-cloudstack/action/wait_for_state.rb +41 -41
  43. data/lib/vagrant-cloudstack/action/warn_networks.rb +19 -19
  44. data/lib/vagrant-cloudstack/action.rb +210 -210
  45. data/lib/vagrant-cloudstack/capabilities/rdp.rb +12 -12
  46. data/lib/vagrant-cloudstack/capabilities/winrm.rb +12 -12
  47. data/lib/vagrant-cloudstack/config.rb +566 -548
  48. data/lib/vagrant-cloudstack/errors.rb +27 -27
  49. data/lib/vagrant-cloudstack/exceptions/exceptions.rb +10 -10
  50. data/lib/vagrant-cloudstack/model/cloudstack_resource.rb +51 -33
  51. data/lib/vagrant-cloudstack/plugin.rb +82 -82
  52. data/lib/vagrant-cloudstack/provider.rb +58 -58
  53. data/lib/vagrant-cloudstack/service/cloudstack_resource_service.rb +64 -58
  54. data/lib/vagrant-cloudstack/util/timer.rb +17 -17
  55. data/lib/vagrant-cloudstack/version.rb +5 -5
  56. data/lib/vagrant-cloudstack.rb +17 -17
  57. data/locales/en.yml +131 -123
  58. data/spec/spec_helper.rb +8 -6
  59. data/spec/vagrant-cloudstack/action/read_ssh_info_spec.rb +80 -0
  60. data/spec/vagrant-cloudstack/config_spec.rb +355 -355
  61. data/spec/vagrant-cloudstack/model/cloudstack_resource_spec.rb +95 -73
  62. data/spec/vagrant-cloudstack/service/cloudstack_resource_service_spec.rb +43 -43
  63. data/spec/vagrant-cloudstack/support/be_a_resource.rb +6 -0
  64. data/vagrant-cloudstack.gemspec +59 -59
  65. data/vagrant-cloudstack.spec +42 -42
  66. metadata +14 -7
  67. data/dummy.box +0 -0
  68. data/example_box/README.md +0 -13
  69. data/example_box/metadata.json +0 -3
  70. data/functional-tests/networking/rsync_spec.rb +0 -12
@@ -1,73 +1,95 @@
1
- require 'spec_helper'
2
- require 'vagrant-cloudstack/model/cloudstack_resource'
3
-
4
- include VagrantPlugins::Cloudstack::Model
5
-
6
- describe CloudstackResource do
7
- context 'when all attribtues are defined' do
8
- let(:resource) { CloudstackResource.new('id', 'name', 'kind') }
9
-
10
- describe '#to_s' do
11
- it 'prints the resource with all attributes' do
12
- expect(resource.to_s).to be_eql 'kind - id:name'
13
- end
14
- end
15
-
16
- describe '#is_undefined?' do
17
- it { expect(resource.is_undefined?).to be_eql false }
18
- end
19
-
20
- describe '#is_id_undefined?' do
21
- it { expect(resource.is_id_undefined?).to be_eql false }
22
- end
23
-
24
- describe '#is_name_undefined?' do
25
- it { expect(resource.is_name_undefined?).to be_eql false }
26
- end
27
- end
28
-
29
- context 'when kind is not defined' do
30
- describe '#new' do
31
- it 'raises an error when kind is nil' do
32
- expect { CloudstackResource.new('id', 'name', nil) }.to raise_error('Resource must have a kind')
33
- end
34
-
35
- it 'raises an error when kind is empty' do
36
- expect { CloudstackResource.new('id', 'name', '') }.to raise_error('Resource must have a kind')
37
- end
38
- end
39
- end
40
-
41
- describe '#is_undefined?' do
42
- it { expect(CloudstackResource.new('', '', 'kind').is_undefined?).to be_eql true }
43
- it { expect(CloudstackResource.new(nil, '', 'kind').is_undefined?).to be_eql true }
44
- it { expect(CloudstackResource.new('', nil, 'kind').is_undefined?).to be_eql true }
45
- it { expect(CloudstackResource.new(nil, nil, 'kind').is_undefined?).to be_eql true }
46
- it { expect(CloudstackResource.new('id', nil, 'kind').is_undefined?).to be_eql false }
47
- it { expect(CloudstackResource.new(nil, 'name', 'kind').is_undefined?).to be_eql false }
48
- it { expect(CloudstackResource.new('id', '', 'kind').is_undefined?).to be_eql false }
49
- it { expect(CloudstackResource.new('', 'name', 'kind').is_undefined?).to be_eql false }
50
- end
51
-
52
- describe '#is_id_undefined?' do
53
- it { expect(CloudstackResource.new('', 'name', 'kind').is_id_undefined?).to be_eql true }
54
- it { expect(CloudstackResource.new(nil, 'name', 'kind').is_id_undefined?).to be_eql true }
55
- it { expect(CloudstackResource.new('', '', 'kind').is_id_undefined?).to be_eql true }
56
- it { expect(CloudstackResource.new(nil, '', 'kind').is_id_undefined?).to be_eql true }
57
- it { expect(CloudstackResource.new('', nil, 'kind').is_id_undefined?).to be_eql true }
58
- it { expect(CloudstackResource.new(nil, nil, 'kind').is_id_undefined?).to be_eql true }
59
- it { expect(CloudstackResource.new('id', nil, 'kind').is_id_undefined?).to be_eql false }
60
- it { expect(CloudstackResource.new('id', '', 'kind').is_id_undefined?).to be_eql false }
61
- end
62
-
63
- describe '#is_name_undefined?' do
64
- it { expect(CloudstackResource.new('id', '', 'kind').is_name_undefined?).to be_eql true }
65
- it { expect(CloudstackResource.new('id', nil, 'kind').is_name_undefined?).to be_eql true }
66
- it { expect(CloudstackResource.new('', '', 'kind').is_name_undefined?).to be_eql true }
67
- it { expect(CloudstackResource.new(nil, '', 'kind').is_name_undefined?).to be_eql true }
68
- it { expect(CloudstackResource.new('', nil, 'kind').is_name_undefined?).to be_eql true }
69
- it { expect(CloudstackResource.new(nil, nil, 'kind').is_name_undefined?).to be_eql true }
70
- it { expect(CloudstackResource.new(nil, 'name', 'kind').is_name_undefined?).to be_eql false }
71
- it { expect(CloudstackResource.new('', 'name', 'kind').is_name_undefined?).to be_eql false }
72
- end
73
- end
1
+ require 'spec_helper'
2
+ require 'vagrant-cloudstack/model/cloudstack_resource'
3
+
4
+ include VagrantPlugins::Cloudstack::Model
5
+
6
+ describe CloudstackResource do
7
+ context 'when all attribtues are defined' do
8
+ let(:resource) { CloudstackResource.new('id', 'name', 'kind') }
9
+
10
+ describe '#to_s' do
11
+ it 'prints the resource with all attributes' do
12
+ expect(resource.to_s).to be_eql 'kind - id:name'
13
+ end
14
+ end
15
+
16
+ describe '#is_undefined?' do
17
+ it { expect(resource.is_undefined?).to be_eql false }
18
+ end
19
+
20
+ describe '#is_id_undefined?' do
21
+ it { expect(resource.is_id_undefined?).to be_eql false }
22
+ end
23
+
24
+ describe '#is_name_undefined?' do
25
+ it { expect(resource.is_name_undefined?).to be_eql false }
26
+ end
27
+ end
28
+
29
+ context 'when kind is not defined' do
30
+ describe '#new' do
31
+ it 'raises an error when kind is nil' do
32
+ expect { CloudstackResource.new('id', 'name', nil) }.to raise_error('Resource must have a kind')
33
+ end
34
+
35
+ it 'raises an error when kind is empty' do
36
+ expect { CloudstackResource.new('id', 'name', '') }.to raise_error('Resource must have a kind')
37
+ end
38
+ end
39
+ end
40
+
41
+ describe '#is_undefined?' do
42
+ it { expect(CloudstackResource.new('', '', 'kind').is_undefined?).to be_eql true }
43
+ it { expect(CloudstackResource.new(nil, '', 'kind').is_undefined?).to be_eql true }
44
+ it { expect(CloudstackResource.new('', nil, 'kind').is_undefined?).to be_eql true }
45
+ it { expect(CloudstackResource.new(nil, nil, 'kind').is_undefined?).to be_eql true }
46
+ it { expect(CloudstackResource.new('id', nil, 'kind').is_undefined?).to be_eql false }
47
+ it { expect(CloudstackResource.new(nil, 'name', 'kind').is_undefined?).to be_eql false }
48
+ it { expect(CloudstackResource.new('id', '', 'kind').is_undefined?).to be_eql false }
49
+ it { expect(CloudstackResource.new('', 'name', 'kind').is_undefined?).to be_eql false }
50
+ end
51
+
52
+ describe '#is_id_undefined?' do
53
+ it { expect(CloudstackResource.new('', 'name', 'kind').is_id_undefined?).to be_eql true }
54
+ it { expect(CloudstackResource.new(nil, 'name', 'kind').is_id_undefined?).to be_eql true }
55
+ it { expect(CloudstackResource.new('', '', 'kind').is_id_undefined?).to be_eql true }
56
+ it { expect(CloudstackResource.new(nil, '', 'kind').is_id_undefined?).to be_eql true }
57
+ it { expect(CloudstackResource.new('', nil, 'kind').is_id_undefined?).to be_eql true }
58
+ it { expect(CloudstackResource.new(nil, nil, 'kind').is_id_undefined?).to be_eql true }
59
+ it { expect(CloudstackResource.new('id', nil, 'kind').is_id_undefined?).to be_eql false }
60
+ it { expect(CloudstackResource.new('id', '', 'kind').is_id_undefined?).to be_eql false }
61
+ end
62
+
63
+ describe '#is_name_undefined?' do
64
+ it { expect(CloudstackResource.new('id', '', 'kind').is_name_undefined?).to be_eql true }
65
+ it { expect(CloudstackResource.new('id', nil, 'kind').is_name_undefined?).to be_eql true }
66
+ it { expect(CloudstackResource.new('', '', 'kind').is_name_undefined?).to be_eql true }
67
+ it { expect(CloudstackResource.new(nil, '', 'kind').is_name_undefined?).to be_eql true }
68
+ it { expect(CloudstackResource.new('', nil, 'kind').is_name_undefined?).to be_eql true }
69
+ it { expect(CloudstackResource.new(nil, nil, 'kind').is_name_undefined?).to be_eql true }
70
+ it { expect(CloudstackResource.new(nil, 'name', 'kind').is_name_undefined?).to be_eql false }
71
+ it { expect(CloudstackResource.new('', 'name', 'kind').is_name_undefined?).to be_eql false }
72
+ end
73
+
74
+ describe '#create_id_list' do
75
+ subject { CloudstackResource.create_id_list(ids, kind) }
76
+
77
+ let(:kind) { 'network' }
78
+ let(:ids) { %w(id1 id2) }
79
+
80
+ its(:count) { should eq 2 }
81
+ its([0]) { should be_a_resource('id1', nil, kind) }
82
+ its([1]) { should be_a_resource('id2', nil, kind) }
83
+ end
84
+
85
+ describe '#create_name_list' do
86
+ subject { CloudstackResource.create_name_list(names, kind) }
87
+
88
+ let(:kind) { 'network' }
89
+ let(:names) { %w(name1 name2) }
90
+
91
+ its(:count) { should eq 2 }
92
+ its([0]) { should be_a_resource(nil, 'name1', kind) }
93
+ its([1]) { should be_a_resource(nil, 'name2', kind) }
94
+ end
95
+ end
@@ -1,43 +1,43 @@
1
- require 'spec_helper'
2
- require 'vagrant-cloudstack/model/cloudstack_resource'
3
- require 'vagrant-cloudstack/service/cloudstack_resource_service'
4
-
5
- include VagrantPlugins::Cloudstack::Model
6
- include VagrantPlugins::Cloudstack::Service
7
-
8
- describe CloudstackResourceService do
9
- let(:cloudstack_compute) { double('Fog::Compute::Cloudstack') }
10
- let(:ui) { double('Vagrant::UI') }
11
- let(:service) { CloudstackResourceService.new(cloudstack_compute, ui) }
12
-
13
- before do
14
- response = {
15
- 'listkindsresponse' => {
16
- 'kind' => [{ 'id' => 'resource id', 'name' => 'resource name' }]
17
- }
18
- }
19
- allow(cloudstack_compute).to receive(:send).with(:list_kinds, { 'id' => 'resource id' }).and_return(response)
20
- allow(cloudstack_compute).to receive(:send).with(:list_kinds, {}).and_return(response)
21
-
22
- allow(ui).to receive(:detail)
23
- allow(ui).to receive(:info)
24
- end
25
-
26
- describe '#sync_resource' do
27
- it 'retrives the missing name' do
28
- resource = CloudstackResource.new('resource id', nil, 'kind')
29
- service.sync_resource(resource)
30
-
31
- expect(resource.name).to be_eql 'resource name'
32
- expect(resource.id).to be_eql 'resource id'
33
- end
34
-
35
- it 'retrives the missing id' do
36
- resource = CloudstackResource.new(nil, 'resource name', 'kind')
37
- service.sync_resource(resource)
38
-
39
- expect(resource.id).to be_eql 'resource id'
40
- expect(resource.name).to be_eql 'resource name'
41
- end
42
- end
43
- end
1
+ require 'spec_helper'
2
+ require 'vagrant-cloudstack/model/cloudstack_resource'
3
+ require 'vagrant-cloudstack/service/cloudstack_resource_service'
4
+
5
+ include VagrantPlugins::Cloudstack::Model
6
+ include VagrantPlugins::Cloudstack::Service
7
+
8
+ describe CloudstackResourceService do
9
+ let(:cloudstack_compute) { double('Fog::Compute::Cloudstack') }
10
+ let(:ui) { double('Vagrant::UI') }
11
+ let(:service) { CloudstackResourceService.new(cloudstack_compute, ui) }
12
+
13
+ before do
14
+ response = {
15
+ 'listkindsresponse' => {
16
+ 'kind' => [{ 'id' => 'resource id', 'name' => 'resource name' }]
17
+ }
18
+ }
19
+ allow(cloudstack_compute).to receive(:send).with(:list_kinds, { 'id' => 'resource id' }).and_return(response)
20
+ allow(cloudstack_compute).to receive(:send).with(:list_kinds, {}).and_return(response)
21
+
22
+ allow(ui).to receive(:detail)
23
+ allow(ui).to receive(:info)
24
+ end
25
+
26
+ describe '#sync_resource' do
27
+ it 'retrives the missing name' do
28
+ resource = CloudstackResource.new('resource id', nil, 'kind')
29
+ service.sync_resource(resource)
30
+
31
+ expect(resource.name).to be_eql 'resource name'
32
+ expect(resource.id).to be_eql 'resource id'
33
+ end
34
+
35
+ it 'retrives the missing id' do
36
+ resource = CloudstackResource.new(nil, 'resource name', 'kind')
37
+ service.sync_resource(resource)
38
+
39
+ expect(resource.id).to be_eql 'resource id'
40
+ expect(resource.name).to be_eql 'resource name'
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,6 @@
1
+ RSpec::Matchers.define :be_a_resource do |id, name, kind|
2
+ match do |actual|
3
+ actual.is_a?(VagrantPlugins::Cloudstack::Model::CloudstackResource) &&
4
+ actual.id == id && actual.name == name && actual.kind == kind
5
+ end
6
+ end
@@ -1,59 +1,59 @@
1
- $:.unshift File.expand_path('../lib', __FILE__)
2
- require 'vagrant-cloudstack/version'
3
-
4
- Gem::Specification.new do |s|
5
- s.name = 'vagrant-cloudstack'
6
- s.version = VagrantPlugins::Cloudstack::VERSION
7
- s.platform = Gem::Platform::RUBY
8
- s.license = 'MIT'
9
- s.authors = ['Mitchell Hashimoto', 'Carl Loa Odin', 'Tor-Åke Fransson', 'Olle Lundberg', 'Roeland Kuipers', 'Yuichi Uemura', 'Atsushi Sasaki', 'Nicolas Brechet', 'Peter Jönsson', 'Christophe Roux', 'Andrei Chiriaev', 'Miguel Ferreira', 'Timothy van Zadelhoff', 'Geurt Schimmel', 'Bob van den Heuvel']
10
- s.email = 'int-toolkit@schubergphilis.com'
11
- s.homepage = 'https://github.com/schubergphilis/vagrant-cloudstack/'
12
- s.summary = 'Enables Vagrant to manage machines in Cloudstack.'
13
- s.description = 'Provides a cloudstack provider in Vagrant via which Vagrant can manage machines in CloudStack.'
14
-
15
- s.required_rubygems_version = '>= 1.3.6'
16
- s.rubyforge_project = 'vagrant-cloudstack'
17
-
18
- s.add_runtime_dependency 'fog', '~> 1.32', '>= 1.32.0'
19
-
20
- s.add_development_dependency 'rake', '>= 10.4', '~> 10.5'
21
- s.add_development_dependency 'rspec-core', '~> 2.14', '>= 2.14.7'
22
- s.add_development_dependency 'rspec-expectations', '~> 2.14', '>= 2.14.4'
23
- s.add_development_dependency 'rspec-mocks', '~> 2.14', '>= 2.14.4'
24
-
25
- # The following block of code determines the files that should be included
26
- # in the gem. It does this by reading all the files in the directory where
27
- # this gemspec is, and parsing out the ignored files from the gitignore.
28
- # Note that the entire gitignore(5) syntax is not supported, specifically
29
- # the "!" syntax, but it should mostly work correctly.
30
- root_path = File.dirname(__FILE__)
31
- all_files = Dir.chdir(root_path) { Dir.glob('**/{*,.*}') }
32
- all_files.reject! { |file| ['.', '..'].include?(File.basename(file)) }
33
- gitignore_path = File.join(root_path, '.gitignore')
34
- gitignore = File.readlines(gitignore_path)
35
- gitignore.map! { |line| line.chomp.strip }
36
- gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
37
-
38
- unignored_files = all_files.reject do |file|
39
- # Ignore any directories, the gemspec only cares about files
40
- next true if File.directory?(file)
41
-
42
- # Ignore any paths that match anything in the gitignore. We do
43
- # two tests here:
44
- #
45
- # - First, test to see if the entire path matches the gitignore.
46
- # - Second, match if the basename does, this makes it so that things
47
- # like '.DS_Store' will match sub-directories too (same behavior
48
- # as git).
49
- #
50
- gitignore.any? do |ignore|
51
- File.fnmatch(ignore, file) ||
52
- File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
53
- end
54
- end
55
-
56
- s.files = unignored_files
57
- s.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
58
- s.require_path = 'lib'
59
- end
1
+ $:.unshift File.expand_path('../lib', __FILE__)
2
+ require 'vagrant-cloudstack/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'vagrant-cloudstack'
6
+ s.version = VagrantPlugins::Cloudstack::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.license = 'MIT'
9
+ s.authors = ['Mitchell Hashimoto', 'Carl Loa Odin', 'Tor-Åke Fransson', 'Olle Lundberg', 'Roeland Kuipers', 'Yuichi Uemura', 'Atsushi Sasaki', 'Nicolas Brechet', 'Peter Jönsson', 'Christophe Roux', 'Andrei Chiriaev', 'Miguel Ferreira', 'Timothy van Zadelhoff', 'Geurt Schimmel', 'Bob van den Heuvel']
10
+ s.email = 'int-toolkit@schubergphilis.com'
11
+ s.homepage = 'https://github.com/missioncriticalcloud/vagrant-cloudstack/'
12
+ s.summary = 'Enables Vagrant to manage machines in Cloudstack.'
13
+ s.description = 'Provides a cloudstack provider in Vagrant via which Vagrant can manage machines in CloudStack.'
14
+
15
+ s.required_rubygems_version = '>= 1.3.6'
16
+ s.rubyforge_project = 'vagrant-cloudstack'
17
+
18
+ s.add_runtime_dependency 'fog', '~> 1.32', '>= 1.32.0'
19
+
20
+ s.add_development_dependency 'rake', '>= 10.4', '~> 10.5'
21
+ s.add_development_dependency 'rspec-core', '~> 2.14', '>= 2.14.7'
22
+ s.add_development_dependency 'rspec-expectations', '~> 2.14', '>= 2.14.4'
23
+ s.add_development_dependency 'rspec-mocks', '~> 2.14', '>= 2.14.4'
24
+
25
+ # The following block of code determines the files that should be included
26
+ # in the gem. It does this by reading all the files in the directory where
27
+ # this gemspec is, and parsing out the ignored files from the gitignore.
28
+ # Note that the entire gitignore(5) syntax is not supported, specifically
29
+ # the "!" syntax, but it should mostly work correctly.
30
+ root_path = File.dirname(__FILE__)
31
+ all_files = Dir.chdir(root_path) { Dir.glob('**/{*,.*}') }
32
+ all_files.reject! { |file| ['.', '..'].include?(File.basename(file)) }
33
+ gitignore_path = File.join(root_path, '.gitignore')
34
+ gitignore = File.readlines(gitignore_path)
35
+ gitignore.map! { |line| line.chomp.strip }
36
+ gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
37
+
38
+ unignored_files = all_files.reject do |file|
39
+ # Ignore any directories, the gemspec only cares about files
40
+ next true if File.directory?(file)
41
+
42
+ # Ignore any paths that match anything in the gitignore. We do
43
+ # two tests here:
44
+ #
45
+ # - First, test to see if the entire path matches the gitignore.
46
+ # - Second, match if the basename does, this makes it so that things
47
+ # like '.DS_Store' will match sub-directories too (same behavior
48
+ # as git).
49
+ #
50
+ gitignore.any? do |ignore|
51
+ File.fnmatch(ignore, file) ||
52
+ File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
53
+ end
54
+ end
55
+
56
+ s.files = unignored_files
57
+ s.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
58
+ s.require_path = 'lib'
59
+ end
@@ -1,42 +1,42 @@
1
- %define gemdir /usr/lib/vagrant-cloudstack/gems
2
- Name: vagrant-cloudstack
3
- Version: %{gemver}
4
- Release: 3%{?dist}
5
- Summary: vagrant cloudstack plugin
6
-
7
- License: MIT
8
- BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
9
-
10
- Source0: vagrant-cloudstack-%{version}.tar.gz
11
- BuildRequires: rubygems
12
- Requires: vagrant >= 1.2.0 libxml2-devel libxslt-devel libffi-devel ruby-devel
13
-
14
- %description
15
- vagrant cloudstack
16
-
17
-
18
- %prep
19
- %setup -q
20
-
21
- %build
22
- env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 bundle package
23
- env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 gem build vagrant-cloudstack.gemspec
24
-
25
-
26
- %install
27
- mkdir -p %{buildroot}/%{gemdir}
28
- cp vagrant-cloudstack-%{version}.gem %{buildroot}/%{gemdir}
29
- cp vendor/cache/*.gem %{buildroot}/%{gemdir}
30
-
31
-
32
- %clean
33
- rm -rf %{buildroot}
34
-
35
-
36
- %post
37
- cd %{gemdir}
38
- gem install --local fog --no-rdoc --no-ri
39
-
40
- %files
41
- %defattr(-,root,root,-)
42
- %{gemdir}
1
+ %define gemdir /usr/lib/vagrant-cloudstack/gems
2
+ Name: vagrant-cloudstack
3
+ Version: %{gemver}
4
+ Release: 3%{?dist}
5
+ Summary: vagrant cloudstack plugin
6
+
7
+ License: MIT
8
+ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
9
+
10
+ Source0: vagrant-cloudstack-%{version}.tar.gz
11
+ BuildRequires: rubygems
12
+ Requires: vagrant >= 1.2.0 libxml2-devel libxslt-devel libffi-devel ruby-devel
13
+
14
+ %description
15
+ vagrant cloudstack
16
+
17
+
18
+ %prep
19
+ %setup -q
20
+
21
+ %build
22
+ env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 bundle package
23
+ env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 gem build vagrant-cloudstack.gemspec
24
+
25
+
26
+ %install
27
+ mkdir -p %{buildroot}/%{gemdir}
28
+ cp vagrant-cloudstack-%{version}.gem %{buildroot}/%{gemdir}
29
+ cp vendor/cache/*.gem %{buildroot}/%{gemdir}
30
+
31
+
32
+ %clean
33
+ rm -rf %{buildroot}
34
+
35
+
36
+ %post
37
+ cd %{gemdir}
38
+ gem install --local fog --no-rdoc --no-ri
39
+
40
+ %files
41
+ %defattr(-,root,root,-)
42
+ %{gemdir}