id3tag 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -5
  3. data/lib/id3tag.rb +11 -4
  4. data/lib/id3tag/audio_file.rb +7 -1
  5. data/lib/id3tag/configuration.rb +2 -0
  6. data/lib/id3tag/id3_v2_frame_parser.rb +12 -8
  7. data/lib/id3tag/version.rb +1 -1
  8. metadata +7 -96
  9. data/.document +0 -5
  10. data/.gitignore +0 -8
  11. data/.rspec +0 -1
  12. data/.travis.yml +0 -15
  13. data/Gemfile +0 -4
  14. data/Rakefile +0 -24
  15. data/id3tag.gemspec +0 -28
  16. data/spec/features/can_read_non_audio_files_spec.rb +0 -17
  17. data/spec/features/can_read_tag_v1_spec.rb +0 -15
  18. data/spec/fixtures/id3v1_and_v2.mp3 +0 -0
  19. data/spec/fixtures/id3v1_with_track_nr.mp3 +0 -0
  20. data/spec/fixtures/id3v1_without_track_nr.mp3 +0 -0
  21. data/spec/fixtures/id3v2.mp3 +0 -0
  22. data/spec/fixtures/pov_20131018-2100a.mp3.v1_tag_body +0 -0
  23. data/spec/fixtures/pov_20131018-2100a.mp3.v2_3_tag_body +0 -0
  24. data/spec/fixtures/signals_1.mp3.v2_3_tag_body +0 -0
  25. data/spec/id3tag_extract_tags +0 -18
  26. data/spec/lib/id3tag/audio_file_spec.rb +0 -131
  27. data/spec/lib/id3tag/frames/util/genre_name_by_id_finder_spec.rb +0 -18
  28. data/spec/lib/id3tag/frames/v1/comments_frame_spec.rb +0 -39
  29. data/spec/lib/id3tag/frames/v1/genre_frame_spec.rb +0 -20
  30. data/spec/lib/id3tag/frames/v1/text_frame_spec.rb +0 -14
  31. data/spec/lib/id3tag/frames/v1/track_nr_frame_spec.rb +0 -19
  32. data/spec/lib/id3tag/frames/v2/basic_frame_spec.rb +0 -140
  33. data/spec/lib/id3tag/frames/v2/comments_frame_spec.rb +0 -45
  34. data/spec/lib/id3tag/frames/v2/frame_fabricator_spec.rb +0 -70
  35. data/spec/lib/id3tag/frames/v2/frame_flags_spec.rb +0 -588
  36. data/spec/lib/id3tag/frames/v2/genre_frame/genre_parser_24_spec.rb +0 -26
  37. data/spec/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24_spec.rb +0 -48
  38. data/spec/lib/id3tag/frames/v2/genre_frame/genre_parser_spec.rb +0 -13
  39. data/spec/lib/id3tag/frames/v2/genre_frame_spec.rb +0 -61
  40. data/spec/lib/id3tag/frames/v2/picture_frame_spec.rb +0 -127
  41. data/spec/lib/id3tag/frames/v2/text_frame_spec.rb +0 -89
  42. data/spec/lib/id3tag/frames/v2/unique_file_id_frame_spec.rb +0 -31
  43. data/spec/lib/id3tag/frames/v2/user_text_frame_spec.rb +0 -34
  44. data/spec/lib/id3tag/id3_v1_frame_parser_spec.rb +0 -71
  45. data/spec/lib/id3tag/id3_v2_frame_parser_spec.rb +0 -32
  46. data/spec/lib/id3tag/id3_v2_tag_header_spec.rb +0 -149
  47. data/spec/lib/id3tag/id3tag_spec.rb +0 -17
  48. data/spec/lib/id3tag/io_util_spec.rb +0 -30
  49. data/spec/lib/id3tag/number_util_spec.rb +0 -32
  50. data/spec/lib/id3tag/string_util_spec.rb +0 -81
  51. data/spec/lib/id3tag/synchsafe_integer_spec.rb +0 -14
  52. data/spec/lib/id3tag/tag_spec.rb +0 -352
  53. data/spec/spec_helper.rb +0 -23
  54. data/spec/support/mp3_fixtures.rb +0 -4
  55. data/standard_documents/id3v2-00.txt +0 -1657
  56. data/standard_documents/id3v2.3.0.txt +0 -2022
  57. data/standard_documents/id3v2.4.0-frames.txt +0 -1732
  58. data/standard_documents/id3v2.4.0-structure.txt +0 -732
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f472ca0d17fce8372d1bca854965d2d1ae862e74933e5da9cc8cf6e7614e3d59
4
- data.tar.gz: 4faf983540a5f81630294fe91ca353e30a09dc378b1fb1e8377f30a293fd212d
3
+ metadata.gz: 03c00ecdfdd2c6e53e5664831502753b5210a67098223bcfdb2805b9ab7958cd
4
+ data.tar.gz: aba76b6019b3be742ddd51a2a024b90fefc59dfd1f645589f5f4a18b4da0dc60
5
5
  SHA512:
