nbt_utils 0.0.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ci.yml +24 -0
- data/.rspec +1 -0
- data/.rubocop.yml +37 -0
- data/.ruby-version +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +49 -4
- data/LICENSE +7 -0
- data/README.md +15 -19
- data/Rakefile +8 -0
- data/lib/nbt_utils/file.rb +14 -15
- data/lib/nbt_utils/tag/byte.rb +4 -1
- data/lib/nbt_utils/tag/byte_array.rb +9 -7
- data/lib/nbt_utils/tag/compound.rb +22 -17
- data/lib/nbt_utils/tag/double.rb +4 -1
- data/lib/nbt_utils/tag/end.rb +6 -4
- data/lib/nbt_utils/tag/exceptions.rb +3 -1
- data/lib/nbt_utils/tag/float.rb +4 -1
- data/lib/nbt_utils/tag/int.rb +4 -1
- data/lib/nbt_utils/tag/int_array.rb +10 -8
- data/lib/nbt_utils/tag/list.rb +20 -15
- data/lib/nbt_utils/tag/long.rb +4 -1
- data/lib/nbt_utils/tag/short.rb +4 -1
- data/lib/nbt_utils/tag/string.rb +2 -0
- data/lib/nbt_utils/tag.rb +11 -12
- data/lib/nbt_utils/tag_name.rb +5 -3
- data/lib/nbt_utils/version.rb +3 -1
- data/lib/nbt_utils.rb +3 -0
- data/nbt_utils.gemspec +17 -11
- data/script.rb +21 -19
- data/spec/nbt_utils/file_spec.rb +60 -0
- data/spec/nbt_utils/tag/byte_array_spec.rb +5 -0
- data/spec/nbt_utils/tag/byte_spec.rb +5 -0
- data/spec/nbt_utils/tag/compound_spec.rb +5 -0
- data/spec/nbt_utils/tag/double_spec.rb +5 -0
- data/spec/nbt_utils/tag/end_spec.rb +5 -0
- data/spec/nbt_utils/tag/float_spec.rb +5 -0
- data/spec/nbt_utils/tag/int_array_spec.rb +5 -0
- data/spec/nbt_utils/tag/int_spec.rb +5 -0
- data/spec/nbt_utils/tag/list_spec.rb +5 -0
- data/spec/nbt_utils/tag/long_spec.rb +5 -0
- data/spec/nbt_utils/tag/short_spec.rb +5 -0
- data/spec/nbt_utils/tag/string_spec.rb +5 -0
- data/spec/nbt_utils/tag_name_spec.rb +20 -0
- data/spec/spec_helper.rb +102 -0
- data/spec/support/shared_examples/a_tag.rb +8 -0
- metadata +75 -11
data/lib/nbt_utils/tag.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module NBTUtils
|
2
4
|
module Tag
|
3
|
-
attr_reader :name
|
4
|
-
attr_reader :payload
|
5
|
+
attr_reader :name, :payload
|
5
6
|
|
6
7
|
def self.included(base)
|
7
8
|
base.extend ClassMethods
|
8
9
|
end
|
9
10
|
|
10
|
-
def initialize(io, named
|
11
|
+
def initialize(io, named: true)
|
11
12
|
read_name(io) if named
|
12
13
|
@payload = self.class.payload_class.new.read(io)
|
13
14
|
end
|
14
|
-
|
15
|
+
|
15
16
|
def type_id
|
16
17
|
self.class.type_id
|
17
18
|
end
|
@@ -22,12 +23,12 @@ module NBTUtils
|
|
22
23
|
|
23
24
|
def to_s(indent = 0)
|
24
25
|
klass = self.class.to_s.split('::').last
|
25
|
-
(' ' * indent) + "TAG_#{klass}#{
|
26
|
+
(' ' * indent) + "TAG_#{klass}#{name ? "(\"#{name}\")" : ''}: #{payload.value}"
|
26
27
|
end
|
27
28
|
|
28
|
-
def to_nbt_string(named
|
29
|
+
def to_nbt_string(named: true)
|
29
30
|
result = named ? binary_type_id + name_to_nbt_string : ''
|
30
|
-
result +
|
31
|
+
result + payload.to_binary_s
|
31
32
|
end
|
32
33
|
|
33
34
|
def read_name(io)
|
@@ -36,7 +37,7 @@ module NBTUtils
|
|
36
37
|
|
37
38
|
def name_to_nbt_string
|
38
39
|
nm = NBTUtils::TagName.new
|
39
|
-
nm.data =
|
40
|
+
nm.data = name
|
40
41
|
nm.to_binary_s
|
41
42
|
end
|
42
43
|
|
@@ -44,8 +45,8 @@ module NBTUtils
|
|
44
45
|
NBTUtils::Tag.tag_type_to_class(tag_type)
|
45
46
|
end
|
46
47
|
|
47
|
-
def set_value(new_value,
|
48
|
-
|
48
|
+
def set_value(new_value, _index = nil)
|
49
|
+
payload.value = new_value
|
49
50
|
end
|
50
51
|
|
51
52
|
module ClassMethods
|
@@ -68,8 +69,6 @@ module NBTUtils
|
|
68
69
|
@tag_types[tag_type.to_i]
|
69
70
|
end
|
70
71
|
|
71
|
-
protected
|
72
|
-
|
73
72
|
def self.add_tag_type(index, tag_type)
|
74
73
|
@tag_types ||= []
|
75
74
|
@tag_types[index] = tag_type
|
data/lib/nbt_utils/tag_name.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module NBTUtils
|
2
4
|
class TagName < ::BinData::Record
|
3
5
|
# Spec says this is a TAG_Short, which is signed. Staying strict
|
4
6
|
# though this may really be unsigned in practice.
|
5
|
-
int16be :len, :
|
6
|
-
string :data, :
|
7
|
+
int16be :len, value: proc { data.length }
|
8
|
+
string :data, read_length: :len
|
7
9
|
|
8
10
|
# things break for some reason if you just call the string :value
|
9
11
|
def value
|
@@ -14,4 +16,4 @@ module NBTUtils
|
|
14
16
|
self.data = (other_value)
|
15
17
|
end
|
16
18
|
end
|
17
|
-
end
|
19
|
+
end
|
data/lib/nbt_utils/version.rb
CHANGED
data/lib/nbt_utils.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'zlib'
|
2
4
|
require 'bindata'
|
3
5
|
|
@@ -17,3 +19,4 @@ require File.expand_path('nbt_utils/tag/byte_array', File.dirname(__FILE__))
|
|
17
19
|
require File.expand_path('nbt_utils/tag/string', File.dirname(__FILE__))
|
18
20
|
require File.expand_path('nbt_utils/tag/list', File.dirname(__FILE__))
|
19
21
|
require File.expand_path('nbt_utils/tag/compound', File.dirname(__FILE__))
|
22
|
+
require File.expand_path('nbt_utils/tag/int_array', File.dirname(__FILE__))
|
data/nbt_utils.gemspec
CHANGED
@@ -1,24 +1,30 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('lib/nbt_utils/version', __dir__)
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
5
|
-
s.name =
|
6
|
+
s.name = 'nbt_utils'
|
6
7
|
s.version = NBTUtils::VERSION
|
7
8
|
s.platform = Gem::Platform::RUBY
|
8
9
|
s.authors = ['Michael Dungan']
|
9
10
|
s.email = ['mpd@jesters-court.net']
|
10
|
-
s.homepage =
|
11
|
-
s.summary =
|
12
|
-
s.description =
|
11
|
+
s.homepage = 'https://github.com/xxx/nbt_utils'
|
12
|
+
s.summary = 'Set of classes to read and write Minecraft .nbt files'
|
13
|
+
s.description = 'Some classes to read and write Minecraft .nbt files. '\
|
14
|
+
'See NBT.txt in the /doc directory for format description.'
|
13
15
|
|
14
|
-
s.required_rubygems_version =
|
16
|
+
s.required_rubygems_version = '>= 1.3.6'
|
15
17
|
|
16
|
-
s.add_dependency
|
17
|
-
s.add_development_dependency
|
18
|
+
s.add_dependency 'bindata', '~> 2'
|
19
|
+
s.add_development_dependency 'rspec', '~> 3'
|
20
|
+
s.add_development_dependency 'rubocop', '~> 1'
|
21
|
+
s.add_development_dependency 'rubocop-performance', '~> 1'
|
22
|
+
s.add_development_dependency 'rubocop-rspec', '~> 2'
|
18
23
|
|
19
|
-
s.required_ruby_version =
|
24
|
+
s.required_ruby_version = '>= 2.7'
|
20
25
|
|
21
26
|
s.files = `git ls-files`.split("\n")
|
22
|
-
s.executables = `git ls-files`.split("\n").
|
27
|
+
s.executables = `git ls-files`.split("\n").filter_map { |f| f =~ %r{^bin/(.*)} ? Regexp.last_match(1) : nil }
|
23
28
|
s.require_path = 'lib'
|
29
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
24
30
|
end
|
data/script.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
1
3
|
# encoding: UTF-8
|
4
|
+
# frozen_string_literal: true
|
2
5
|
|
3
6
|
require 'bundler'
|
4
7
|
Bundler.require :default
|
@@ -8,32 +11,31 @@ require 'zlib'
|
|
8
11
|
|
9
12
|
@compound = nil
|
10
13
|
|
11
|
-
#file = NBTUtils::File.new('doc/test.nbt')
|
12
|
-
|
14
|
+
# file = NBTUtils::File.new('doc/test.nbt')
|
15
|
+
# @compound = file.read
|
13
16
|
#
|
14
|
-
#puts @compound.to_s
|
17
|
+
# puts @compound.to_s
|
15
18
|
#
|
16
|
-
|
17
|
-
#puts @compound.to_s
|
19
|
+
# @compound.update_tag('name', 'asdf')
|
20
|
+
# puts @compound.to_s
|
18
21
|
#
|
19
|
-
|
20
|
-
#puts @compound.to_s
|
21
|
-
|
22
|
-
#puts @compound.to_nbt_string
|
23
|
-
#NBTUtils::File.new.write('biglolwut.nbt', @compound)
|
22
|
+
# @compound.remove_tag('name')
|
23
|
+
# puts @compound.to_s
|
24
24
|
|
25
|
-
|
26
|
-
#
|
25
|
+
# puts @compound.to_nbt_string
|
26
|
+
# NBTUtils::File.new.write('biglolwut.nbt', @compound)
|
27
27
|
|
28
|
+
# @compound = NBTUtils::File.new.read('doc/bigtest.nbt')
|
29
|
+
# puts @compound.to_s
|
28
30
|
|
29
31
|
@compound = NBTUtils::File.new.read('doc/test.mclevel')
|
30
32
|
puts @compound.to_s
|
31
33
|
|
32
|
-
#puts @compound.to_nbt_string
|
33
|
-
#NBTUtils::File.new.write('biglolwut.nbt', @compound)
|
34
|
+
# puts @compound.to_nbt_string
|
35
|
+
# NBTUtils::File.new.write('biglolwut.nbt', @compound)
|
34
36
|
|
35
|
-
#p @compound.find_tag(/Test/)
|
36
|
-
#p @compound.find_tag('Test')
|
37
|
-
#p @compound.find_tag('intTest')
|
38
|
-
#p @compound.find_tags(/(?:byte|int)Test/)
|
39
|
-
#p @compound.find_tags 'intasdf'
|
37
|
+
# p @compound.find_tag(/Test/)
|
38
|
+
# p @compound.find_tag('Test')
|
39
|
+
# p @compound.find_tag('intTest')
|
40
|
+
# p @compound.find_tags(/(?:byte|int)Test/)
|
41
|
+
# p @compound.find_tags 'intasdf'
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe NBTUtils::File do
|
4
|
+
let(:file) { described_class.new(File.expand_path("../../../doc/#{fixture}", __FILE__)) }
|
5
|
+
let(:fixture) { 'test_uncompressed.nbt' }
|
6
|
+
|
7
|
+
describe '#read' do
|
8
|
+
subject(:call) { file.read }
|
9
|
+
|
10
|
+
shared_examples 'reads the file' do
|
11
|
+
it 'reads the file and returns the root tag', :aggregate_failures do
|
12
|
+
expect(call.name).to eq('hello world')
|
13
|
+
expect(call.payload.first.payload.value).to eq('Bananrama')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when the file is not compressed' do
|
18
|
+
let(:fixture) { 'test_uncompressed.nbt' }
|
19
|
+
|
20
|
+
include_examples 'reads the file'
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when the file is compressed' do
|
24
|
+
let(:fixture) { 'test.nbt' }
|
25
|
+
|
26
|
+
include_examples 'reads the file'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#write' do
|
31
|
+
let(:root) { file.read }
|
32
|
+
|
33
|
+
let(:out_path) { "#{__dir__}/write-test.nbt" }
|
34
|
+
|
35
|
+
shared_examples 'writes the file' do
|
36
|
+
it 'writes the file out' do
|
37
|
+
tag = root.payload.first
|
38
|
+
|
39
|
+
file.write(out_path, tag, compressed)
|
40
|
+
|
41
|
+
read_in = described_class.new(out_path).read
|
42
|
+
expect(read_in.payload.value).to eq 'Bananrama'
|
43
|
+
ensure
|
44
|
+
File.delete(out_path) if File.exist?(out_path)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'when the file is not compressed' do
|
49
|
+
let(:compressed) { false }
|
50
|
+
|
51
|
+
include_examples 'writes the file'
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when the file is compressed' do
|
55
|
+
let(:compressed) { true }
|
56
|
+
|
57
|
+
include_examples 'writes the file'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe NBTUtils::TagName do
|
4
|
+
subject(:tag_name) { described_class.new }
|
5
|
+
|
6
|
+
describe '#value' do
|
7
|
+
it 'returns the data value' do
|
8
|
+
expect(tag_name.value).to eq('')
|
9
|
+
tag_name.data = 'foo'
|
10
|
+
expect(tag_name.value).to eq('foo')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#value=' do
|
15
|
+
it 'returns the data value' do
|
16
|
+
tag_name.value = 'marf'
|
17
|
+
expect(tag_name.data).to eq('marf')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'nbt_utils'
|
4
|
+
|
5
|
+
require 'support/shared_examples/a_tag'
|
6
|
+
|
7
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
8
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
9
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
10
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
11
|
+
# files.
|
12
|
+
#
|
13
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
14
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
15
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
16
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
17
|
+
# a separate helper file that requires the additional dependencies and performs
|
18
|
+
# the additional setup, and require it from the spec files that actually need
|
19
|
+
# it.
|
20
|
+
#
|
21
|
+
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
22
|
+
RSpec.configure do |config|
|
23
|
+
# rspec-expectations config goes here. You can use an alternate
|
24
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
25
|
+
# assertions if you prefer.
|
26
|
+
config.expect_with :rspec do |expectations|
|
27
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
28
|
+
# and `failure_message` of custom matchers include text for helper methods
|
29
|
+
# defined using `chain`, e.g.:
|
30
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
31
|
+
# # => "be bigger than 2 and smaller than 4"
|
32
|
+
# ...rather than:
|
33
|
+
# # => "be bigger than 2"
|
34
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
35
|
+
end
|
36
|
+
|
37
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
38
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
39
|
+
config.mock_with :rspec do |mocks|
|
40
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
41
|
+
# a real object. This is generally recommended, and will default to
|
42
|
+
# `true` in RSpec 4.
|
43
|
+
mocks.verify_partial_doubles = true
|
44
|
+
end
|
45
|
+
|
46
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
47
|
+
# have no way to turn it off -- the option exists only for backwards
|
48
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
49
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
50
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
51
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
52
|
+
|
53
|
+
# The settings below are suggested to provide a good initial experience
|
54
|
+
# with RSpec, but feel free to customize to your heart's content.
|
55
|
+
# This allows you to limit a spec run to individual examples or groups
|
56
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
57
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
58
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
59
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
60
|
+
config.filter_run_when_matching :focus
|
61
|
+
|
62
|
+
# Allows RSpec to persist some state between runs in order to support
|
63
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
64
|
+
# you configure your source control system to ignore this file.
|
65
|
+
# config.example_status_persistence_file_path = "spec/examples.txt"
|
66
|
+
|
67
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
68
|
+
# recommended. For more details, see:
|
69
|
+
# https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
|
70
|
+
config.disable_monkey_patching!
|
71
|
+
|
72
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
73
|
+
# be too noisy due to issues in dependencies.
|
74
|
+
config.warnings = true
|
75
|
+
|
76
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
77
|
+
# file, and it's useful to allow more verbose output when running an
|
78
|
+
# individual spec file.
|
79
|
+
if config.files_to_run.one?
|
80
|
+
# Use the documentation formatter for detailed output,
|
81
|
+
# unless a formatter has already been configured
|
82
|
+
# (e.g. via a command-line flag).
|
83
|
+
config.default_formatter = 'doc'
|
84
|
+
end
|
85
|
+
|
86
|
+
# Print the 10 slowest examples and example groups at the
|
87
|
+
# end of the spec run, to help surface which specs are running
|
88
|
+
# particularly slow.
|
89
|
+
config.profile_examples = 10
|
90
|
+
|
91
|
+
# Run specs in random order to surface order dependencies. If you find an
|
92
|
+
# order dependency and want to debug it, you can fix the order by providing
|
93
|
+
# the seed, which is printed after each run.
|
94
|
+
# --seed 1234
|
95
|
+
config.order = :random
|
96
|
+
|
97
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
98
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
99
|
+
# test failures related to randomization by passing the same `--seed` value
|
100
|
+
# as the one that triggered the failure.
|
101
|
+
Kernel.srand config.seed
|
102
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.shared_examples_for 'a tag' do |type_id, payload_class|
|
4
|
+
it 'has the type_id and payload_class', :aggregate_failures do
|
5
|
+
expect(described_class.type_id).to eq(type_id)
|
6
|
+
expect(described_class.payload_class).to eq(payload_class)
|
7
|
+
end
|
8
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nbt_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dungan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -16,16 +16,30 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2'
|
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
|
-
version: '
|
26
|
+
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
@@ -38,17 +52,51 @@ dependencies:
|
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '1'
|
41
|
-
|
42
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-performance
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2'
|
83
|
+
description: Some classes to read and write Minecraft .nbt files. See NBT.txt in the
|
84
|
+
/doc directory for format description.
|
43
85
|
email:
|
44
86
|
- mpd@jesters-court.net
|
45
87
|
executables: []
|
46
88
|
extensions: []
|
47
89
|
extra_rdoc_files: []
|
48
90
|
files:
|
91
|
+
- ".github/dependabot.yml"
|
92
|
+
- ".github/workflows/ci.yml"
|
49
93
|
- ".gitignore"
|
94
|
+
- ".rspec"
|
95
|
+
- ".rubocop.yml"
|
96
|
+
- ".ruby-version"
|
50
97
|
- Gemfile
|
51
98
|
- Gemfile.lock
|
99
|
+
- LICENSE
|
52
100
|
- README.md
|
53
101
|
- Rakefile
|
54
102
|
- doc/NBT.txt
|
@@ -77,9 +125,26 @@ files:
|
|
77
125
|
- lib/nbt_utils/version.rb
|
78
126
|
- nbt_utils.gemspec
|
79
127
|
- script.rb
|
128
|
+
- spec/nbt_utils/file_spec.rb
|
129
|
+
- spec/nbt_utils/tag/byte_array_spec.rb
|
130
|
+
- spec/nbt_utils/tag/byte_spec.rb
|
131
|
+
- spec/nbt_utils/tag/compound_spec.rb
|
132
|
+
- spec/nbt_utils/tag/double_spec.rb
|
133
|
+
- spec/nbt_utils/tag/end_spec.rb
|
134
|
+
- spec/nbt_utils/tag/float_spec.rb
|
135
|
+
- spec/nbt_utils/tag/int_array_spec.rb
|
136
|
+
- spec/nbt_utils/tag/int_spec.rb
|
137
|
+
- spec/nbt_utils/tag/list_spec.rb
|
138
|
+
- spec/nbt_utils/tag/long_spec.rb
|
139
|
+
- spec/nbt_utils/tag/short_spec.rb
|
140
|
+
- spec/nbt_utils/tag/string_spec.rb
|
141
|
+
- spec/nbt_utils/tag_name_spec.rb
|
142
|
+
- spec/spec_helper.rb
|
143
|
+
- spec/support/shared_examples/a_tag.rb
|
80
144
|
homepage: https://github.com/xxx/nbt_utils
|
81
145
|
licenses: []
|
82
|
-
metadata:
|
146
|
+
metadata:
|
147
|
+
rubygems_mfa_required: 'true'
|
83
148
|
post_install_message:
|
84
149
|
rdoc_options: []
|
85
150
|
require_paths:
|
@@ -88,15 +153,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
153
|
requirements:
|
89
154
|
- - ">="
|
90
155
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
156
|
+
version: '2.7'
|
92
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
158
|
requirements:
|
94
159
|
- - ">="
|
95
160
|
- !ruby/object:Gem::Version
|
96
161
|
version: 1.3.6
|
97
162
|
requirements: []
|
98
|
-
|
99
|
-
rubygems_version: 2.2.2
|
163
|
+
rubygems_version: 3.3.7
|
100
164
|
signing_key:
|
101
165
|
specification_version: 4
|
102
166
|
summary: Set of classes to read and write Minecraft .nbt files
|