lxc 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ class LXC
8
8
  # @author Zachary Patten <zachary@jovelabs.net>
9
9
  class Config
10
10
 
11
- attr_accessor :networks
11
+ attr_accessor :networks, :filename
12
12
 
13
13
  def initialize(lxc, filename)
14
14
  raise ConfigError, "You must supply a LXC object!" if lxc.nil?
@@ -202,6 +202,22 @@ class LXC
202
202
  @lxc.exists?(self.name)
203
203
  end
204
204
 
205
+ # Run an application inside a container
206
+ #
207
+ # Launches the container, executing the supplied application inside it.
208
+ #
209
+ # @see lxc-execute
210
+ def execute(*args)
211
+ self.exec("lxc-execute", "-f", self.config.filename, "--", *args)
212
+ end
213
+
214
+ # Launch a console for the container
215
+ #
216
+ # @see lxc-console
217
+ def console
218
+ self.exec("lxc-console")
219
+ end
220
+
205
221
  # Wait for a specific container state
206
222
  #
207
223
  # Runs the "lxc-wait" command.
@@ -244,7 +260,7 @@ class LXC
244
260
  def exec(*args)
245
261
  arguments = Array.new
246
262
  arguments << args.shift
247
- arguments << %(--name=#{self.name})
263
+ arguments << %(-n #{self.name})
248
264
  arguments << args
249
265
  arguments.flatten!.compact!
250
266
 
@@ -2,7 +2,7 @@ class LXC
2
2
 
3
3
  unless const_defined?(:VERSION)
4
4
  # LXC Gem Version
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
 
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lxc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-27 00:00:00.000000000 Z
12
+ date: 2013-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ztk
@@ -182,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  segments:
184
184
  - 0
185
- hash: 574706320060241310
185
+ hash: -2074872461255389873
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: 574706320060241310
194
+ hash: -2074872461255389873
195
195
  requirements: []
196
196
  rubyforge_project:
197
197
  rubygems_version: 1.8.25