6
- metadata.gz: fc4ec4101cca2e2b35ff722abc5d5d4a5cfd517d946d059e8f6b3775cc022335284bae1f14b868a2629765f1de94a14448ceecbee80eb6737b0ee506ca8b5a5e
7
- data.tar.gz: 64fab8761e94835e3b7c05cfe4463c3f9ab1ec646ef85f6a4ced501695e8e9c73995973a00080b7d7ca284fc8810e46d9ce04617149c982eca2dbad15b7c41ee
6
+ metadata.gz: 85af215ef04e69deac371b5e9dea9c1bf401f01763794ae3f319be55ce09b6aa7fd67228fca0d62bfd956d4e8a445d173d985eecd4177462fa0b7a8aeae6aa3e
7
+ data.tar.gz: d3fdb4e68b97b3dfffb013d544b6feeeb56b1d9277d5ec6407fa3327837e1e8b5148c849e419ab0b18bccd8b003e5e2d01b0cca437a6216b8c3f55b88634d559
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # ID3Tag
2
- Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards
2
+ Native Ruby ID3 tag reader that aims for 100% coverage of ID3v2.x and ID3v1.x standards
3
3
 
4
4
  ## Install
5
5
 
@@ -12,7 +12,7 @@ gem install id3tag
12
12
 
13
13
  Or add the gem to your Gemfile:
14
14
  ```
15
- gem 'id3tag', '~> 0.10.0'
15
+ gem 'id3tag', '~> 0.11.0'
16
16
  ```
17
17
 
18
18
  ## How to use
@@ -58,12 +58,23 @@ 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.
61
+ ## Configuration
62
62
 
63
- This way you can avoid Encoding::InvalidByteSequenceError when tag contains invalid data.
63
+ It is also possible to provide configuration and overwrite default behaviour.
64
+
64
65
  ```ruby
65
66
  ID3Tag.configuration do |c|
67
+
68
+ # This way you can avoid Encoding::InvalidByteSequenceError when tag contains invalid data.
69
+ # Currently only for String#encode which is used in TextFrames.
70
+ # default: {}
66
71
  c.string_encode_options = { :invalid => :replace, :undef => :replace }
72
+
73
+ # You might want to set v2.x tag read limit in bytes to avoid reading too much data into memory
74
+ # v2 tags will be extracted until end of tag or limit is reached.
75
+ # default: 0 (There are no limit)
76
+ c.v2_tag_read_limit = 1048576 # 1 megabyte
77
+
67
78
  end
68
79
  ```
69
80
 
