ogg_album_tagger 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ogg_album_tagger/tag_container.rb +10 -1
- data/lib/ogg_album_tagger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbafc73bba9ee1dd7d8b8e5ee7c041258f8a9461
|
4
|
+
data.tar.gz: b44bd48acb92454f074fdb2c61c912d81a29e3ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eafe6bc6b531c0c6d66b83ac632d837ef7ce7b2834ed678e9537f6ab7d3cce977c044413906b6e0b70882b1f60a88b5ff2bbf95f44349f724dcfde7a36000e89
|
7
|
+
data.tar.gz: 59dbd75622405bff1ebfc78eeb5163608f9bb8824c8778a304f261b5b03ec589e300c264d70af08409415bf01f29139cc0ddf616be298a2e7b7ef1cf1f99ee53
|
@@ -75,8 +75,14 @@ class TagContainer
|
|
75
75
|
@hash.has_key?(tag.upcase)
|
76
76
|
end
|
77
77
|
|
78
|
-
#
|
78
|
+
# Check if the tag is valid, otherwise raise an ArgulentError.
|
79
|
+
def valid_tag? tag
|
80
|
+
raise ArgumentError, "Invalid tag." unless tag =~ /^[\x20-\x3C\x3E-\x7D]+$/
|
81
|
+
end
|
82
|
+
|
83
|
+
# If the specified tag is absent from the container, associate an empty Set to it.
|
79
84
|
def prepare_tag tag
|
85
|
+
valid_tag? tag
|
80
86
|
@hash[tag.upcase] = Set.new unless self.has_tag?(tag)
|
81
87
|
end
|
82
88
|
|
@@ -95,6 +101,8 @@ class TagContainer
|
|
95
101
|
|
96
102
|
# Remove some tags. If no value is specified, the specified tag is removed.
|
97
103
|
def rm_values(tag, *values)
|
104
|
+
valid_tag? tag
|
105
|
+
|
98
106
|
if values.empty? then @hash.delete(tag.upcase)
|
99
107
|
else
|
100
108
|
@hash[tag.upcase].subtract(values)
|
@@ -137,6 +145,7 @@ class TagContainer
|
|
137
145
|
end
|
138
146
|
|
139
147
|
private :prepare_tag
|
148
|
+
private :valid_tag?
|
140
149
|
end
|
141
150
|
|
142
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ogg_album_tagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyrille Faucheux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.4.6
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Interactive edition of ogg tags with support for whole albums.
|