openmeta.rb 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -3
- data/lib/openmeta/cli.rb +16 -0
- data/lib/openmeta/version.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
|
1
|
+
1.0.4 / 2013-03-23
|
2
|
+
==================
|
3
|
+
* add 'add' tag command
|
4
|
+
* add remove tag command
|
2
5
|
|
3
|
-
|
6
|
+
1.0.0 / 2012-10-12
|
7
|
+
==================
|
4
8
|
|
5
|
-
*
|
9
|
+
* Disable JIT optimization to save loading time
|
10
|
+
* Implemented "clone" and "recent" command
|
11
|
+
* Port OpenMeta as framework
|
6
12
|
|
data/lib/openmeta/cli.rb
CHANGED
@@ -77,6 +77,22 @@ module Openmeta
|
|
77
77
|
Openmeta.set_tags(tags, file)
|
78
78
|
end
|
79
79
|
|
80
|
+
desc "add", "add openmeta tags, use ',' to separate multiple tags"
|
81
|
+
method_option :tag,
|
82
|
+
:aliases => "-t" ,
|
83
|
+
:lazy_default => '' ,
|
84
|
+
:type => :string ,
|
85
|
+
:desc => "add tags, use ',' to separate multiple tags"
|
86
|
+
def add(file)
|
87
|
+
tags = options[:tag].split(',')
|
88
|
+
existing_tags = Openmeta.get_tags(file)
|
89
|
+
# union
|
90
|
+
tags |= existing_tags
|
91
|
+
unless tags.eql? existing_tags
|
92
|
+
Openmeta.set_tags(tags, file)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
80
96
|
desc "remove", "remove openmeta tags, use ',' to separate multiple tags"
|
81
97
|
method_option :tag,
|
82
98
|
:aliases => "-t" ,
|
data/lib/openmeta/version.rb
CHANGED