vagrant-exec 0.5.1 → 0.5.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -0
- data/Rakefile +12 -2
- data/features/vagrant-exec/binstubs.feature +16 -1
- data/lib/vagrant-exec/command.rb +4 -4
- data/lib/vagrant-exec/config.rb +5 -0
- data/lib/vagrant-exec/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: 5bd02c0d6a36ea13959a4d3b4b421cab17987605
|
4
|
+
data.tar.gz: c0dd85f24425414ecc9c2b89b9a0c274cfc1361d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98b33e5c4f625631abb58d8a4295f16a60da65aa886947040862fc3d7801cc822e48f33485bfa8285108b0a8dc85d718dc75b93c421d941a986ec97ef84147bf
|
7
|
+
data.tar.gz: 6ac4df97bc193fdcefb118c93f7b3fd28d74d6441382306e58c07ce81aa9ab6b7d62a2ac8324980dd7f354c771348c4825f27fa31acaaf203ca8a2a965c04042
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -143,6 +143,15 @@ To make plain SSH work, it saves current SSH configuration of Vagrant to tempora
|
|
143
143
|
|
144
144
|
Moving forward, you can use projects like [direnv](https://github.com/zimbatm/direnv) to add `bin/` to `PATH` and completely forget that you have VM running.
|
145
145
|
|
146
|
+
It is also possible to configure binstubs directory (e.g. default `bin/` collides with Rails binstubs):
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
Vagrant.configure('2') do |config|
|
150
|
+
config.vm.box = 'precise32'
|
151
|
+
config.exec.binstubs_path = 'vbin'
|
152
|
+
end
|
153
|
+
```
|
154
|
+
|
146
155
|
Testing
|
147
156
|
----------------
|
148
157
|
|
data/Rakefile
CHANGED
@@ -14,7 +14,17 @@ namespace :features do
|
|
14
14
|
|
15
15
|
desc 'Removes testing vagrant box.'
|
16
16
|
task(:cleanup) do
|
17
|
-
system('bundle exec vagrant
|
18
|
-
|
17
|
+
system('bundle exec vagrant box remove --force vagrant_exec')
|
18
|
+
|
19
|
+
# For some reason, vagrant destroy ID fails for us
|
20
|
+
# so let's just stick to pure VirtualBox
|
21
|
+
|
22
|
+
`VBoxManage list vms`
|
23
|
+
.split("\n")
|
24
|
+
.select { |line| line =~ /aruba_(default|vagrant)/ }
|
25
|
+
.map { |line| line.match(/\{([\w-]+)\}/)[1] }
|
26
|
+
.each { |uuid| system("VBoxManage unregistervm #{uuid} -delete") }
|
27
|
+
|
28
|
+
system('bundle exec vagrant global-status --prune')
|
19
29
|
end
|
20
30
|
end
|
@@ -88,6 +88,21 @@ Feature: vagrant-exec binstubs
|
|
88
88
|
|
89
89
|
"""
|
90
90
|
|
91
|
+
Scenario: respects configured binstubs directory
|
92
|
+
Given I write to "Vagrantfile" with:
|
93
|
+
"""
|
94
|
+
Vagrant.configure('2') do |config|
|
95
|
+
config.vm.box = 'vagrant_exec'
|
96
|
+
config.exec.binstubs_path = 'vbin'
|
97
|
+
config.exec.commands 'test'
|
98
|
+
end
|
99
|
+
"""
|
100
|
+
And I run `bundle exec vagrant up`
|
101
|
+
When I run `bundle exec vagrant exec --binstubs`
|
102
|
+
Then the output should contain "Generated binstub for test in vbin/test."
|
103
|
+
And a file named "vbin/test" should exist
|
104
|
+
But a file named "bin/test" should not exist
|
105
|
+
|
91
106
|
Scenario: escapes double-quotes in command
|
92
107
|
Given I write to "Vagrantfile" with:
|
93
108
|
"""
|
@@ -130,7 +145,7 @@ Feature: vagrant-exec binstubs
|
|
130
145
|
Then the exit status should be 0
|
131
146
|
And the output should contain "No commands to generate binstubs for."
|
132
147
|
|
133
|
-
Scenario: raises if vagrant is not
|
148
|
+
Scenario: raises if vagrant is not up
|
134
149
|
Given I write to "Vagrantfile" with:
|
135
150
|
"""
|
136
151
|
Vagrant.configure('2') do |config|
|
data/lib/vagrant-exec/command.rb
CHANGED
@@ -86,23 +86,23 @@ module VagrantPlugins
|
|
86
86
|
}
|
87
87
|
end
|
88
88
|
|
89
|
-
|
89
|
+
binstubs_path = vm.config.exec.binstubs_path
|
90
|
+
Dir.mkdir(binstubs_path) unless Dir.exist?(binstubs_path)
|
90
91
|
|
91
|
-
Dir.mkdir('bin') unless Dir.exist?('bin')
|
92
92
|
explicit.each do |command|
|
93
93
|
command[:constructed].gsub!('"', '\"') # escape double-quotes
|
94
94
|
|
95
95
|
variables = {
|
96
96
|
ssh_host: vm.name || 'default',
|
97
97
|
ssh_config: SSH_CONFIG,
|
98
|
-
shell: shell,
|
98
|
+
shell: vm.config.ssh.shell,
|
99
99
|
command: command[:constructed],
|
100
100
|
}
|
101
101
|
variables.merge!(template_root: "#{File.dirname(__FILE__)}/templates")
|
102
102
|
|
103
103
|
binstub = Vagrant::Util::TemplateRenderer.render('binstub', variables)
|
104
104
|
|
105
|
-
filename =
|
105
|
+
filename = [binstubs_path, command[:command]].join('/')
|
106
106
|
File.open(filename, 'w') { |file| file.write binstub }
|
107
107
|
File.chmod(0755, filename)
|
108
108
|
|
data/lib/vagrant-exec/config.rb
CHANGED
@@ -9,7 +9,10 @@ module VagrantPlugins
|
|
9
9
|
}
|
10
10
|
}.freeze
|
11
11
|
|
12
|
+
attr_accessor :binstubs_path
|
13
|
+
|
12
14
|
def initialize
|
15
|
+
@binstubs_path = UNSET_VALUE
|
13
16
|
@commands = UNSET_VALUE
|
14
17
|
end
|
15
18
|
|
@@ -65,6 +68,8 @@ module VagrantPlugins
|
|
65
68
|
end
|
66
69
|
|
67
70
|
def finalize!
|
71
|
+
@binstubs_path = 'bin' if @binstubs_path == UNSET_VALUE
|
72
|
+
|
68
73
|
if @commands == UNSET_VALUE
|
69
74
|
@commands = [DEFAULT_SETTINGS.dup]
|
70
75
|
else
|
data/lib/vagrant-exec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-exec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|