nbtfile 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/nbtfile.rb +1 -4
- data/spec/nbtfile_spec.rb +3 -5
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/lib/nbtfile.rb
CHANGED
@@ -21,8 +21,6 @@
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
23
|
|
24
|
-
# encoding: UTF-8
|
25
|
-
|
26
24
|
require 'zlib'
|
27
25
|
require 'stringio'
|
28
26
|
|
@@ -563,8 +561,7 @@ def self.load(io)
|
|
563
561
|
end
|
564
562
|
end
|
565
563
|
|
566
|
-
|
567
|
-
{'name' => pair.first, 'body' => pair.last}
|
564
|
+
root.first
|
568
565
|
end
|
569
566
|
|
570
567
|
end
|
data/spec/nbtfile_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
-
|
4
2
|
require 'enumerator'
|
5
3
|
require 'nbtfile'
|
6
4
|
require 'stringio'
|
@@ -270,7 +268,7 @@ describe "NBTFile::load" do
|
|
270
268
|
Tokens::TAG_Byte["a", 19],
|
271
269
|
Tokens::TAG_Byte["b", 23],
|
272
270
|
Tokens::TAG_End[nil, nil]],
|
273
|
-
|
271
|
+
["foo", {"a" => 19, "b" => 23}]
|
274
272
|
|
275
273
|
nbtfile_load "should map compound structures to hashes",
|
276
274
|
[Tokens::TAG_Compound["foo", nil],
|
@@ -279,7 +277,7 @@ describe "NBTFile::load" do
|
|
279
277
|
Tokens::TAG_Byte["b", 56],
|
280
278
|
Tokens::TAG_End[nil, nil],
|
281
279
|
Tokens::TAG_End[nil, nil]],
|
282
|
-
|
280
|
+
["foo", {"bar" => {"a" => 123, "b" => 56}}]
|
283
281
|
|
284
282
|
nbtfile_load "should map lists to arrays",
|
285
283
|
[Tokens::TAG_Compound["foo", nil],
|
@@ -288,5 +286,5 @@ describe "NBTFile::load" do
|
|
288
286
|
Tokens::TAG_Byte[1, 45],
|
289
287
|
Tokens::TAG_End[2, nil],
|
290
288
|
Tokens::TAG_End["", nil]],
|
291
|
-
|
289
|
+
["foo", {"bar" => [32, 45]}]
|
292
290
|
end
|