id3tag 0.12.0 → 0.12.1
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/lib/id3tag/configuration.rb +7 -3
- data/lib/id3tag/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19488a0e5c2d7354946f8c02f9190134580fde95820eb2ab3e35b559e4c85819
|
4
|
+
data.tar.gz: 5b25ad975028445328117b0aaa443e4b781ca86bed14101366baa8fbf57915d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d717cde84a8bcad1bcfb93c8f024e64fa315933bccd199f68a748c7b54c5ef57f7b184f926da63627eec14af1eeb769380e73dbe5f6cd5cefe657a1ef1782ff
|
7
|
+
data.tar.gz: 4a80fd637e147b07f2ba2c35f5cbee826c430a778e86d3bec69bdf2e581f87e5c9794ea6542e60697f12826e51060f7f87b11cecb6c3fa507b815a7c85c1d548
|
data/lib/id3tag/configuration.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module ID3Tag
|
2
2
|
class Configuration
|
3
|
-
ResetError = Class.new(StandardError)
|
4
3
|
include Singleton
|
4
|
+
ResetError = Class.new(StandardError)
|
5
5
|
StackItem = Struct.new(:configuration)
|
6
6
|
|
7
7
|
class << self
|
@@ -10,7 +10,9 @@ module ID3Tag
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def configuration
|
13
|
-
|
13
|
+
value_from_stack = instance.instance_variable_get(:@stack).last
|
14
|
+
value = value_from_stack && value_from_stack.configuration
|
15
|
+
value ||= instance.instance_variable_get(:@global_configuration)
|
14
16
|
yield value if block_given?
|
15
17
|
value
|
16
18
|
end
|
@@ -21,7 +23,9 @@ module ID3Tag
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def local_configuration
|
24
|
-
|
26
|
+
instance_to_copy = @stack.last && @stack.last.configuration
|
27
|
+
instance_to_copy ||= @global_configuration
|
28
|
+
stack_item = StackItem.new(instance_to_copy.dup)
|
25
29
|
stack_backup = @stack.dup
|
26
30
|
@stack << stack_item
|
27
31
|
begin
|
data/lib/id3tag/version.rb
CHANGED