@@ -88,5 +99,5 @@ end
88
99
  [![Code Climate](https://codeclimate.com/github/krists/id3tag.png)](https://codeclimate.com/github/krists/id3tag) [![Build Status](https://travis-ci.org/krists/id3tag.png?branch=master)](https://travis-ci.org/krists/id3tag) [![Coverage Status](https://coveralls.io/repos/krists/id3tag/badge.png?branch=master)](https://coveralls.io/r/krists/id3tag) [![Gem Version](https://badge.fury.io/rb/id3tag.png)](http://badge.fury.io/rb/id3tag)
89
100
  ## Copyright
90
101
 
91
- Copyright (c) 2017 Krists Ozols. See LICENSE.txt for
102
+ Copyright (c) 2018 Krists Ozols. See LICENSE.txt for
92
103
  further details.
@@ -41,9 +41,16 @@ module ID3Tag
41
41
  tag
42
42
  end
43
43
 
44
- def self.configuration
45
- @@configuration ||= ID3Tag::Configuration.new
46
- yield @@configuration if block_given?
47
- @@configuration
44
+ class << self
45
+ def configuration
46
+ @configuration ||= reset_configuration
47
+ yield @configuration if block_given?
48
+ @configuration
49
+ end
50
+
51
+ def reset_configuration(configuration = ID3Tag::Configuration.new)
52
+ raise ArgumentError, "Passed argument must be a ID3Tag::Configuration class object" unless configuration.is_a?(ID3Tag::Configuration)
53
+ @configuration = configuration
54
+ end
48
55
  end
49
56
  end
@@ -4,6 +4,7 @@ module ID3Tag
4
4
  ID3V2_TAG_HEADER_SIZE = 10
5
5
  IDV1_TAG_IDENTIFIER = "TAG"
6
6
  IDV2_TAG_IDENTIFIER = "ID3"
7
+ BLANK_STRING = ""
7
8
 
8
9
  def initialize(file)
9
10
  @file = file
@@ -43,7 +44,12 @@ module ID3Tag
43
44
  def v2_tag_body
44
45
  if v2_tag_size > 0
45
46
  @file.seek(v2_tag_frame_and_padding_position)
46
- @file.read(v2_tag_frame_and_padding_size)
47
+ bytes_to_read = v2_tag_frame_and_padding_size
48
+ limit = ID3Tag.configuration.v2_tag_read_limit
49
+ if (limit > 0) && (bytes_to_read > limit)
50
+ bytes_to_read = limit
51
+ end
52
+ @file.read(bytes_to_read) || BLANK_STRING
47
53
  end
48
54
  end
49
55
 
@@ -2,8 +2,10 @@ module ID3Tag
2
2
  class Configuration
3
3
  def initialize
4
4
  @string_encode_options = {}
5
+ @v2_tag_read_limit = 0
5
6
  end
6
7
 
7
8
  attr_accessor :string_encode_options
9
+ attr_accessor :v2_tag_read_limit
8
10
  end
9
11
  end
@@ -13,13 +13,15 @@ module ID3Tag
13
13
  def get_frames
14
14
  frames = []
15
15
  rewind_input
16
- loop do
17
- frame_id = read_next_frame_id
18
- frame_size = read_next_frame_size
19
- frame_flags = read_next_frame_flags
20
- frame_content = read_next_bytes(frame_size)
21
- frames << Frames::V2::FrameFabricator.fabricate(frame_id, frame_content, frame_flags, @major_version_number)
22
- break if padding_or_eof_reached?
16
+ catch(:unexpected_eof) do
17
+ loop do
18
+ frame_id = read_next_frame_id
19
+ frame_size = read_next_frame_size
20
+ frame_flags = read_next_frame_flags
21
+ frame_content = read_next_bytes(frame_size)
22
+ frames << Frames::V2::FrameFabricator.fabricate(frame_id, frame_content, frame_flags, @major_version_number)
23
+ break if padding_or_eof_reached?
24
+ end
23
25
  end
24
26
  frames
25
27
  end
@@ -52,7 +54,9 @@ module ID3Tag
52
54
  end
53
55
 
54
56
  def read_next_bytes(limit)
55
- @input.read(limit)
57
+ bytes = @input.read(limit)
58
+ throw(:unexpected_eof) unless bytes && bytes.bytesize == limit
59
+ bytes
56
60
  end
57
61
 
58
62
  def rewind_input
@@ -1,3 +1,3 @@
1
1
  module ID3Tag
2
- VERSION = "0.10.1"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: id3tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.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: 2018-06-13 00:00:00.000000000 Z
11
+ date: 2018-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.11.1
111
- description: Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and
111
+ description: Native Ruby ID3 tag reader that aims for 100% coverage of ID3v2.x and
112
112
  ID3v1.x standards
113
113
  email: krists.ozols@gmail.com
114
114
  executables: []
@@ -117,15 +117,8 @@ extra_rdoc_files:
117
117
  - LICENSE.txt
118
118
  - README.md
119
119
  files:
120
- - ".document"
121
- - ".gitignore"
122
- - ".rspec"
123
- - ".travis.yml"
124
- - Gemfile
125
120
  - LICENSE.txt
126
121
  - README.md
127
- - Rakefile
128
- - id3tag.gemspec
129
122
  - lib/id3tag.rb
130
123
  - lib/id3tag/audio_file.rb
131
124
  - lib/id3tag/configuration.rb
@@ -162,50 +155,7 @@ files:
162
155
  - lib/id3tag/tag.rb
163
156
  - lib/id3tag/unsynchronization.rb
164
157
  - lib/id3tag/version.rb
165
- - spec/features/can_read_non_audio_files_spec.rb
166
- - spec/features/can_read_tag_v1_spec.rb
167
- - spec/fixtures/id3v1_and_v2.mp3
168
- - spec/fixtures/id3v1_with_track_nr.mp3
169
- - spec/fixtures/id3v1_without_track_nr.mp3
170
- - spec/fixtures/id3v2.mp3
171
- - spec/fixtures/pov_20131018-2100a.mp3.v1_tag_body
172
- - spec/fixtures/pov_20131018-2100a.mp3.v2_3_tag_body
173
- - spec/fixtures/signals_1.mp3.v2_3_tag_body
174
- - spec/id3tag_extract_tags
175
- - spec/lib/id3tag/audio_file_spec.rb
176
- - spec/lib/id3tag/frames/util/genre_name_by_id_finder_spec.rb
177
- - spec/lib/id3tag/frames/v1/comments_frame_spec.rb
178
- - spec/lib/id3tag/frames/v1/genre_frame_spec.rb
179
- - spec/lib/id3tag/frames/v1/text_frame_spec.rb
180
- - spec/lib/id3tag/frames/v1/track_nr_frame_spec.rb
181
- - spec/lib/id3tag/frames/v2/basic_frame_spec.rb
182
- - spec/lib/id3tag/frames/v2/comments_frame_spec.rb
183
- - spec/lib/id3tag/frames/v2/frame_fabricator_spec.rb
184
- - spec/lib/id3tag/frames/v2/frame_flags_spec.rb
185
- - spec/lib/id3tag/frames/v2/genre_frame/genre_parser_24_spec.rb
186
- - spec/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24_spec.rb
187
- - spec/lib/id3tag/frames/v2/genre_frame/genre_parser_spec.rb
188
- - spec/lib/id3tag/frames/v2/genre_frame_spec.rb
189
- - spec/lib/id3tag/frames/v2/picture_frame_spec.rb
190
- - spec/lib/id3tag/frames/v2/text_frame_spec.rb
191
- - spec/lib/id3tag/frames/v2/unique_file_id_frame_spec.rb
192
- - spec/lib/id3tag/frames/v2/user_text_frame_spec.rb
193
- - spec/lib/id3tag/id3_v1_frame_parser_spec.rb
194
- - spec/lib/id3tag/id3_v2_frame_parser_spec.rb
195
- - spec/lib/id3tag/id3_v2_tag_header_spec.rb
196
- - spec/lib/id3tag/id3tag_spec.rb
197
- - spec/lib/id3tag/io_util_spec.rb
198
- - spec/lib/id3tag/number_util_spec.rb
199
- - spec/lib/id3tag/string_util_spec.rb
200
- - spec/lib/id3tag/synchsafe_integer_spec.rb
201
- - spec/lib/id3tag/tag_spec.rb
202
- - spec/spec_helper.rb
203
- - spec/support/mp3_fixtures.rb
204
- - standard_documents/id3v2-00.txt
205
- - standard_documents/id3v2.3.0.txt
206
- - standard_documents/id3v2.4.0-frames.txt
207
- - standard_documents/id3v2.4.0-structure.txt
208
- homepage: http://github.com/krists/id3tag
158
+ homepage: https://github.com/krists/id3tag
209
159
  licenses:
210
160
  - MIT
211
161
  metadata: {}
@@ -217,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
217
167
  requirements:
218
168
  - - ">="
219
169
  - !ruby/object:Gem::Version
220
- version: 1.9.2
170
+ version: '2.2'
221
171
  required_rubygems_version: !ruby/object:Gem::Requirement
222
172
  requirements:
223
173
  - - ">="
@@ -228,45 +178,6 @@ rubyforge_project:
228
178
  rubygems_version: 2.7.3
229
179
  signing_key:
230
180
  specification_version: 4
231
- summary: Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x
181
+ summary: Native Ruby ID3 tag reader that aims for 100% coverage of ID3v2.x and ID3v1.x
232
182
  standards
233
- test_files:
234
- - spec/features/can_read_non_audio_files_spec.rb
235
- - spec/features/can_read_tag_v1_spec.rb
236
- - spec/fixtures/id3v1_and_v2.mp3
237
- - spec/fixtures/id3v1_with_track_nr.mp3
238
- - spec/fixtures/id3v1_without_track_nr.mp3
239
- - spec/fixtures/id3v2.mp3
240
- - spec/fixtures/pov_20131018-2100a.mp3.v1_tag_body
241
- - spec/fixtures/pov_20131018-2100a.mp3.v2_3_tag_body
242
- - spec/fixtures/signals_1.mp3.v2_3_tag_body
243
- - spec/id3tag_extract_tags
244
- - spec/lib/id3tag/audio_file_spec.rb
245
- - spec/lib/id3tag/frames/util/genre_name_by_id_finder_spec.rb
246
- - spec/lib/id3tag/frames/v1/comments_frame_spec.rb
247
- - spec/lib/id3tag/frames/v1/genre_frame_spec.rb
248
- - spec/lib/id3tag/frames/v1/text_frame_spec.rb
249
- - spec/lib/id3tag/frames/v1/track_nr_frame_spec.rb
250
- - spec/lib/id3tag/frames/v2/basic_frame_spec.rb
251
- - spec/lib/id3tag/frames/v2/comments_frame_spec.rb
252
- - spec/lib/id3tag/frames/v2/frame_fabricator_spec.rb
253
- - spec/lib/id3tag/frames/v2/frame_flags_spec.rb
254
- - spec/lib/id3tag/frames/v2/genre_frame/genre_parser_24_spec.rb
255
- - spec/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24_spec.rb
256
- - spec/lib/id3tag/frames/v2/genre_frame/genre_parser_spec.rb
257
- - spec/lib/id3tag/frames/v2/genre_frame_spec.rb
258
- - spec/lib/id3tag/frames/v2/picture_frame_spec.rb
259
- - spec/lib/id3tag/frames/v2/text_frame_spec.rb
260
- - spec/lib/id3tag/frames/v2/unique_file_id_frame_spec.rb
261
- - spec/lib/id3tag/frames/v2/user_text_frame_spec.rb
262
- - spec/lib/id3tag/id3_v1_frame_parser_spec.rb
263
- - spec/lib/id3tag/id3_v2_frame_parser_spec.rb
264
- - spec/lib/id3tag/id3_v2_tag_header_spec.rb
265
- - spec/lib/id3tag/id3tag_spec.rb
266
- - spec/lib/id3tag/io_util_spec.rb
267
- - spec/lib/id3tag/number_util_spec.rb
268
- - spec/lib/id3tag/string_util_spec.rb
269
- - spec/lib/id3tag/synchsafe_integer_spec.rb
270
- - spec/lib/id3tag/tag_spec.rb
271
- - spec/spec_helper.rb
272
- - spec/support/mp3_fixtures.rb
183
+ test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- coverage
2
- Gemfile.lock
3
- .bundle
4
- tags
5
- vendor/bundle
6
- bin
7
- doc
8
- pkg
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
@@ -1,15 +0,0 @@
1
- language: ruby
2
- before_install:
3
- - gem install bundler
4
- rvm:
5
- - ruby-head
6
- - jruby-head
7
- - 2.5.1
8
- - 2.4.4
9
- - 2.3.7
10
- - 2.2.10
11
- - jruby-9.1.13.0
12
- matrix:
13
- allow_failures:
14
- - rvm: jruby-head
15
- - rvm: ruby-head
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in id3tag.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
3
- require 'rspec/core/rake_task'
4
-
5
- RSpec::Core::RakeTask.new(:spec) do |spec|
6
- spec.pattern = FileList['spec/**/*_spec.rb']
7
- end
8
-
9
- RSpec::Core::RakeTask.new(:rcov) do |spec|
10
- spec.pattern = 'spec/**/*_spec.rb'
11
- spec.rcov = true
12
- end
13
-
14
- task :default => :spec
15
-
16
- require 'rdoc/task'
17
- Rake::RDocTask.new do |rdoc|
18
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
19
-
20
- rdoc.rdoc_dir = 'rdoc'
21
- rdoc.title = "id3tag #{version}"
22
- rdoc.rdoc_files.include('README*')
23
- rdoc.rdoc_files.include('lib/**/*.rb')
24
- end
@@ -1,28 +0,0 @@
1
- # coding: utf-8
2
- require File.expand_path('../lib/id3tag/version', __FILE__)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "id3tag"
6
- s.version = ID3Tag::VERSION
7
- s.authors = ["Krists Ozols"]
8
- s.email = "krists.ozols@gmail.com"
9
- s.description = "Native Ruby ID3 tag reader that aims for 100% covarage of ID3v2.x and ID3v1.x standards"
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"
13
-
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")
20
-
21
- s.add_development_dependency "bundler"
22
- s.add_development_dependency "rake", "~> 12.1.0"
23
- s.add_development_dependency "rdoc", "~> 5.1.0"
24
- s.add_development_dependency "rspec", "~> 3.6.0"
25
- s.add_development_dependency "simplecov", "~> 0.14.1"
26
- s.add_development_dependency 'coveralls', "~> 0.8.21"
27
- s.add_development_dependency 'pry', "~> 0.11.1"
28
- end
@@ -1,17 +0,0 @@
1
- require 'spec_helper'
2
- require 'tempfile'
3
-
4
- describe 'can read any file and does not raise errors if no tag found' do
5
- subject { ID3Tag.read(Tempfile.new('fake_mp3')) }
6
-
7
- it 'should return blanks' do
8
- expect(subject.title).to eq(nil)
9
- expect(subject.artist).to eq(nil)
10
- expect(subject.album).to eq(nil)
11
- expect(subject.genre).to eq(nil)
12
- expect(subject.year).to eq(nil)
13
- expect(subject.track_nr).to eq(nil)
14
- expect(subject.frames).to eq([])
15
- expect(subject.frame_ids).to eq([])
16
- end
17
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'can read v1 info from file' do
4
- let(:mp3_with_v1_1_tag) { mp3_fixture('id3v1_with_track_nr.mp3') }
5
- subject { ID3Tag.read(mp3_with_v1_1_tag) }
6
-
7
- it 'reading file with only v1 tag' do
8
- expect(subject.title).to eq("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaA")
9
- expect(subject.artist).to eq("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbB")
10
- expect(subject.album).to eq("cccccccccccccccccccccccccccccC")
11
- expect(subject.genre).to eq("Blues")
12
- expect(subject.year).to eq("2003")
13
- expect(subject.track_nr).to eq("1")
14
- end
15
- end
Binary file