tmsu_file_db 0.0.3 → 0.0.4
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/README.md +3 -0
- data/lib/tmsu_file_db.rb +7 -10
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44e2db9c6b87629dbeb04018c902da5c14f3903e
|
4
|
+
data.tar.gz: a479d18bfb23ae3f5d06e177d72e7a217428feef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 878e34ef217703a3cfda79fd036e45a07da3cabd4e11c7a08b5c96652c4fab85603905dd4e3b36358b86cb0fbd67ae26219176dd04749cda4f643e87f7ff8788
|
7
|
+
data.tar.gz: e1b9dbb32d1cc0be91e9910c643f326b09d7067b53b0885ccffd5895d03612ac536da15cdd638113b29eb0ab42d2d8b29c047eeb3a11b27102060f7af5b91966
|
data/README.md
CHANGED
data/lib/tmsu_file_db.rb
CHANGED
@@ -90,7 +90,7 @@ class TmsuModel
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def self.query string
|
93
|
-
TmsuRuby.file(query_glob).
|
93
|
+
TmsuRuby.file(query_glob).files(string).map &method(:from_file)
|
94
94
|
end
|
95
95
|
|
96
96
|
def self.update_all opts={}
|
@@ -299,13 +299,6 @@ module TmsuFileAPI
|
|
299
299
|
end
|
300
300
|
end
|
301
301
|
|
302
|
-
def paths_query(query)
|
303
|
-
query_root = %{#{vfs_path}/queries/"#{query}"}
|
304
|
-
system("ls #{query_root}").split("\n").map do |filename|
|
305
|
-
system("readlink #{query_root}/#{filename}").chomp
|
306
|
-
end
|
307
|
-
end
|
308
|
-
|
309
302
|
def untag tag_list
|
310
303
|
`touch #{path}`
|
311
304
|
system "tmsu untag #{path} #{tag_list}"
|
@@ -359,7 +352,7 @@ module TmsuFileAPI
|
|
359
352
|
end
|
360
353
|
|
361
354
|
def files(tag_obj)
|
362
|
-
system("tmsu files #{build_tag_arg tag_obj }").split("\n")
|
355
|
+
system("tmsu files --path #{path} #{build_tag_arg tag_obj }").split("\n")
|
363
356
|
end
|
364
357
|
|
365
358
|
end
|
@@ -371,11 +364,15 @@ class TmsuRuby
|
|
371
364
|
TmsuRuby::TmsuFile.new path, vfs_path
|
372
365
|
end
|
373
366
|
|
367
|
+
def self.dir(*args)
|
368
|
+
file *args
|
369
|
+
end
|
370
|
+
|
374
371
|
class TmsuFile
|
375
372
|
include TmsuFileAPI
|
376
373
|
attr_reader :path, :vfs_path
|
377
374
|
def initialize path, vfs_path
|
378
|
-
@path = path
|
375
|
+
@path = path || "."
|
379
376
|
@vfs_path = vfs_path
|
380
377
|
end
|
381
378
|
end
|
data/lib/version.rb
CHANGED