derelict 0.3.2.travis.103 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- M2VmYWU5YjVlMjA2YWRhNmUxOTQ2NGIxMmFjOGEwMDhlMzIyYTNkNw==
5
- data.tar.gz: !binary |-
6
- ZjY5ZWJiOWIxYTJkY2E2MjhkYjFjM2FlMWE3ZjNhZGEzNjdlY2EzYw==
2
+ SHA1:
3
+ metadata.gz: bfc02801827e68ed5766c8bc35b4f17c92f859ba
4
+ data.tar.gz: eb39154f9af6555187daa4f6e4dcbdc0fbad650e
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YTJhZWQ0NjZkOWViNzZmYWZmMWRmOTYzN2ZjZGM0NzkwYmIwNTZkNjZhZGQy
10
- YzMwN2I2MjE4M2U0MDE1MGQ2NWYwZjU5ZmMxNGVkZTQzYmQyNzAzMTUyZDEw
11
- OTlhMDE4ZWE1YmZlMTI0NWNjNDZhNDczM2FkMzIyM2FjMDNlOWY=
12
- data.tar.gz: !binary |-
13
- ZTgwOTZhYmYwOGFiYjY0ZWQ1OGI0NDZjNWY4YTlhNDU1YzRkYmE3ZjE5NDM5
14
- MGI2OTY2YTFiY2YwNGI4YWViMmVhZjUzNWFiZDllZmU1ZTRlNTNlMTkzNGM0
15
- MGVkYWEzMzhhOTA0ZjU0NGI0ZjlhZGYyZThjMjE1NzQyMzQ1MWU=
6
+ metadata.gz: f6b151b555c36ae9f611676bfc8d83d934deef4d498d3a6d7a00a605823e262d72313ce251d3a4d9f696070e69d2b3d14ad1782ff72212f9c0771ebf4b97b042
7
+ data.tar.gz: 3e15fcf1ccd00ef822c114a62cb0018bdcd7cfcc2fea7dce2562fe967c0a019895379f29c80af3b30e44ca99d892af88b58bc06fb65db60614f6279d5c6290e4
@@ -59,12 +59,18 @@ module Derelict
59
59
  # * subcommand: Vagrant subcommand to run (:up, :status, etc.)
60
60
  # * arguments: Arguments to pass to the subcommand (optional)
61
61
  # * options: If the last argument is a Hash, it will be used
62
- # as a hash of options to pass through to
63
- # Shell.execute
62
+ # as a hash of options. A list of valid options is
63
+ # below. Any options provided that aren't in the
64
+ # list of valid options will get passed through to
65
+ # Shell.execute (from the "shell-executer" gem).
66
+ # Valid option keys:
67
+ # * sudo: Whether to run the command as root, or not
68
+ # (defaults to false)
64
69
  # * block: Passed through to Shell.execute (shell-executer)
65
70
  def execute(subcommand, *arguments, &block)
66
71
  options = arguments.last.is_a?(Hash) ? arguments.pop : Hash.new
67
72
  command = command(subcommand, *arguments)
73
+ command = "sudo -- #{command}" if options.delete(:sudo)
68
74
  logger.debug "Executing #{command} using #{description}"
69
75
  Shell.execute command, options, &block
70
76
  end
@@ -1,3 +1,3 @@
1
1
  module Derelict
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -166,9 +166,9 @@ describe Derelict::Instance do
166
166
  end
167
167
 
168
168
  context "with mock Shell" do
169
+ let(:expected_command) { "/foo/bar/bin/vagrant test arg\\ 1" }
169
170
  before do
170
- cmd = "/foo/bar/bin/vagrant test arg\\ 1"
171
- expect(Shell).to receive(:execute).with(cmd, options).and_return(result)
171
+ expect(Shell).to receive(:execute).with(expected_command, options).and_return(result)
172
172
  end
173
173
 
174
174
  let(:options) { Hash.new }
@@ -199,7 +199,17 @@ describe Derelict::Instance do
199
199
 
200
200
  context "with options hash" do
201
201
  let(:options) { {:foo => :bar} }
202
- subject { instance.execute :test, "arg 1", :foo => :bar }
202
+ subject { instance.execute :test, "arg 1", options }
203
+ its(:stdout) { should eq "stdout\n" }
204
+ its(:stderr) { should eq "stderr\n" }
205
+ its(:success?) { should be success }
206
+ end
207
+
208
+ context "with :sudo option enabled" do
209
+ let(:options_argument) { {:sudo => true} }
210
+ let(:options) { Hash.new } # Don't pass sudo opt to Shell.execute
211
+ let(:expected_command) { "sudo -- /foo/bar/bin/vagrant test arg\\ 1" }
212
+ subject { instance.execute :test, "arg 1", options_argument }
203
213
  its(:stdout) { should eq "stdout\n" }
204
214
  its(:stderr) { should eq "stderr\n" }
205
215
  its(:success?) { should be success }
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derelict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.travis.103
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Feehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-27 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log4r
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: memoist
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: shell-executer
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -70,84 +70,84 @@ dependencies:
70
70
  name: cane
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: coveralls
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: its
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - '>='
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
@@ -164,16 +164,10 @@ dependencies:
164
164
  - - <
165
165
  - !ruby/object:Gem::Version
166
166
  version: '2.0'
167
- description: ! 'Provides a Ruby API to control Vagrant where Vagrant is installed
168
- via the Installer package on Mac OS X.
167
+ description: |-
168
+ Provides a Ruby API to control Vagrant where Vagrant is installed via the Installer package on Mac OS X.
169
169
 
170
-
171
- Vagrant was historically available as a gem, naturally providing a Ruby API to control
172
- Vagrant in other Ruby libraries and applications. However, since version 1.1.0,
173
- Vagrant is distributed exclusively using an Installer package. To control Vagrant
174
- when it''s installed this way, other Ruby libraries and applications typically need
175
- to invoke the Vagrant binary, which requires forking a new process and parsing its
176
- output using string manipulation.'
170
+ Vagrant was historically available as a gem, naturally providing a Ruby API to control Vagrant in other Ruby libraries and applications. However, since version 1.1.0, Vagrant is distributed exclusively using an Installer package. To control Vagrant when it's installed this way, other Ruby libraries and applications typically need to invoke the Vagrant binary, which requires forking a new process and parsing its output using string manipulation.
177
171
  email:
178
172
  - git@bradfeehan.com
179
173
  executables: []
@@ -272,17 +266,17 @@ require_paths:
272
266
  - lib
273
267
  required_ruby_version: !ruby/object:Gem::Requirement
274
268
  requirements:
275
- - - ! '>='
269
+ - - '>='
276
270
  - !ruby/object:Gem::Version
277
271
  version: '0'
278
272
  required_rubygems_version: !ruby/object:Gem::Requirement
279
273
  requirements:
280
- - - ! '>'
274
+ - - '>='
281
275
  - !ruby/object:Gem::Version
282
- version: 1.3.1
276
+ version: '0'
283
277
  requirements: []
284
278
  rubyforge_project:
285
- rubygems_version: 2.1.11
279
+ rubygems_version: 2.0.3
286
280
  signing_key:
287
281
  specification_version: 4
288
282
  summary: Ruby API for Vagrant installed via Installer package on Mac OS X.