unitf-tag 0.1.8 → 0.1.9
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 +1 -0
- data/bin/test.rb +4 -4
- data/lib/unitf/tag/file.rb +14 -0
- data/lib/unitf/tag/version.rb +1 -1
- metadata +1 -3
- data/tag +0 -2
- data/test.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3349c41222239a0d71175ea75b37345f768376f08d7b6621f5b28afc599804b9
|
4
|
+
data.tar.gz: 57ee77221f0b63bc6238d889fe2cf5b6c1de899a02f082b6443c49ccbfe5d1de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa4cc77d47945d7b8a5b53f2e5d979038ae2279e82f7cb4a31482f9f8e7205aab31249f17c8bccb30a6b260a3406c849059b56c399210eae22d61683eae0fe1
|
7
|
+
data.tar.gz: c6fd219e909d0baaa167902e7032109af3f164c522ed113c1c5fa109572342339b3efcf6549cc7133f9ec39c3a2764966b8350b1ef554a23f361dc14827d862d
|
data/.gitignore
CHANGED
data/bin/test.rb
CHANGED
@@ -4,7 +4,7 @@ require 'unitf/tag'
|
|
4
4
|
|
5
5
|
UnitF::Log.to_console
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
7
|
+
UnitF::Tag::File.update('/Users/mbaron/tmp/foo.mp3') do |tag|
|
8
|
+
tag.artist = 'bar123'
|
9
|
+
tag.year = 1972
|
10
|
+
end
|
data/lib/unitf/tag/file.rb
CHANGED
@@ -11,6 +11,20 @@ module UnitF
|
|
11
11
|
super(::File.absolute_path(file_path.to_s))
|
12
12
|
end
|
13
13
|
|
14
|
+
def update
|
15
|
+
open do |file|
|
16
|
+
yield file.tag
|
17
|
+
file.save || (raise UnitF::Tag::Error, "Failed to save file #{@file}")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.update(file_path)
|
22
|
+
UnitF::Tag::File.new(file_path).open do |file|
|
23
|
+
yield file.tag
|
24
|
+
file.save || (raise UnitF::Tag::Error, "Failed to save file #{file_path}")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
14
28
|
def tag
|
15
29
|
@file.tag
|
16
30
|
end
|
data/lib/unitf/tag/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unitf-tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Baron
|
@@ -67,8 +67,6 @@ files:
|
|
67
67
|
- lib/unitf/tag/flac.rb
|
68
68
|
- lib/unitf/tag/mp3.rb
|
69
69
|
- lib/unitf/tag/version.rb
|
70
|
-
- tag
|
71
|
-
- test.rb
|
72
70
|
- unitf-tag.gemspec
|
73
71
|
homepage: https://github.com/mattbaron/unitf-tag
|
74
72
|
licenses:
|
data/test.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'find'
|
2
|
-
|
3
|
-
require 'unitf/tagger'
|
4
|
-
|
5
|
-
file_str = '../../tag/music/If\'n/01-Sometimes.mp3'
|
6
|
-
file_str = '/Users/mbaron/tmp/foo-bar.txt'
|
7
|
-
|
8
|
-
# begin
|
9
|
-
# file = File.new(file_str)
|
10
|
-
# rescue Errno::ENOENT => e
|
11
|
-
# puts "No such file #{file_str}"
|
12
|
-
# end
|
13
|
-
|
14
|
-
#puts Dir.glob('/Users/mbaron/google-cloud-sdk/**/*')
|
15
|
-
|
16
|
-
Find.find('../../tag/music') do |path|
|
17
|
-
next unless File.file?(path)
|
18
|
-
file = UnitF::Tagger::AudioFile.new(path)
|
19
|
-
puts file.cover_path
|
20
|
-
end
|