vagrant-exec 0.3.0 → 0.3.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fdf97359b08da7aecc1cec47589bf02aaa36d376
4
+ data.tar.gz: af4fed40dc6b5ca851aec0a382a58c4fc8457943
5
+ SHA512:
6
+ metadata.gz: 834d0241290326ca7fa9a458956ff1e2a748ea1b48919c8a0f1ae6197e554c299d3de2c58cd0e0745048d7ca125e74d2a2b57847ab5d280e8a633744eaac290f
7
+ data.tar.gz: 990ed319f29140ec6e523552dd770e5f3a2514ea4938889918e13f76126b0e2d94879fcce5d247f810fdfc656862bab1406aa5f1b894d4b16ee680d9afcdf870
@@ -3,6 +3,6 @@ Then(/^SHH subprocess should execute command "(.+)"$/) do |command|
3
3
  ssh += %w(-o DSAAuthentication=yes -o LogLevel=FATAL)
4
4
  ssh += %w(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null)
5
5
  ssh += %W(-o IdentitiesOnly=yes -i #{Dir.home}/.vagrant.d/insecure_private_key)
6
- ssh += ['-q', '-t', "bash -l -c '#{command.delete('"')} --'"]
6
+ ssh += ['-q', '-t', "bash -l -c '#{command.delete('"')}'"]
7
7
  assert_partial_output("Executing SSH in subprocess: #{ssh}", all_output)
8
8
  end
@@ -1,3 +1,7 @@
1
+ unless `bundle exec vagrant box list`.include?('vagrant_exec')
2
+ raise 'Box is not added! Run "rake features:bootstrap".'
3
+ end
4
+
1
5
  require 'aruba/cucumber'
2
6
  ENV['VAGRANT_LOG'] = 'info'
3
7
 
@@ -12,7 +12,8 @@ Feature: vagrant-exec
12
12
  Background:
13
13
  Given I write to "Vagrantfile" with:
14
14
  """
15
- Vagrant.require_plugin 'vagrant-exec'
15
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
16
+ require 'vagrant-exec'
16
17
 
17
18
  Vagrant.configure('2') do |config|
18
19
  config.vm.box = 'vagrant_exec'
@@ -52,7 +53,8 @@ Feature: vagrant-exec
52
53
  Scenario: can use custom root
53
54
  Given I overwrite "Vagrantfile" with:
54
55
  """
55
- Vagrant.require_plugin 'vagrant-exec'
56
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
57
+ require 'vagrant-exec'
56
58
 
57
59
  Vagrant.configure('2') do |config|
58
60
  config.vm.box = 'vagrant_exec'
@@ -67,7 +69,8 @@ Feature: vagrant-exec
67
69
  Scenario: raises error if root is improperly set
68
70
  Given I overwrite "Vagrantfile" with:
69
71
  """
70
- Vagrant.require_plugin 'vagrant-exec'
72
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
73
+ require 'vagrant-exec'
71
74
 
72
75
  Vagrant.configure('2') do |config|
73
76
  config.vm.box = 'vagrant_exec'
@@ -81,7 +84,8 @@ Feature: vagrant-exec
81
84
  Scenario: can prepend all commands
82
85
  Given I overwrite "Vagrantfile" with:
83
86
  """
84
- Vagrant.require_plugin 'vagrant-exec'
87
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
88
+ require 'vagrant-exec'
85
89
 
86
90
  Vagrant.configure('2') do |config|
87
91
  config.vm.box = 'vagrant_exec'
@@ -96,7 +100,8 @@ Feature: vagrant-exec
96
100
  Scenario: can prepend only specific commands
97
101
  Given I overwrite "Vagrantfile" with:
98
102
  """
99
- Vagrant.require_plugin 'vagrant-exec'
103
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
104
+ require 'vagrant-exec'
100
105
 
101
106
  Vagrant.configure('2') do |config|
102
107
  config.vm.box = 'vagrant_exec'
@@ -114,7 +119,8 @@ Feature: vagrant-exec
114
119
  Scenario: can use prepend multiple times
115
120
  Given I overwrite "Vagrantfile" with:
116
121
  """
117
- Vagrant.require_plugin 'vagrant-exec'
122
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
123
+ require 'vagrant-exec'
118
124
 
119
125
  Vagrant.configure('2') do |config|
120
126
  config.vm.box = 'vagrant_exec'
@@ -131,22 +137,23 @@ Feature: vagrant-exec
131
137
  Scenario: raises error if prepend command is improperly set
132
138
  Given I overwrite "Vagrantfile" with:
133
139
  """
134
- Vagrant.require_plugin 'vagrant-exec'
140
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
141
+ require 'vagrant-exec'
135
142
 
136
143
  Vagrant.configure('2') do |config|
137
144
  config.vm.box = 'vagrant_exec'
138
145
  config.exec.prepend_with :test
139
146
  end
140
147
  """
141
- Given I set vagrant-exec prepend with :test for all commands
142
- And I run `bundle exec vagrant up`
148
+ When I run `bundle exec vagrant up`
143
149
  Then the exit status should not be 0
144
150
  And the output should contain "prepend_with command should be a string"
145
151
 
146
152
  Scenario: raises error if prepend only is improperly set
147
153
  Given I overwrite "Vagrantfile" with:
148
154
  """
149
- Vagrant.require_plugin 'vagrant-exec'
155
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
156
+ require 'vagrant-exec'
150
157
 
151
158
  Vagrant.configure('2') do |config|
152
159
  config.vm.box = 'vagrant_exec'
@@ -160,7 +167,8 @@ Feature: vagrant-exec
160
167
  Scenario: can export environment variables
161
168
  Given I overwrite "Vagrantfile" with:
162
169
  """
163
- Vagrant.require_plugin 'vagrant-exec'
170
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
171
+ require 'vagrant-exec'
164
172
 
165
173
  Vagrant.configure('2') do |config|
166
174
  config.vm.box = 'vagrant_exec'
@@ -14,7 +14,8 @@ module VagrantPlugins
14
14
  with_target_vms(nil, single_target: true) do |vm|
15
15
  vm.config.exec.finalize! # TODO: do we have to call it explicitly?
16
16
 
17
- plain = "#{cmd} " << cmd_args.join(' ')
17
+ plain = cmd.dup
18
+ plain << ' ' << cmd_args.join(' ') unless cmd_args.empty?
18
19
 
19
20
  command = "cd #{vm.config.exec.root} && "
20
21
  command << add_env(vm.config.exec.env)
@@ -51,6 +52,10 @@ module VagrantPlugins
51
52
  return nil
52
53
  end
53
54
 
55
+ # remove "--" arg which is added by Vagrant
56
+ # https://github.com/p0deje/vagrant-exec/issues/2
57
+ cmd_args.delete_if { |a| a == '--' }
58
+
54
59
  return cmd, cmd_args
55
60
  end
56
61
 
@@ -1,7 +1,7 @@
1
1
  module VagrantPlugins
2
2
  module Exec
3
3
 
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
 
6
6
  end # Exec
7
7
  end # VagrantPlugins
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-exec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.3.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alex Rodionov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-19 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: aruba
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: Vagrant plugin to execute commands within the context of VM synced folder
@@ -65,33 +60,26 @@ files:
65
60
  homepage: http://github.com/p0deje/vagrant-exec
66
61
  licenses:
67
62
  - MIT
63
+ metadata: {}
68
64
  post_install_message:
69
65
  rdoc_options: []
70
66
  require_paths:
71
67
  - lib
72
68
  required_ruby_version: !ruby/object:Gem::Requirement
73
- none: false
74
69
  requirements:
75
- - - ! '>='
70
+ - - ">="
76
71
  - !ruby/object:Gem::Version
77
72
  version: '0'
78
- segments:
79
- - 0
80
- hash: -1851522929754547545
81
73
  required_rubygems_version: !ruby/object:Gem::Requirement
82
- none: false
83
74
  requirements:
84
- - - ! '>='
75
+ - - ">="
85
76
  - !ruby/object:Gem::Version
86
77
  version: '0'
87
- segments:
88
- - 0
89
- hash: -1851522929754547545
90
78
  requirements: []
91
79
  rubyforge_project:
92
- rubygems_version: 1.8.23
80
+ rubygems_version: 2.2.0
93
81
  signing_key:
94
- specification_version: 3
82
+ specification_version: 4
95
83
  summary: Execute commands in Vagrant synced folder
96
84
  test_files:
97
85
  - features/step_definitions/steps.rb