nbtfile 0.0.3 → 0.0.4
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/Rakefile +8 -8
- data/VERSION +1 -1
- data/spec/nbtfile_spec.rb +2 -1
- data/spec/spec_helper.rb +5 -8
- metadata +23 -11
- data/spec/spec.opts +0 -1
data/Rakefile
CHANGED
|
@@ -10,7 +10,7 @@ begin
|
|
|
10
10
|
gem.email = "mental@rydia.net"
|
|
11
11
|
gem.homepage = "http://github.com/mental/nbtfile"
|
|
12
12
|
gem.authors = ["MenTaLguY"]
|
|
13
|
-
gem.add_development_dependency "rspec", ">=
|
|
13
|
+
gem.add_development_dependency "rspec", ">= 2.0"
|
|
14
14
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
15
15
|
end
|
|
16
16
|
Jeweler::GemcutterTasks.new
|
|
@@ -18,20 +18,20 @@ rescue LoadError
|
|
|
18
18
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
require '
|
|
22
|
-
|
|
23
|
-
spec.
|
|
24
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
|
21
|
+
require 'rspec/core/rake_task'
|
|
22
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
23
|
+
spec.rspec_opts = "--color"
|
|
25
24
|
end
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
spec.
|
|
29
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
|
26
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
|
27
|
+
spec.rspec_opts = "--color"
|
|
30
28
|
spec.rcov = true
|
|
31
29
|
end
|
|
32
30
|
|
|
33
31
|
task :spec => :check_dependencies
|
|
34
32
|
|
|
33
|
+
task :specs => :spec
|
|
34
|
+
|
|
35
35
|
task :default => :spec
|
|
36
36
|
|
|
37
37
|
require 'rake/rdoctask'
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.4
|
data/spec/nbtfile_spec.rb
CHANGED
|
@@ -9,6 +9,7 @@ shared_examples_for "readers and writers" do
|
|
|
9
9
|
|
|
10
10
|
def self.a_reader_or_writer(desc, serialized, tokens)
|
|
11
11
|
it desc do
|
|
12
|
+
serialized._nbtfile_force_encoding("BINARY")
|
|
12
13
|
check_reader_or_writer(serialized, tokens)
|
|
13
14
|
end
|
|
14
15
|
end
|
|
@@ -229,7 +230,7 @@ describe "NBTFile::load" do
|
|
|
229
230
|
|
|
230
231
|
def self.nbtfile_load(description, tokens, result)
|
|
231
232
|
it description do
|
|
232
|
-
io = StringIO.new
|
|
233
|
+
io = StringIO.new()
|
|
233
234
|
NBTFile.emit(io) do |writer|
|
|
234
235
|
for token in tokens
|
|
235
236
|
writer.emit_token(token)
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
3
3
|
require 'nbtfile'
|
|
4
|
-
require '
|
|
5
|
-
require 'spec/autorun'
|
|
6
|
-
|
|
7
|
-
Spec::Runner.configure do |config|
|
|
8
|
-
|
|
9
|
-
end
|
|
4
|
+
require 'rspec'
|
|
10
5
|
|
|
11
6
|
module ZlibHelpers
|
|
12
|
-
|
|
13
7
|
def make_zipped_stream(data)
|
|
14
8
|
gz = Zlib::GzipWriter.new(StringIO.new())
|
|
15
9
|
gz << data
|
|
16
10
|
string = gz.close.string
|
|
11
|
+
string._nbtfile_force_encoding("BINARY")
|
|
17
12
|
StringIO.new(string, "rb")
|
|
18
13
|
end
|
|
19
14
|
|
|
20
15
|
def unzip_string(string)
|
|
21
16
|
gz = Zlib::GzipReader.new(StringIO.new(string))
|
|
22
17
|
begin
|
|
23
|
-
gz.read
|
|
18
|
+
data = gz.read
|
|
19
|
+
data._nbtfile_force_encoding("BINARY")
|
|
20
|
+
data
|
|
24
21
|
ensure
|
|
25
22
|
gz.close
|
|
26
23
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nbtfile
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
4
|
+
prerelease: false
|
|
5
|
+
segments:
|
|
6
|
+
- 0
|
|
7
|
+
- 0
|
|
8
|
+
- 4
|
|
9
|
+
version: 0.0.4
|
|
5
10
|
platform: ruby
|
|
6
11
|
authors:
|
|
7
12
|
- MenTaLguY
|
|
@@ -9,19 +14,23 @@ autorequire:
|
|
|
9
14
|
bindir: bin
|
|
10
15
|
cert_chain: []
|
|
11
16
|
|
|
12
|
-
date: 2010-
|
|
17
|
+
date: 2010-11-03 00:00:00 -07:00
|
|
13
18
|
default_executable:
|
|
14
19
|
dependencies:
|
|
15
20
|
- !ruby/object:Gem::Dependency
|
|
16
21
|
name: rspec
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
prerelease: false
|
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
24
|
+
none: false
|
|
20
25
|
requirements:
|
|
21
26
|
- - ">="
|
|
22
27
|
- !ruby/object:Gem::Version
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
segments:
|
|
29
|
+
- 2
|
|
30
|
+
- 0
|
|
31
|
+
version: "2.0"
|
|
32
|
+
type: :development
|
|
33
|
+
version_requirements: *id001
|
|
25
34
|
description: Library for reading and writing NBT files (as used by Minecraft).
|
|
26
35
|
email: mental@rydia.net
|
|
27
36
|
executables: []
|
|
@@ -44,7 +53,6 @@ files:
|
|
|
44
53
|
- samples/test.nbt
|
|
45
54
|
- spec/nbtfile_spec.rb
|
|
46
55
|
- spec/roundtrip_spec.rb
|
|
47
|
-
- spec/spec.opts
|
|
48
56
|
- spec/spec_helper.rb
|
|
49
57
|
has_rdoc: true
|
|
50
58
|
homepage: http://github.com/mental/nbtfile
|
|
@@ -56,21 +64,25 @@ rdoc_options:
|
|
|
56
64
|
require_paths:
|
|
57
65
|
- lib
|
|
58
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
|
+
none: false
|
|
59
68
|
requirements:
|
|
60
69
|
- - ">="
|
|
61
70
|
- !ruby/object:Gem::Version
|
|
71
|
+
segments:
|
|
72
|
+
- 0
|
|
62
73
|
version: "0"
|
|
63
|
-
version:
|
|
64
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
|
+
none: false
|
|
65
76
|
requirements:
|
|
66
77
|
- - ">="
|
|
67
78
|
- !ruby/object:Gem::Version
|
|
79
|
+
segments:
|
|
80
|
+
- 0
|
|
68
81
|
version: "0"
|
|
69
|
-
version:
|
|
70
82
|
requirements: []
|
|
71
83
|
|
|
72
84
|
rubyforge_project:
|
|
73
|
-
rubygems_version: 1.3.
|
|
85
|
+
rubygems_version: 1.3.7
|
|
74
86
|
signing_key:
|
|
75
87
|
specification_version: 3
|
|
76
88
|
summary: nbtfile provides a low-level API for reading and writing files using Minecraft's NBT serialization format
|
data/spec/spec.opts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color
|