vhd 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +6 -14
  2. data/lib/vhd/library.rb +10 -2
  3. data/lib/vhd/version.rb +1 -1
  4. metadata +7 -7
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NTBlMjI2MjFlMGFkNWZlODViODg5ZGJmYjIxYmMwN2JjYzg5ZTRlNQ==
5
- data.tar.gz: !binary |-
6
- NWU1N2VmNGU0Mjc4MDc4NmMyYWNlZjliYWE1ODQ2ZmQ5ZjUyMGU1ZQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YTMzOTdiNWZkMThjYmRhZGExODZhMmE0OTA1MTM4Yzg3YTFjMzk2OGRmYTc4
10
- MWY5YTcxMDI1N2MzZGUyODYyNGU5YzUyNjg4NzhhNmZmNjgzMGU2YjhiNGYx
11
- MzdkOGU4NzI1MjY3MmQ3ZTdkYzkzZjAwODkwY2I0YmE5ODA4MTY=
12
- data.tar.gz: !binary |-
13
- YjY0YTRkMzAzNzMyYzkyMzM4NjBkNWFhZDNlNzU1OTk3ZTNmN2Q0MGJlNmMw
14
- ZTUyMTZlMzIyYjFlN2IyNGEyZjYwZGQzNzU3MjQwMzkxODgwMDI0MmUwMjA2
15
- MDkwN2U4N2U0MjY5MjUxMzkwOWQ5YjRjOThhMWI0NmZkMDVjY2M=
2
+ SHA1:
3
+ metadata.gz: 889a6ffc580c0ed317abc2fdde2dd74ee9017f13
4
+ data.tar.gz: d2b4008bd3dc5351f83812162f9b79c6e2005d31
5
+ SHA512:
6
+ metadata.gz: f104c747e252362d638f25e76ad71fd0b61f3e20799acf27b07e0d9ddfbf3c9e564e9a5f20e503816dd09afb0eac599d0495b7384e1bd6b4e92e7a4ba5b23e7e
7
+ data.tar.gz: 5610586bf4f902232b6c7f93adff88c50618372a8ccbef94d7d8f5f1293b131c7d487e791fbba8e5940fd884b223a8056ce1097f38f950f8591730d198b32a3f
@@ -18,6 +18,14 @@ class Vhd::Library
18
18
  File.open(@name, "wb") { |f| f.print @footer.values.join }
19
19
  end
20
20
 
21
+ def create_fixed_disk
22
+ File.open(@name, "wb") do |f|
23
+ f.truncate(size_in_bytes + 512)
24
+ f.seek(size_in_bytes)
25
+ f.write(@footer.values.join)
26
+ end
27
+ end
28
+
21
29
  def generate_footer(options={})
22
30
  @footer[:cookie] = "conectix".force_encoding("BINARY")
23
31
  @footer[:features] = ["00000002"].pack("H*")
@@ -71,7 +79,7 @@ class Vhd::Library
71
79
 
72
80
  cylinders = (total_sectors / sectors_per_track) / heads_per_cylinder
73
81
 
74
- @footer[:geometry] = [cylinders, heads_per_cylinder, sectors_per_track].pack("SCC")
82
+ @footer[:geometry] = [cylinders, heads_per_cylinder, sectors_per_track].pack("nCC")
75
83
  end
76
84
 
77
85
  def checksum
@@ -83,6 +91,6 @@ class Vhd::Library
83
91
  checksum += v.codepoints.inject(0) { |r,c| r += c }
84
92
  end
85
93
 
86
- @footer[:checksum] = ["%08x" % ((~checksum).abs ^ 0xFFFFFFFF)].pack("H*")
94
+ @footer[:checksum] = ["%08x" % ((~checksum) & 0xFFFFFFFF)].pack("H*")
87
95
  end
88
96
  end
@@ -1,3 +1,3 @@
1
1
  module Vhd
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vhd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Howe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bit-struct
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
  description: ''
@@ -51,17 +51,17 @@ require_paths:
51
51
  - lib
52
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.0.7
64
+ rubygems_version: 2.2.2
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: ''