id3tag 0.5.4 → 0.6.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.
- checksums.yaml +4 -4
- data/.gitignore +50 -0
- data/.travis.yml +4 -4
- data/Gemfile +2 -8
- data/Gemfile.lock +19 -49
- data/README.md +9 -0
- data/Rakefile +3 -29
- data/id3tag.gemspec +18 -129
- data/lib/id3tag.rb +7 -0
- data/lib/id3tag/configuration.rb +9 -0
- data/lib/id3tag/frames/v2/text_frame.rb +1 -1
- data/lib/id3tag/version.rb +3 -0
- data/spec/lib/id3tag/frames/v2/text_frame_spec.rb +18 -0
- metadata +63 -24
- data/VERSION +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 520a63e5917a644637384f486a1e142a30df2089
|
|
4
|
+
data.tar.gz: 7475177d8f920f5fc05db1a12b0d74bbaeeb964f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c51ffcecb546f642557fdf31e4c1f0a1a2d79cbf74fb20271b1a492b64ee51e1cb4596ac7d1e45c989cadd7561f989c0d478c659b48d2275139f7e645161fdfe
|
|
7
|
+
data.tar.gz: e5a00fe77748a311c1d4a6d5514a2dac9eb54d7f16fb0891af3fc3bfd7b66b89b1a7312e313108dce27bc5b770451a9e898a1dbea1f5cd175b050216b1b2746d
|
data/.gitignore
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# rcov generated
|
|
2
|
+
coverage
|
|
3
|
+
coverage.data
|
|
4
|
+
|
|
5
|
+
# rdoc generated
|
|
6
|
+
rdoc
|
|
7
|
+
|
|
8
|
+
# yard generated
|
|
9
|
+
doc
|
|
10
|
+
.yardoc
|
|
11
|
+
|
|
12
|
+
# bundler
|
|
13
|
+
.bundle
|
|
14
|
+
|
|
15
|
+
# jeweler generated
|
|
16
|
+
pkg
|
|
17
|
+
tags
|
|
18
|
+
|
|
19
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
|
20
|
+
#
|
|
21
|
+
# * Create a file at ~/.gitignore
|
|
22
|
+
# * Include files you want ignored
|
|
23
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
|
24
|
+
#
|
|
25
|
+
# After doing this, these files will be ignored in all your git projects,
|
|
26
|
+
# saving you from having to 'pollute' every project you touch with them
|
|
27
|
+
#
|
|
28
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
|
29
|
+
#
|
|
30
|
+
# For MacOS:
|
|
31
|
+
#
|
|
32
|
+
#.DS_Store
|
|
33
|
+
|
|
34
|
+
# For TextMate
|
|
35
|
+
#*.tmproj
|
|
36
|
+
#tmtags
|
|
37
|
+
|
|
38
|
+
# For emacs:
|
|
39
|
+
#*~
|
|
40
|
+
#\#*
|
|
41
|
+
#.\#*
|
|
42
|
+
|
|
43
|
+
# For vim:
|
|
44
|
+
#*.swp
|
|
45
|
+
|
|
46
|
+
# For redcar:
|
|
47
|
+
#.redcar
|
|
48
|
+
|
|
49
|
+
# For rubinius:
|
|
50
|
+
#*.rbc
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
source "http://rubygems.org"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
gem "rake"
|
|
6
|
-
gem "rdoc", "~> 3.12"
|
|
7
|
-
gem "rspec", "~> 2.13.0"
|
|
8
|
-
gem "simplecov", :require => false
|
|
9
|
-
gem 'coveralls', :require => false
|
|
10
|
-
end
|
|
3
|
+
# Specify your gem's dependencies in id3tag.gemspec
|
|
4
|
+
gemspec
|
data/Gemfile.lock
CHANGED
|
@@ -1,56 +1,24 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
id3tag (0.6.0)
|
|
5
|
+
|
|
1
6
|
GEM
|
|
2
7
|
remote: http://rubygems.org/
|
|
3
8
|
specs:
|
|
4
|
-
addressable (2.3.5)
|
|
5
|
-
builder (3.2.2)
|
|
6
9
|
coveralls (0.7.0)
|
|
7
10
|
multi_json (~> 1.3)
|
|
8
11
|
rest-client
|
|
9
12
|
simplecov (>= 0.7)
|
|
10
13
|
term-ansicolor
|
|
11
14
|
thor
|
|
12
|
-
diff-lcs (1.2.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
addressable
|
|
18
|
-
faraday (~> 0.8.1)
|
|
19
|
-
hashie (>= 1.2)
|
|
20
|
-
multi_json (~> 1.4)
|
|
21
|
-
nokogiri (~> 1.5.2)
|
|
22
|
-
oauth2
|
|
23
|
-
hashie (2.0.5)
|
|
24
|
-
highline (1.6.19)
|
|
25
|
-
httpauth (0.2.0)
|
|
26
|
-
jeweler (1.8.8)
|
|
27
|
-
builder
|
|
28
|
-
bundler (~> 1.0)
|
|
29
|
-
git (>= 1.2.5)
|
|
30
|
-
github_api (= 0.10.1)
|
|
31
|
-
highline (>= 1.6.15)
|
|
32
|
-
nokogiri (= 1.5.10)
|
|
33
|
-
rake
|
|
34
|
-
rdoc
|
|
35
|
-
json (1.8.0)
|
|
36
|
-
json (1.8.0-java)
|
|
37
|
-
jwt (0.1.8)
|
|
38
|
-
multi_json (>= 1.5)
|
|
39
|
-
mime-types (1.25)
|
|
15
|
+
diff-lcs (1.2.5)
|
|
16
|
+
docile (1.1.1)
|
|
17
|
+
json (1.8.1)
|
|
18
|
+
json (1.8.1-java)
|
|
19
|
+
mime-types (2.0)
|
|
40
20
|
multi_json (1.8.2)
|
|
41
|
-
|
|
42
|
-
multipart-post (1.2.0)
|
|
43
|
-
nokogiri (1.5.10)
|
|
44
|
-
nokogiri (1.5.10-java)
|
|
45
|
-
oauth2 (0.9.2)
|
|
46
|
-
faraday (~> 0.8)
|
|
47
|
-
httpauth (~> 0.2)
|
|
48
|
-
jwt (~> 0.1.4)
|
|
49
|
-
multi_json (~> 1.0)
|
|
50
|
-
multi_xml (~> 0.5)
|
|
51
|
-
rack (~> 1.2)
|
|
52
|
-
rack (1.5.2)
|
|
53
|
-
rake (10.1.0)
|
|
21
|
+
rake (10.1.1)
|
|
54
22
|
rdoc (3.12.2)
|
|
55
23
|
json (~> 1.4)
|
|
56
24
|
rest-client (1.6.7)
|
|
@@ -63,22 +31,24 @@ GEM
|
|
|
63
31
|
rspec-expectations (2.13.0)
|
|
64
32
|
diff-lcs (>= 1.1.3, < 2.0)
|
|
65
33
|
rspec-mocks (2.13.1)
|
|
66
|
-
simplecov (0.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
34
|
+
simplecov (0.8.2)
|
|
35
|
+
docile (~> 1.1.0)
|
|
36
|
+
multi_json
|
|
37
|
+
simplecov-html (~> 0.8.0)
|
|
38
|
+
simplecov-html (0.8.0)
|
|
70
39
|
term-ansicolor (1.2.2)
|
|
71
40
|
tins (~> 0.8)
|
|
72
41
|
thor (0.18.1)
|
|
73
|
-
tins (0.
|
|
42
|
+
tins (0.13.1)
|
|
74
43
|
|
|
75
44
|
PLATFORMS
|
|
76
45
|
java
|
|
77
46
|
ruby
|
|
78
47
|
|
|
79
48
|
DEPENDENCIES
|
|
49
|
+
bundler (~> 1.3)
|
|
80
50
|
coveralls
|
|
81
|
-
|
|
51
|
+
id3tag!
|
|
82
52
|
rake
|
|
83
53
|
rdoc (~> 3.12)
|
|
84
54
|
rspec (~> 2.13.0)
|
data/README.md
CHANGED
|
@@ -58,6 +58,15 @@ ID3Tag.read(file,:v2) # Reads only v2.x tag
|
|
|
58
58
|
|
|
59
59
|
You can inspect tag by calling `frame_ids` to see available frame ids or `frames` to return all frames
|
|
60
60
|
|
|
61
|
+
It is also possible to provide configuration and overwrite default behaviour. Currently only for String#encode which is used in TextFrames.
|
|
62
|
+
|
|
63
|
+
This way you can avoid Encoding::InvalidByteSequenceError when tag contains invalid data.
|
|
64
|
+
```ruby
|
|
65
|
+
ID3Tag.configuration do |c|
|
|
66
|
+
c.string_encode_options = { :invalid => :replace, :undef => :replace }
|
|
67
|
+
end
|
|
68
|
+
```
|
|
69
|
+
|
|
61
70
|
|
|
62
71
|
## Features
|
|
63
72
|
|
data/Rakefile
CHANGED
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require 'rubygems'
|
|
4
|
-
require 'bundler'
|
|
5
|
-
begin
|
|
6
|
-
Bundler.setup(:default, :development)
|
|
7
|
-
rescue Bundler::BundlerError => e
|
|
8
|
-
$stderr.puts e.message
|
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
|
10
|
-
exit e.status_code
|
|
11
|
-
end
|
|
12
|
-
require 'rake'
|
|
13
|
-
|
|
14
|
-
require 'jeweler'
|
|
15
|
-
Jeweler::Tasks.new do |gem|
|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
|
17
|
-
gem.name = "id3tag"
|
|
18
|
-
gem.homepage = "http://github.com/krists/id3tag"
|
|
19
|
-
gem.license = "MIT"
|
|
20
|
-
gem.summary = %Q{Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards}
|
|
21
|
-
gem.description = %Q{Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards}
|
|
22
|
-
gem.email = "krists@iesals.lv"
|
|
23
|
-
gem.authors = ["Krists Ozols"]
|
|
24
|
-
gem.required_ruby_version = '>= 1.9.2'
|
|
25
|
-
# dependencies defined in Gemfile
|
|
26
|
-
end
|
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
|
28
|
-
|
|
29
|
-
require 'rspec/core'
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
require "bundler/gem_tasks"
|
|
30
3
|
require 'rspec/core/rake_task'
|
|
4
|
+
|
|
31
5
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
32
6
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
33
7
|
end
|
data/id3tag.gemspec
CHANGED
|
@@ -1,138 +1,27 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
-
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: id3tag 0.5.4 ruby lib
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
require File.expand_path('../lib/id3tag/version', __FILE__)
|
|
6
3
|
|
|
7
4
|
Gem::Specification.new do |s|
|
|
8
5
|
s.name = "id3tag"
|
|
9
|
-
s.version =
|
|
10
|
-
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
|
-
s.require_paths = ["lib"]
|
|
6
|
+
s.version = ID3Tag::VERSION
|
|
13
7
|
s.authors = ["Krists Ozols"]
|
|
14
|
-
s.date = "2013-12-28"
|
|
15
|
-
s.description = "Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards"
|
|
16
8
|
s.email = "krists@iesals.lv"
|
|
17
|
-
s.
|
|
18
|
-
"LICENSE.txt",
|
|
19
|
-
"README.md"
|
|
20
|
-
]
|
|
21
|
-
s.files = [
|
|
22
|
-
".document",
|
|
23
|
-
".rspec",
|
|
24
|
-
".travis.yml",
|
|
25
|
-
"Gemfile",
|
|
26
|
-
"Gemfile.lock",
|
|
27
|
-
"LICENSE.txt",
|
|
28
|
-
"README.md",
|
|
29
|
-
"Rakefile",
|
|
30
|
-
"VERSION",
|
|
31
|
-
"id3tag.gemspec",
|
|
32
|
-
"lib/id3tag.rb",
|
|
33
|
-
"lib/id3tag/audio_file.rb",
|
|
34
|
-
"lib/id3tag/frame_id_advisor.rb",
|
|
35
|
-
"lib/id3tag/frames/util/genre_names.rb",
|
|
36
|
-
"lib/id3tag/frames/v1/comments_frame.rb",
|
|
37
|
-
"lib/id3tag/frames/v1/genre_frame.rb",
|
|
38
|
-
"lib/id3tag/frames/v1/text_frame.rb",
|
|
39
|
-
"lib/id3tag/frames/v1/track_nr_frame.rb",
|
|
40
|
-
"lib/id3tag/frames/v2/basic_frame.rb",
|
|
41
|
-
"lib/id3tag/frames/v2/comments_frame.rb",
|
|
42
|
-
"lib/id3tag/frames/v2/frame_fabricator.rb",
|
|
43
|
-
"lib/id3tag/frames/v2/frame_flags.rb",
|
|
44
|
-
"lib/id3tag/frames/v2/genre_frame.rb",
|
|
45
|
-
"lib/id3tag/frames/v2/genre_frame/genre_parser.rb",
|
|
46
|
-
"lib/id3tag/frames/v2/genre_frame/genre_parser_24.rb",
|
|
47
|
-
"lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24.rb",
|
|
48
|
-
"lib/id3tag/frames/v2/involved_people_list_frame.rb",
|
|
49
|
-
"lib/id3tag/frames/v2/private_frame.rb",
|
|
50
|
-
"lib/id3tag/frames/v2/text_frame.rb",
|
|
51
|
-
"lib/id3tag/frames/v2/unique_file_id_frame.rb",
|
|
52
|
-
"lib/id3tag/frames/v2/unsychronized_transcription_frame.rb",
|
|
53
|
-
"lib/id3tag/frames/v2/user_text_frame.rb",
|
|
54
|
-
"lib/id3tag/id3_v1_frame_parser.rb",
|
|
55
|
-
"lib/id3tag/id3_v2_frame_parser.rb",
|
|
56
|
-
"lib/id3tag/id3_v2_tag_header.rb",
|
|
57
|
-
"lib/id3tag/number_util.rb",
|
|
58
|
-
"lib/id3tag/scope.rb",
|
|
59
|
-
"lib/id3tag/string_util.rb",
|
|
60
|
-
"lib/id3tag/synchsafe_integer.rb",
|
|
61
|
-
"lib/id3tag/tag.rb",
|
|
62
|
-
"lib/id3tag/unsynchronization.rb",
|
|
63
|
-
"spec/features/can_read_non_audio_files_spec.rb",
|
|
64
|
-
"spec/features/can_read_tag_v1_spec.rb",
|
|
65
|
-
"spec/fixtures/id3v1_and_v2.mp3",
|
|
66
|
-
"spec/fixtures/id3v1_with_track_nr.mp3",
|
|
67
|
-
"spec/fixtures/id3v1_without_track_nr.mp3",
|
|
68
|
-
"spec/fixtures/id3v2.mp3",
|
|
69
|
-
"spec/fixtures/pov_20131018-2100a.mp3.v1_tag_body",
|
|
70
|
-
"spec/fixtures/pov_20131018-2100a.mp3.v2_3_tag_body",
|
|
71
|
-
"spec/fixtures/signals_1.mp3.v2_3_tag_body",
|
|
72
|
-
"spec/id3tag_extract_tags",
|
|
73
|
-
"spec/lib/id3tag/audio_file_spec.rb",
|
|
74
|
-
"spec/lib/id3tag/frames/util/genre_name_by_id_finder_spec.rb",
|
|
75
|
-
"spec/lib/id3tag/frames/v1/comments_frame_spec.rb",
|
|
76
|
-
"spec/lib/id3tag/frames/v1/genre_frame_spec.rb",
|
|
77
|
-
"spec/lib/id3tag/frames/v1/text_frame_spec.rb",
|
|
78
|
-
"spec/lib/id3tag/frames/v1/track_nr_frame_spec.rb",
|
|
79
|
-
"spec/lib/id3tag/frames/v2/basic_frame_spec.rb",
|
|
80
|
-
"spec/lib/id3tag/frames/v2/comments_frame_spec.rb",
|
|
81
|
-
"spec/lib/id3tag/frames/v2/frame_fabricator_spec.rb",
|
|
82
|
-
"spec/lib/id3tag/frames/v2/frame_flags_spec.rb",
|
|
83
|
-
"spec/lib/id3tag/frames/v2/genre_frame/genre_parser_24_spec.rb",
|
|
84
|
-
"spec/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24_spec.rb",
|
|
85
|
-
"spec/lib/id3tag/frames/v2/genre_frame/genre_parser_spec.rb",
|
|
86
|
-
"spec/lib/id3tag/frames/v2/genre_frame_spec.rb",
|
|
87
|
-
"spec/lib/id3tag/frames/v2/text_frame_spec.rb",
|
|
88
|
-
"spec/lib/id3tag/frames/v2/unique_file_id_frame_spec.rb",
|
|
89
|
-
"spec/lib/id3tag/frames/v2/user_text_frame_spec.rb",
|
|
90
|
-
"spec/lib/id3tag/id3_v1_frame_parser_spec.rb",
|
|
91
|
-
"spec/lib/id3tag/id3_v2_frame_parser_spec.rb",
|
|
92
|
-
"spec/lib/id3tag/id3_v2_tag_header_spec.rb",
|
|
93
|
-
"spec/lib/id3tag/id3tag_spec.rb",
|
|
94
|
-
"spec/lib/id3tag/number_util_spec.rb",
|
|
95
|
-
"spec/lib/id3tag/string_util_spec.rb",
|
|
96
|
-
"spec/lib/id3tag/synchsafe_integer_spec.rb",
|
|
97
|
-
"spec/lib/id3tag/tag_spec.rb",
|
|
98
|
-
"spec/spec_helper.rb",
|
|
99
|
-
"spec/support/mp3_fixtures.rb",
|
|
100
|
-
"standard_documents/id3v2-00.txt",
|
|
101
|
-
"standard_documents/id3v2.3.0.txt",
|
|
102
|
-
"standard_documents/id3v2.4.0-frames.txt",
|
|
103
|
-
"standard_documents/id3v2.4.0-structure.txt"
|
|
104
|
-
]
|
|
105
|
-
s.homepage = "http://github.com/krists/id3tag"
|
|
106
|
-
s.licenses = ["MIT"]
|
|
107
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
|
108
|
-
s.rubygems_version = "2.2.0"
|
|
9
|
+
s.description = "Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards"
|
|
109
10
|
s.summary = "Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards"
|
|
11
|
+
s.homepage = "http://github.com/krists/id3tag"
|
|
12
|
+
s.license = "MIT"
|
|
110
13
|
|
|
111
|
-
|
|
112
|
-
|
|
14
|
+
s.files = `git ls-files`.split($/)
|
|
15
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
16
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
17
|
+
s.extra_rdoc_files = ["LICENSE.txt", "README.md"]
|
|
18
|
+
s.require_paths = ["lib"]
|
|
19
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
|
113
20
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
s.add_development_dependency(%q<coveralls>, [">= 0"])
|
|
121
|
-
else
|
|
122
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
|
123
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
|
124
|
-
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
|
125
|
-
s.add_dependency(%q<rspec>, ["~> 2.13.0"])
|
|
126
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
127
|
-
s.add_dependency(%q<coveralls>, [">= 0"])
|
|
128
|
-
end
|
|
129
|
-
else
|
|
130
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
|
131
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
|
132
|
-
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
|
133
|
-
s.add_dependency(%q<rspec>, ["~> 2.13.0"])
|
|
134
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
135
|
-
s.add_dependency(%q<coveralls>, [">= 0"])
|
|
136
|
-
end
|
|
21
|
+
s.add_development_dependency "bundler", "~> 1.3"
|
|
22
|
+
s.add_development_dependency "rake"
|
|
23
|
+
s.add_development_dependency "rdoc", "~> 3.12"
|
|
24
|
+
s.add_development_dependency "rspec", "~> 2.13.0"
|
|
25
|
+
s.add_development_dependency "simplecov"
|
|
26
|
+
s.add_development_dependency 'coveralls'
|
|
137
27
|
end
|
|
138
|
-
|
data/lib/id3tag.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require "stringio"
|
|
2
|
+
require "id3tag/configuration"
|
|
2
3
|
require "id3tag/synchsafe_integer"
|
|
3
4
|
require "id3tag/audio_file"
|
|
4
5
|
require "id3tag/id3_v2_tag_header"
|
|
@@ -36,4 +37,10 @@ module ID3Tag
|
|
|
36
37
|
yield tag if block_given?
|
|
37
38
|
tag
|
|
38
39
|
end
|
|
40
|
+
|
|
41
|
+
def self.configuration
|
|
42
|
+
@@configuration ||= ID3Tag::Configuration.new
|
|
43
|
+
yield @@configuration if block_given?
|
|
44
|
+
@@configuration
|
|
45
|
+
end
|
|
39
46
|
end
|
|
@@ -21,7 +21,7 @@ module ID3Tag
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
23
|
def encoded_content
|
|
24
|
-
content_without_encoding_byte.encode(destination_encoding, source_encoding)
|
|
24
|
+
content_without_encoding_byte.encode(destination_encoding, source_encoding, ID3Tag.configuration.string_encode_options)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def source_encoding
|
|
@@ -56,6 +56,24 @@ describe ID3Tag::Frames::V2::TextFrame do
|
|
|
56
56
|
let(:encoding_byte) { "\x03" }
|
|
57
57
|
it { should == 'Glāzšķūņrūķīši' }
|
|
58
58
|
end
|
|
59
|
+
|
|
60
|
+
context "when UTF-16 and missing BOM" do
|
|
61
|
+
let(:target_encoding) { Encoding::UTF_8 }
|
|
62
|
+
let(:raw_content) { "\x01\x00\x00a\x00b\x00c" }
|
|
63
|
+
it "raises error Encoding::InvalidByteSequenceError" do
|
|
64
|
+
expect { subject }.to raise_error(Encoding::InvalidByteSequenceError)
|
|
65
|
+
end
|
|
66
|
+
context "when using global encode options" do
|
|
67
|
+
before(:each) do
|
|
68
|
+
ID3Tag.configuration do |c|
|
|
69
|
+
c.string_encode_options = { :invalid => :replace, :undef => :replace }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
it "does not raise error" do
|
|
73
|
+
expect { subject }.not_to raise_error
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
59
77
|
end
|
|
60
78
|
|
|
61
79
|
describe '#inspect' do
|
metadata
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: id3tag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Krists Ozols
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-01-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ~>
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 1.
|
|
19
|
+
version: '1.3'
|
|
20
20
|
type: :development
|
|
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: 1.
|
|
26
|
+
version: '1.3'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - '>='
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - '>='
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rdoc
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - ~>
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '3.12'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - ~>
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.12'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rspec
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ~>
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: 2.13.0
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ~>
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 2.13.0
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: simplecov
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- -
|
|
73
|
+
- - '>='
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '0'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- -
|
|
80
|
+
- - '>='
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: coveralls
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - '>='
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '0'
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- -
|
|
94
|
+
- - '>='
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
description: Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and
|
|
@@ -103,18 +103,19 @@ extra_rdoc_files:
|
|
|
103
103
|
- LICENSE.txt
|
|
104
104
|
- README.md
|
|
105
105
|
files:
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
106
|
+
- .document
|
|
107
|
+
- .gitignore
|
|
108
|
+
- .rspec
|
|
109
|
+
- .travis.yml
|
|
109
110
|
- Gemfile
|
|
110
111
|
- Gemfile.lock
|
|
111
112
|
- LICENSE.txt
|
|
112
113
|
- README.md
|
|
113
114
|
- Rakefile
|
|
114
|
-
- VERSION
|
|
115
115
|
- id3tag.gemspec
|
|
116
116
|
- lib/id3tag.rb
|
|
117
117
|
- lib/id3tag/audio_file.rb
|
|
118
|
+
- lib/id3tag/configuration.rb
|
|
118
119
|
- lib/id3tag/frame_id_advisor.rb
|
|
119
120
|
- lib/id3tag/frames/util/genre_names.rb
|
|
120
121
|
- lib/id3tag/frames/v1/comments_frame.rb
|
|
@@ -144,6 +145,7 @@ files:
|
|
|
144
145
|
- lib/id3tag/synchsafe_integer.rb
|
|
145
146
|
- lib/id3tag/tag.rb
|
|
146
147
|
- lib/id3tag/unsynchronization.rb
|
|
148
|
+
- lib/id3tag/version.rb
|
|
147
149
|
- spec/features/can_read_non_audio_files_spec.rb
|
|
148
150
|
- spec/features/can_read_tag_v1_spec.rb
|
|
149
151
|
- spec/fixtures/id3v1_and_v2.mp3
|
|
@@ -195,12 +197,12 @@ require_paths:
|
|
|
195
197
|
- lib
|
|
196
198
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
199
|
requirements:
|
|
198
|
-
- -
|
|
200
|
+
- - '>='
|
|
199
201
|
- !ruby/object:Gem::Version
|
|
200
202
|
version: 1.9.2
|
|
201
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
204
|
requirements:
|
|
203
|
-
- -
|
|
205
|
+
- - '>='
|
|
204
206
|
- !ruby/object:Gem::Version
|
|
205
207
|
version: '0'
|
|
206
208
|
requirements: []
|
|
@@ -210,4 +212,41 @@ signing_key:
|
|
|
210
212
|
specification_version: 4
|
|
211
213
|
summary: Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x
|
|
212
214
|
standards
|
|
213
|
-
test_files:
|
|
215
|
+
test_files:
|
|
216
|
+
- spec/features/can_read_non_audio_files_spec.rb
|
|
217
|
+
- spec/features/can_read_tag_v1_spec.rb
|
|
218
|
+
- spec/fixtures/id3v1_and_v2.mp3
|
|
219
|
+
- spec/fixtures/id3v1_with_track_nr.mp3
|
|
220
|
+
- spec/fixtures/id3v1_without_track_nr.mp3
|
|
221
|
+
- spec/fixtures/id3v2.mp3
|
|
222
|
+
- spec/fixtures/pov_20131018-2100a.mp3.v1_tag_body
|
|
223
|
+
- spec/fixtures/pov_20131018-2100a.mp3.v2_3_tag_body
|
|
224
|
+
- spec/fixtures/signals_1.mp3.v2_3_tag_body
|
|
225
|
+
- spec/id3tag_extract_tags
|
|
226
|
+
- spec/lib/id3tag/audio_file_spec.rb
|
|
227
|
+
- spec/lib/id3tag/frames/util/genre_name_by_id_finder_spec.rb
|
|
228
|
+
- spec/lib/id3tag/frames/v1/comments_frame_spec.rb
|
|
229
|
+
- spec/lib/id3tag/frames/v1/genre_frame_spec.rb
|
|
230
|
+
- spec/lib/id3tag/frames/v1/text_frame_spec.rb
|
|
231
|
+
- spec/lib/id3tag/frames/v1/track_nr_frame_spec.rb
|
|
232
|
+
- spec/lib/id3tag/frames/v2/basic_frame_spec.rb
|
|
233
|
+
- spec/lib/id3tag/frames/v2/comments_frame_spec.rb
|
|
234
|
+
- spec/lib/id3tag/frames/v2/frame_fabricator_spec.rb
|
|
235
|
+
- spec/lib/id3tag/frames/v2/frame_flags_spec.rb
|
|
236
|
+
- spec/lib/id3tag/frames/v2/genre_frame/genre_parser_24_spec.rb
|
|
237
|
+
- spec/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24_spec.rb
|
|
238
|
+
- spec/lib/id3tag/frames/v2/genre_frame/genre_parser_spec.rb
|
|
239
|
+
- spec/lib/id3tag/frames/v2/genre_frame_spec.rb
|
|
240
|
+
- spec/lib/id3tag/frames/v2/text_frame_spec.rb
|
|
241
|
+
- spec/lib/id3tag/frames/v2/unique_file_id_frame_spec.rb
|
|
242
|
+
- spec/lib/id3tag/frames/v2/user_text_frame_spec.rb
|
|
243
|
+
- spec/lib/id3tag/id3_v1_frame_parser_spec.rb
|
|
244
|
+
- spec/lib/id3tag/id3_v2_frame_parser_spec.rb
|
|
245
|
+
- spec/lib/id3tag/id3_v2_tag_header_spec.rb
|
|
246
|
+
- spec/lib/id3tag/id3tag_spec.rb
|
|
247
|
+
- spec/lib/id3tag/number_util_spec.rb
|
|
248
|
+
- spec/lib/id3tag/string_util_spec.rb
|
|
249
|
+
- spec/lib/id3tag/synchsafe_integer_spec.rb
|
|
250
|
+
- spec/lib/id3tag/tag_spec.rb
|
|
251
|
+
- spec/spec_helper.rb
|
|
252
|
+
- spec/support/mp3_fixtures.rb
|
data/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.5.4
|