jbangert-bindata 1.5.0
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.
- data/.gitignore +1 -0
- data/BSDL +22 -0
- data/COPYING +52 -0
- data/ChangeLog.rdoc +204 -0
- data/Gemfile +2 -0
- data/INSTALL +11 -0
- data/NEWS.rdoc +164 -0
- data/README.md +54 -0
- data/Rakefile +13 -0
- data/bindata.gemspec +31 -0
- data/doc/manual.haml +407 -0
- data/doc/manual.md +1649 -0
- data/examples/NBT.txt +149 -0
- data/examples/gzip.rb +161 -0
- data/examples/ip_address.rb +22 -0
- data/examples/list.rb +124 -0
- data/examples/nbt.rb +178 -0
- data/lib/bindata.rb +33 -0
- data/lib/bindata/alignment.rb +83 -0
- data/lib/bindata/array.rb +335 -0
- data/lib/bindata/base.rb +388 -0
- data/lib/bindata/base_primitive.rb +214 -0
- data/lib/bindata/bits.rb +87 -0
- data/lib/bindata/choice.rb +216 -0
- data/lib/bindata/count_bytes_remaining.rb +35 -0
- data/lib/bindata/deprecated.rb +50 -0
- data/lib/bindata/dsl.rb +312 -0
- data/lib/bindata/float.rb +80 -0
- data/lib/bindata/int.rb +184 -0
- data/lib/bindata/io.rb +274 -0
- data/lib/bindata/lazy.rb +105 -0
- data/lib/bindata/offset.rb +91 -0
- data/lib/bindata/params.rb +135 -0
- data/lib/bindata/primitive.rb +135 -0
- data/lib/bindata/record.rb +110 -0
- data/lib/bindata/registry.rb +92 -0
- data/lib/bindata/rest.rb +35 -0
- data/lib/bindata/sanitize.rb +290 -0
- data/lib/bindata/skip.rb +48 -0
- data/lib/bindata/string.rb +145 -0
- data/lib/bindata/stringz.rb +96 -0
- data/lib/bindata/struct.rb +388 -0
- data/lib/bindata/trace.rb +94 -0
- data/lib/bindata/version.rb +3 -0
- data/setup.rb +1585 -0
- data/spec/alignment_spec.rb +61 -0
- data/spec/array_spec.rb +331 -0
- data/spec/base_primitive_spec.rb +238 -0
- data/spec/base_spec.rb +376 -0
- data/spec/bits_spec.rb +163 -0
- data/spec/choice_spec.rb +263 -0
- data/spec/count_bytes_remaining_spec.rb +38 -0
- data/spec/deprecated_spec.rb +31 -0
- data/spec/example.rb +21 -0
- data/spec/float_spec.rb +37 -0
- data/spec/int_spec.rb +216 -0
- data/spec/io_spec.rb +352 -0
- data/spec/lazy_spec.rb +217 -0
- data/spec/primitive_spec.rb +202 -0
- data/spec/record_spec.rb +530 -0
- data/spec/registry_spec.rb +108 -0
- data/spec/rest_spec.rb +26 -0
- data/spec/skip_spec.rb +27 -0
- data/spec/spec_common.rb +58 -0
- data/spec/string_spec.rb +300 -0
- data/spec/stringz_spec.rb +118 -0
- data/spec/struct_spec.rb +350 -0
- data/spec/system_spec.rb +380 -0
- data/tasks/manual.rake +36 -0
- data/tasks/rspec.rake +17 -0
- metadata +208 -0
data/spec/system_spec.rb
ADDED
@@ -0,0 +1,380 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "spec_common"))
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "example"))
|
5
|
+
require 'bindata'
|
6
|
+
|
7
|
+
describe "lambdas with index" do
|
8
|
+
class NestedLambdaWithIndex < BinData::Record
|
9
|
+
uint8 :a, :value => lambda { index * 10 }
|
10
|
+
end
|
11
|
+
|
12
|
+
it "uses index of containing array" do
|
13
|
+
arr = BinData::Array.new(:type =>
|
14
|
+
[:uint8, { :value => lambda { index * 10 } }],
|
15
|
+
:initial_length => 3)
|
16
|
+
arr.snapshot.should == [0, 10, 20]
|
17
|
+
end
|
18
|
+
|
19
|
+
it "uses index of nearest containing array" do
|
20
|
+
arr = BinData::Array.new(:type => :nested_lambda_with_index,
|
21
|
+
:initial_length => 3)
|
22
|
+
arr.snapshot.should == [{"a" => 0}, {"a" => 10}, {"a" => 20}]
|
23
|
+
end
|
24
|
+
|
25
|
+
it "fails if there is no containing array" do
|
26
|
+
subject = NestedLambdaWithIndex.new
|
27
|
+
expect { subject.a.to_s }.to raise_error(NoMethodError)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "lambdas with parent" do
|
32
|
+
it "accesses immediate parent when no parent is specified" do
|
33
|
+
class NestedLambdaWithoutParent < BinData::Record
|
34
|
+
int8 :a, :value => 5
|
35
|
+
int8 :b, :value => lambda { a }
|
36
|
+
end
|
37
|
+
|
38
|
+
class TestLambdaWithoutParent < BinData::Record
|
39
|
+
int8 :a, :value => 3
|
40
|
+
nested_lambda_without_parent :x
|
41
|
+
end
|
42
|
+
|
43
|
+
subject = TestLambdaWithoutParent.new
|
44
|
+
subject.x.b.should == 5
|
45
|
+
end
|
46
|
+
|
47
|
+
it "accesses parent's parent when parent is specified" do
|
48
|
+
class NestedLambdaWithParent < BinData::Record
|
49
|
+
int8 :a, :value => 5
|
50
|
+
int8 :b, :value => lambda { parent.a }
|
51
|
+
end
|
52
|
+
|
53
|
+
class TestLambdaWithParent < BinData::Record
|
54
|
+
int8 :a, :value => 3
|
55
|
+
nested_lambda_with_parent :x
|
56
|
+
end
|
57
|
+
|
58
|
+
subject = TestLambdaWithParent.new
|
59
|
+
subject.x.b.should == 3
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe BinData::Record, "with choice field" do
|
64
|
+
class TupleRecord < BinData::Record
|
65
|
+
uint8 :a, :value => 3
|
66
|
+
uint8 :b, :value => 5
|
67
|
+
end
|
68
|
+
|
69
|
+
class RecordWithChoiceField < BinData::Record
|
70
|
+
choice :x, :selection => 0 do
|
71
|
+
tuple_record
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class RecordWithNestedChoiceField < BinData::Record
|
76
|
+
uint8 :sel, :value => 0
|
77
|
+
choice :x, :selection => 0 do
|
78
|
+
choice :selection => :sel do
|
79
|
+
tuple_record
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
it "treats choice object transparently " do
|
85
|
+
subject = RecordWithChoiceField.new
|
86
|
+
|
87
|
+
subject.x.a.should == 3
|
88
|
+
end
|
89
|
+
|
90
|
+
it "treats nested choice object transparently " do
|
91
|
+
subject = RecordWithNestedChoiceField.new
|
92
|
+
|
93
|
+
subject.x.a.should == 3
|
94
|
+
end
|
95
|
+
|
96
|
+
it "has correct offset" do
|
97
|
+
subject = RecordWithNestedChoiceField.new
|
98
|
+
subject.x.b.offset.should == 2
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe BinData::Array, "of bits" do
|
103
|
+
let(:data) { BinData::Array.new(:type => :bit1, :initial_length => 15) }
|
104
|
+
|
105
|
+
it "reads" do
|
106
|
+
str = [0b0001_0100, 0b1000_1000].pack("CC")
|
107
|
+
data.read(str)
|
108
|
+
data[0].should == 0
|
109
|
+
data[1].should == 0
|
110
|
+
data[2].should == 0
|
111
|
+
data[3].should == 1
|
112
|
+
data[4].should == 0
|
113
|
+
data[5].should == 1
|
114
|
+
data[6].should == 0
|
115
|
+
data[7].should == 0
|
116
|
+
data[8].should == 1
|
117
|
+
data[9].should == 0
|
118
|
+
data[10].should == 0
|
119
|
+
data[11].should == 0
|
120
|
+
data[12].should == 1
|
121
|
+
data[13].should == 0
|
122
|
+
data[14].should == 0
|
123
|
+
end
|
124
|
+
|
125
|
+
it "writes" do
|
126
|
+
data[3] = 1
|
127
|
+
data.to_binary_s.should == [0b0001_0000, 0b0000_0000].pack("CC")
|
128
|
+
end
|
129
|
+
|
130
|
+
it "returns num_bytes" do
|
131
|
+
data.num_bytes.should == 2
|
132
|
+
end
|
133
|
+
|
134
|
+
it "has correct offset" do
|
135
|
+
data[7].offset.should == 0
|
136
|
+
data[8].offset.should == 1
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe BinData::Record, "containing bitfields" do
|
141
|
+
class BCD < BinData::Primitive
|
142
|
+
bit4 :d1
|
143
|
+
bit4 :d2
|
144
|
+
bit4 :d3
|
145
|
+
|
146
|
+
def set(v)
|
147
|
+
self.d1 = (v / 100) % 10
|
148
|
+
self.d2 = (v / 10) % 10
|
149
|
+
self.d3 = v % 10
|
150
|
+
end
|
151
|
+
|
152
|
+
def get()
|
153
|
+
d1 * 100 + d2 * 10 + d3
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
class BitfieldRecord < BinData::Record
|
158
|
+
struct :a do
|
159
|
+
bit4 :w
|
160
|
+
end
|
161
|
+
|
162
|
+
array :b, :type => :bit1, :initial_length => 9
|
163
|
+
|
164
|
+
struct :c do
|
165
|
+
bit2 :x
|
166
|
+
end
|
167
|
+
|
168
|
+
bcd :d
|
169
|
+
bit6 :e
|
170
|
+
end
|
171
|
+
|
172
|
+
subject { BitfieldRecord.new }
|
173
|
+
|
174
|
+
it "has correct num_bytes" do
|
175
|
+
subject.num_bytes.should == 5
|
176
|
+
end
|
177
|
+
|
178
|
+
it "reads across bitfield boundaries" do
|
179
|
+
subject.read [0b0111_0010, 0b0110_0101, 0b0010_1010, 0b1000_0101, 0b1000_0000].pack("CCCCC")
|
180
|
+
|
181
|
+
subject.a.w.should == 7
|
182
|
+
subject.b.should == [0, 0, 1, 0, 0, 1, 1, 0, 0]
|
183
|
+
subject.c.x.should == 2
|
184
|
+
subject.d.should == 954
|
185
|
+
subject.e.should == 11
|
186
|
+
end
|
187
|
+
|
188
|
+
it "writes across bitfield boundaries" do
|
189
|
+
subject.a.w = 3
|
190
|
+
subject.b[2] = 1
|
191
|
+
subject.b[5] = 1
|
192
|
+
subject.c.x = 1
|
193
|
+
subject.d = 850
|
194
|
+
subject.e = 35
|
195
|
+
subject.to_binary_s.should == [0b0011_0010, 0b0100_0011, 0b0000_1010, 0b0001_0001, 0b1000_0000].pack("CCCCC")
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
describe "Objects with debug_name" do
|
200
|
+
it "haves default name of obj" do
|
201
|
+
el = ExampleSingle.new
|
202
|
+
el.debug_name.should == "obj"
|
203
|
+
end
|
204
|
+
|
205
|
+
it "includes array index" do
|
206
|
+
arr = BinData::Array.new(:type => :example_single, :initial_length => 2)
|
207
|
+
arr[2].debug_name.should == "obj[2]"
|
208
|
+
end
|
209
|
+
|
210
|
+
it "includes field name" do
|
211
|
+
s = BinData::Struct.new(:fields => [[:example_single, :a]])
|
212
|
+
s.a.debug_name.should == "obj.a"
|
213
|
+
end
|
214
|
+
|
215
|
+
it "delegates to choice" do
|
216
|
+
choice_params = {:choices => [:example_single], :selection => 0}
|
217
|
+
s = BinData::Struct.new(:fields => [[:choice, :a, choice_params]])
|
218
|
+
s.a.debug_name.should == "obj.a"
|
219
|
+
end
|
220
|
+
|
221
|
+
it "nests" do
|
222
|
+
nested_struct_params = {:fields => [[:example_single, :c]]}
|
223
|
+
struct_params = {:fields => [[:struct, :b, nested_struct_params]]}
|
224
|
+
s = BinData::Struct.new(:fields => [[:struct, :a, struct_params]])
|
225
|
+
s.a.b.c.debug_name.should == "obj.a.b.c"
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
describe "Tracing" do
|
230
|
+
it "should trace arrays" do
|
231
|
+
arr = BinData::Array.new(:type => :int8, :initial_length => 5)
|
232
|
+
|
233
|
+
io = StringIO.new
|
234
|
+
BinData::trace_reading(io) { arr.read("\x01\x02\x03\x04\x05") }
|
235
|
+
|
236
|
+
expected = (0..4).collect { |i| "obj[#{i}] => #{i + 1}\n" }.join("")
|
237
|
+
io.value.should == expected
|
238
|
+
end
|
239
|
+
|
240
|
+
it "traces custom single values" do
|
241
|
+
class DebugNamePrimitive < BinData::Primitive
|
242
|
+
int8 :ex
|
243
|
+
def get; self.ex; end
|
244
|
+
def set(val) self.ex = val; end
|
245
|
+
end
|
246
|
+
|
247
|
+
subject = DebugNamePrimitive.new
|
248
|
+
|
249
|
+
io = StringIO.new
|
250
|
+
BinData::trace_reading(io) { subject.read("\x01") }
|
251
|
+
|
252
|
+
io.value.should == ["obj-internal-.ex => 1\n", "obj => 1\n"].join("")
|
253
|
+
end
|
254
|
+
|
255
|
+
it "traces choice selection" do
|
256
|
+
subject = BinData::Choice.new(:choices => [:int8, :int16be], :selection => 0)
|
257
|
+
|
258
|
+
io = StringIO.new
|
259
|
+
BinData::trace_reading(io) { subject.read("\x01") }
|
260
|
+
|
261
|
+
io.value.should == ["obj-selection- => 0\n", "obj => 1\n"].join("")
|
262
|
+
end
|
263
|
+
|
264
|
+
it "trims long trace values" do
|
265
|
+
subject = BinData::String.new(:read_length => 40)
|
266
|
+
|
267
|
+
io = StringIO.new
|
268
|
+
BinData::trace_reading(io) { subject.read("0000000000111111111122222222223333333333") }
|
269
|
+
|
270
|
+
io.value.should == "obj => \"000000000011111111112222222222...\n"
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
describe "Forward referencing with Primitive" do
|
275
|
+
class FRPrimitive < BinData::Record
|
276
|
+
uint8 :len, :value => lambda { data.length }
|
277
|
+
string :data, :read_length => :len
|
278
|
+
end
|
279
|
+
|
280
|
+
subject { FRPrimitive.new }
|
281
|
+
|
282
|
+
it "initialises" do
|
283
|
+
subject.snapshot.should == {"len" => 0, "data" => ""}
|
284
|
+
end
|
285
|
+
|
286
|
+
it "reads" do
|
287
|
+
subject.read("\x04test")
|
288
|
+
subject.snapshot.should == {"len" => 4, "data" => "test"}
|
289
|
+
end
|
290
|
+
|
291
|
+
it "sets value" do
|
292
|
+
subject.data = "hello"
|
293
|
+
subject.snapshot.should == {"len" => 5, "data" => "hello"}
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
describe "Forward referencing with Array" do
|
298
|
+
class FRArray < BinData::Record
|
299
|
+
uint8 :len, :value => lambda { data.length }
|
300
|
+
array :data, :type => :uint8, :initial_length => :len
|
301
|
+
end
|
302
|
+
|
303
|
+
subject { FRArray.new }
|
304
|
+
|
305
|
+
it "initialises" do
|
306
|
+
subject.snapshot.should == {"len" => 0, "data" => []}
|
307
|
+
end
|
308
|
+
|
309
|
+
it "reads" do
|
310
|
+
subject.read("\x04\x01\x02\x03\x04")
|
311
|
+
subject.snapshot.should == {"len" => 4, "data" => [1, 2, 3, 4]}
|
312
|
+
end
|
313
|
+
|
314
|
+
it "sets value" do
|
315
|
+
subject.data = [1, 2, 3]
|
316
|
+
subject.snapshot.should == {"len" => 3, "data" => [1, 2, 3]}
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
describe "Evaluating custom parameters" do
|
321
|
+
class CustomParameterRecord < BinData::Record
|
322
|
+
mandatory_parameter :zz
|
323
|
+
|
324
|
+
uint8 :a, :value => :zz
|
325
|
+
uint8 :b, :value => :a
|
326
|
+
uint8 :c, :custom => :b
|
327
|
+
end
|
328
|
+
|
329
|
+
it "recursively evaluates parameter" do
|
330
|
+
subject = CustomParameterRecord.new(:zz => 5)
|
331
|
+
subject.c.eval_parameter(:custom).should == 5
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
describe BinData::Record, "with custom sized integers" do
|
336
|
+
class CustomIntRecord < BinData::Record
|
337
|
+
int40be :a
|
338
|
+
end
|
339
|
+
|
340
|
+
it "reads as expected" do
|
341
|
+
str = "\x00\x00\x00\x00\x05"
|
342
|
+
CustomIntRecord.read(str).should == {"a" => 5}
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
describe BinData::Record, "with choice field" do
|
347
|
+
class ChoiceFieldRecord < BinData::Record
|
348
|
+
int8 :a
|
349
|
+
choice :b, :selection => :a do
|
350
|
+
struct 1, :fields => [[:int8, :v]]
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
it "assigns" do
|
355
|
+
subject = BinData::Array.new(:type => :choice_field_record)
|
356
|
+
obj = ChoiceFieldRecord.new(:a => 1, :b => {:v => 3})
|
357
|
+
subject.assign([obj])
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
describe BinData::Primitive, "representing a string" do
|
362
|
+
class PascalStringPrimitive < BinData::Primitive
|
363
|
+
uint8 :len, :value => lambda { data.length }
|
364
|
+
string :data, :read_length => :len
|
365
|
+
|
366
|
+
def get; self.data; end
|
367
|
+
def set(v) self.data = v; end
|
368
|
+
end
|
369
|
+
|
370
|
+
subject { PascalStringPrimitive.new("testing") }
|
371
|
+
|
372
|
+
it "compares to regexp" do
|
373
|
+
(subject =~ /es/).should == 1
|
374
|
+
end
|
375
|
+
|
376
|
+
it "compares to regexp" do
|
377
|
+
(/es/ =~ subject).should == 1
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
data/tasks/manual.rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
load_failed = false
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'haml'
|
5
|
+
rescue LoadError
|
6
|
+
puts "Haml must be installed to build documentation"
|
7
|
+
load_failed = true
|
8
|
+
end
|
9
|
+
|
10
|
+
begin
|
11
|
+
require 'maruku'
|
12
|
+
rescue LoadError
|
13
|
+
puts "Maruku must be installed to build documentation"
|
14
|
+
load_failed = true
|
15
|
+
end
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'syntax'
|
19
|
+
rescue LoadError
|
20
|
+
puts "Syntax must be installed to build documentation"
|
21
|
+
load_failed = true
|
22
|
+
end
|
23
|
+
|
24
|
+
unless load_failed
|
25
|
+
file "doc/manual.html" => ["doc/manual.md", "doc/manual.haml"] do |t|
|
26
|
+
require 'haml/exec'
|
27
|
+
|
28
|
+
opts = Haml::Exec::Haml.new(["doc/manual.haml", "doc/manual.html"])
|
29
|
+
opts.parse!
|
30
|
+
end
|
31
|
+
|
32
|
+
CLOBBER.include("doc/manual.html")
|
33
|
+
|
34
|
+
desc "Build the reference manual"
|
35
|
+
task :manual => "doc/manual.html"
|
36
|
+
end
|
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
begin
|
2
|
+
require 'rspec'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new("spec") do |t|
|
6
|
+
# t.ruby_opts = "-w"
|
7
|
+
t.rcov = false
|
8
|
+
t.pattern = 'spec/**/*_spec.rb' #.exclude("spec/deprecated_spec.rb", "spec/wrapper_spec.rb")
|
9
|
+
end
|
10
|
+
|
11
|
+
RSpec::Core::RakeTask.new("rcov") do |t|
|
12
|
+
t.ruby_opts = "-w"
|
13
|
+
t.rcov = true
|
14
|
+
end
|
15
|
+
rescue LoadError
|
16
|
+
puts "Rspec must be installed to run tests"
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jbangert-bindata
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.5.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dion Mendel
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.10.0
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.10.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: haml
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - <
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 4.0.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - <
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 4.0.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: maruku
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: syntax
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
description: ! 'BinData is a declarative way to read and write binary file formats.
|
95
|
+
|
96
|
+
|
97
|
+
This means the programmer specifies *what* the format of the binary
|
98
|
+
|
99
|
+
data is, and BinData works out *how* to read and write data in this
|
100
|
+
|
101
|
+
format. It is an easier ( and more readable ) alternative to
|
102
|
+
|
103
|
+
ruby''s #pack and #unpack methods.
|
104
|
+
|
105
|
+
'
|
106
|
+
email: dion@lostrealm.com
|
107
|
+
executables: []
|
108
|
+
extensions: []
|
109
|
+
extra_rdoc_files:
|
110
|
+
- NEWS.rdoc
|
111
|
+
files:
|
112
|
+
- .gitignore
|
113
|
+
- BSDL
|
114
|
+
- COPYING
|
115
|
+
- ChangeLog.rdoc
|
116
|
+
- Gemfile
|
117
|
+
- INSTALL
|
118
|
+
- NEWS.rdoc
|
119
|
+
- README.md
|
120
|
+
- Rakefile
|
121
|
+
- bindata.gemspec
|
122
|
+
- doc/manual.haml
|
123
|
+
- doc/manual.md
|
124
|
+
- examples/NBT.txt
|
125
|
+
- examples/gzip.rb
|
126
|
+
- examples/ip_address.rb
|
127
|
+
- examples/list.rb
|
128
|
+
- examples/nbt.rb
|
129
|
+
- lib/bindata.rb
|
130
|
+
- lib/bindata/alignment.rb
|
131
|
+
- lib/bindata/array.rb
|
132
|
+
- lib/bindata/base.rb
|
133
|
+
- lib/bindata/base_primitive.rb
|
134
|
+
- lib/bindata/bits.rb
|
135
|
+
- lib/bindata/choice.rb
|
136
|
+
- lib/bindata/count_bytes_remaining.rb
|
137
|
+
- lib/bindata/deprecated.rb
|
138
|
+
- lib/bindata/dsl.rb
|
139
|
+
- lib/bindata/float.rb
|
140
|
+
- lib/bindata/int.rb
|
141
|
+
- lib/bindata/io.rb
|
142
|
+
- lib/bindata/lazy.rb
|
143
|
+
- lib/bindata/offset.rb
|
144
|
+
- lib/bindata/params.rb
|
145
|
+
- lib/bindata/primitive.rb
|
146
|
+
- lib/bindata/record.rb
|
147
|
+
- lib/bindata/registry.rb
|
148
|
+
- lib/bindata/rest.rb
|
149
|
+
- lib/bindata/sanitize.rb
|
150
|
+
- lib/bindata/skip.rb
|
151
|
+
- lib/bindata/string.rb
|
152
|
+
- lib/bindata/stringz.rb
|
153
|
+
- lib/bindata/struct.rb
|
154
|
+
- lib/bindata/trace.rb
|
155
|
+
- lib/bindata/version.rb
|
156
|
+
- setup.rb
|
157
|
+
- spec/alignment_spec.rb
|
158
|
+
- spec/array_spec.rb
|
159
|
+
- spec/base_primitive_spec.rb
|
160
|
+
- spec/base_spec.rb
|
161
|
+
- spec/bits_spec.rb
|
162
|
+
- spec/choice_spec.rb
|
163
|
+
- spec/count_bytes_remaining_spec.rb
|
164
|
+
- spec/deprecated_spec.rb
|
165
|
+
- spec/example.rb
|
166
|
+
- spec/float_spec.rb
|
167
|
+
- spec/int_spec.rb
|
168
|
+
- spec/io_spec.rb
|
169
|
+
- spec/lazy_spec.rb
|
170
|
+
- spec/primitive_spec.rb
|
171
|
+
- spec/record_spec.rb
|
172
|
+
- spec/registry_spec.rb
|
173
|
+
- spec/rest_spec.rb
|
174
|
+
- spec/skip_spec.rb
|
175
|
+
- spec/spec_common.rb
|
176
|
+
- spec/string_spec.rb
|
177
|
+
- spec/stringz_spec.rb
|
178
|
+
- spec/struct_spec.rb
|
179
|
+
- spec/system_spec.rb
|
180
|
+
- tasks/manual.rake
|
181
|
+
- tasks/rspec.rake
|
182
|
+
homepage: http://github.com/jbangert/bindata
|
183
|
+
licenses: []
|
184
|
+
post_install_message:
|
185
|
+
rdoc_options:
|
186
|
+
- --main
|
187
|
+
- NEWS.rdoc
|
188
|
+
require_paths:
|
189
|
+
- lib
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
+
none: false
|
192
|
+
requirements:
|
193
|
+
- - ! '>='
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: '0'
|
196
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
198
|
+
requirements:
|
199
|
+
- - ! '>='
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
requirements: []
|
203
|
+
rubyforge_project:
|
204
|
+
rubygems_version: 1.8.23
|
205
|
+
signing_key:
|
206
|
+
specification_version: 3
|
207
|
+
summary: A declarative way to read and write binary file formats
|
208
|
+
test_files: []
|