openmeta.rb 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Guardfile +1 -1
- data/lib/openmeta.rb +6 -6
- data/lib/openmeta/version.rb +1 -1
- data/spec/openmeta_spec.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: b526c286d3a9b6571647d09cc6de5369d409eca0
|
4
|
-
data.tar.gz: f0dd005385f43c0498bc39adad9e72806cfd6980
|
5
2
|
SHA512:
|
6
|
-
|
7
|
-
|
3
|
+
data.tar.gz: 9209f5e1021db9d1223a0c725c50bdd6b1b0bf8636ef6843f756fad4fc930ce4ab3c23b75ef30b80c6ba133eceeeee093f0e0314f6810d9038e8147ad06d15fd
|
4
|
+
metadata.gz: 8c489230b0f0e4d3cc86f44d7c5f0cbcb46f28672dc5c4e6c2da96e04b689a2dc631454f34215df2a2270221c4b8faafe4f9abd469702defc84a86d460c067d0
|
5
|
+
SHA1:
|
6
|
+
data.tar.gz: e1f8b8523dcf22c33b4e24b6e1ed0c76952d7f41
|
7
|
+
metadata.gz: 95a114abb8668fe3a971e3ee349d462992ad442d
|
data/Guardfile
CHANGED
@@ -5,7 +5,7 @@ notification :growl
|
|
5
5
|
|
6
6
|
group :backend do
|
7
7
|
|
8
|
-
guard 'rspec', :rvm => ["macruby
|
8
|
+
guard 'rspec', :rvm => ["macruby"], :notification => true do
|
9
9
|
|
10
10
|
watch(%r{^spec/.+_spec\.rb$})
|
11
11
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
data/lib/openmeta.rb
CHANGED
@@ -85,13 +85,13 @@ module Openmeta
|
|
85
85
|
def remove_tags(tags, from_files)
|
86
86
|
from_files = fu_list(from_files)
|
87
87
|
|
88
|
+
return if tags.empty?
|
89
|
+
|
88
90
|
from_files.each { |file|
|
89
|
-
|
90
|
-
existing_tags
|
91
|
-
|
92
|
-
|
93
|
-
set_tags(existing_tags, file)
|
94
|
-
end
|
91
|
+
existing_tags = get_tags(file) # frozen array
|
92
|
+
next if existing_tags.nil? or existing_tags.empty?
|
93
|
+
|
94
|
+
set_tags(existing_tags - tags, file)
|
95
95
|
}
|
96
96
|
end
|
97
97
|
|
data/lib/openmeta/version.rb
CHANGED
data/spec/openmeta_spec.rb
CHANGED
@@ -15,8 +15,12 @@ describe "Openmeta" do
|
|
15
15
|
expect { Openmeta.get_tags("/path/to/nowhere") }.to raise_error(Openmeta::ObjCError)
|
16
16
|
end
|
17
17
|
|
18
|
-
it "should not raise
|
19
|
-
expect { Openmeta.clone(@testfiles[0], @testfiles[1]) }.
|
18
|
+
it "should not raise error if file does not contains tags" do
|
19
|
+
expect { Openmeta.clone(@testfiles[0], @testfiles[1]) }.to_not raise_error
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should not raise error when removing nonexisting tags" do
|
23
|
+
expect { Openmeta.remove_tags(['NonExistingTag'], @testfiles[1]) }.to_not raise_error
|
20
24
|
end
|
21
25
|
|
22
26
|
it "should set tags and rating correctly" do
|
@@ -58,6 +62,7 @@ describe "Openmeta" do
|
|
58
62
|
rtags.should match_array(tags)
|
59
63
|
end
|
60
64
|
|
65
|
+
|
61
66
|
after :all do
|
62
67
|
FileUtils.safe_unlink(@testfiles)
|
63
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openmeta.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zhao Cai
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-02 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|