fission 0.4.0.beta.1 → 0.4.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## 0.4.0
6
6
  * major internal refactoring for usage as a lib
7
+ * add fix for loading a custom vmrun_bin in ~/.fissionrc
7
8
 
8
9
  ## 0.3.0 (09/16/2011)
9
10
  * add ability to suspend all running VMs ('--all')
@@ -18,17 +18,16 @@ module Fission
18
18
  # Returns a new Config instance.
19
19
  def initialize
20
20
  @attributes = {}
21
- load_from_file
22
-
23
- if @attributes['vm_dir'].blank?
24
- @attributes['vm_dir'] = File.expand_path('~/Documents/Virtual Machines.localized/')
25
- end
26
21
 
22
+ @attributes['vm_dir'] = File.expand_path('~/Documents/Virtual Machines.localized/')
27
23
  @attributes['lease_file'] = '/var/db/vmware/vmnet-dhcpd-vmnet8.leases'
28
24
  @attributes['vmrun_bin'] = '/Library/Application Support/VMware Fusion/vmrun'
29
- @attributes['vmrun_cmd'] = "#{@attributes['vmrun_bin'].gsub(' ', '\ ')} -T fusion"
30
25
  @attributes['plist_file'] = File.expand_path('~/Library/Preferences/com.vmware.fusion.plist')
31
26
  @attributes['gui_bin'] = File.expand_path('/Applications/VMware Fusion.app/Contents/MacOS/vmware')
27
+
28
+ load_from_file
29
+
30
+ @attributes['vmrun_cmd'] = "#{@attributes['vmrun_bin'].gsub(' ', '\ ')} -T fusion"
32
31
  end
33
32
 
34
33
  # Public: Helper method to access config atributes. This is a shortcut for
@@ -1,3 +1,3 @@
1
1
  module Fission
2
- VERSION = "0.4.0.beta.1"
2
+ VERSION = "0.4.0.beta.2"
3
3
  end
@@ -2,18 +2,23 @@ require File.expand_path('../../spec_helper.rb', __FILE__)
2
2
 
3
3
  describe Fission::Config do
4
4
  describe "init" do
5
+ before do
6
+ FakeFS.activate!
7
+ end
8
+
9
+ after do
10
+ FakeFS.deactivate!
11
+ FakeFS::FileSystem.clear
12
+ end
13
+
5
14
  it "should use the fusion default dir for vm_dir" do
6
- FakeFS do
7
- @config = Fission::Config.new
8
- @config.attributes['vm_dir'].should == File.expand_path('~/Documents/Virtual Machines.localized/')
9
- end
15
+ @config = Fission::Config.new
16
+ @config.attributes['vm_dir'].should == File.expand_path('~/Documents/Virtual Machines.localized/')
10
17
  end
11
18
 
12
19
  it 'should use the fusion default for vmrun_bin' do
13
- FakeFS do
14
- @config = Fission::Config.new
15
- @config.attributes['vmrun_bin'].should == '/Library/Application Support/VMware Fusion/vmrun'
16
- end
20
+ @config = Fission::Config.new
21
+ @config.attributes['vmrun_bin'].should == '/Library/Application Support/VMware Fusion/vmrun'
17
22
  end
18
23
 
19
24
  it 'should use the fusion default for plist_file' do
@@ -27,19 +32,33 @@ describe Fission::Config do
27
32
  end
28
33
 
29
34
  it "should use the user specified dir in ~/.fissionrc" do
30
- FakeFS do
31
- File.open('~/.fissionrc', 'w') { |f| f.puts YAML.dump({ 'vm_dir' => '/var/tmp/foo' })}
35
+ File.open('~/.fissionrc', 'w') { |f| f.puts YAML.dump({ 'vm_dir' => '/var/tmp/foo' })}
32
36
 
33
- @config = Fission::Config.new
34
- @config.attributes['vm_dir'].should == '/var/tmp/foo'
37
+ @config = Fission::Config.new
38
+ @config.attributes['vm_dir'].should == '/var/tmp/foo'
39
+ end
40
+
41
+ it 'should use the user specified vmrun bin in ~/.fissionrc' do
42
+ File.open('~/.fissionrc', 'w') do |f|
43
+ f.puts YAML.dump({ 'vmrun_bin' => '/var/tmp/vmrun_bin' })
35
44
  end
45
+
46
+ @config = Fission::Config.new
47
+ @config.attributes['vmrun_bin'].should == '/var/tmp/vmrun_bin'
36
48
  end
37
49
 
38
50
  it 'should set vmrun_cmd' do
39
- FakeFS do
40
- @config = Fission::Config.new
41
- @config.attributes['vmrun_cmd'].should == '/Library/Application\ Support/VMware\ Fusion/vmrun -T fusion'
51
+ @config = Fission::Config.new
52
+ @config.attributes['vmrun_cmd'].should == '/Library/Application\ Support/VMware\ Fusion/vmrun -T fusion'
53
+ end
54
+
55
+ it 'should set the vmrun_cmd correctly if there is a user specified vmrun bin' do
56
+ File.open('~/.fissionrc', 'w') do |f|
57
+ f.puts YAML.dump({ 'vmrun_bin' => '/var/tmp/vmrun_bin' })
42
58
  end
59
+
60
+ @config = Fission::Config.new
61
+ @config.attributes['vmrun_cmd'].should == '/var/tmp/vmrun_bin -T fusion'
43
62
  end
44
63
 
45
64
  it 'should use the fusion default lease file' do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: fission
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 0.4.0.beta.1
5
+ version: 0.4.0.beta.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tommy Bishop
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-23 00:00:00 Z
13
+ date: 2011-11-03 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: CFPropertyList