Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare for file writing. update to work with ruby 1.9.2. No longer w…
…orks with 1.8, and won't in the future.
- Loading branch information
mpd
committed
Sep 22, 2010
1 parent
be40da7
commit 8caf25d
Showing
12 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ def to_s(indent = 0) | |
'' | ||
end | ||
|
||
def to_nbt_string | ||
def to_nbt_string(named = true) | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
require 'bundler' | ||
Bundler.require :default | ||
|
||
require 'lib/nbt' | ||
require File.expand_path('./lib/nbt', File.dirname(__FILE__)) | ||
require 'zlib' | ||
|
||
# Strangely, both test files have an extra null at the end of them, which would be a | ||
# separate TAG_End if it were allowed. | ||
|
||
@compound = nil | ||
|
||
#Zlib::GzipReader.open('test.nbt') do |f| | ||
# # ostensibly this will always be a single TAG_Compound, per the spec | ||
# last_byte = f.read(1)[0] | ||
# klass = NBT::Tag.tag_type_to_class(last_byte) | ||
# | ||
# @compound = klass.new(f, true) | ||
#end | ||
# | ||
#puts @compound.to_s | ||
#puts | ||
Zlib::GzipReader.open('doc/test.nbt') do |f| | ||
# ostensibly this will always be a single TAG_Compound, per the spec | ||
last_byte = f.read(1).bytes.first | ||
klass = NBT::Tag.tag_type_to_class(last_byte) | ||
|
||
@compound = klass.new(f, true) | ||
end | ||
|
||
puts @compound.to_s | ||
puts | ||
|
||
Zlib::GzipReader.open('doc/bigtest.nbt') do |f| | ||
# ostensibly this will always be a single TAG_Compound, per the spec | ||
last_byte = f.read(1)[0] | ||
last_byte = f.read(1).bytes.first | ||
klass = NBT::Tag.tag_type_to_class(last_byte) | ||
|
||
@compound = klass.new(f, true) | ||
end | ||
|
||
puts @compound.to_s | ||
|
||
#puts @compound.find_tag('Test') | ||
puts @compound.find_tag('Test') | ||
puts @compound.find_tags(/(?:byte|int)Test/) | ||
puts @compound.find_tags 'intasdf' |