tmsu_file_db 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d650f6e958d2689681efefb8e199dce96853ac12
4
- data.tar.gz: e7ba48721c169bae0ee59e269b0863972d22bfdb
3
+ metadata.gz: 44e2db9c6b87629dbeb04018c902da5c14f3903e
4
+ data.tar.gz: a479d18bfb23ae3f5d06e177d72e7a217428feef
5
5
  SHA512:
6
- metadata.gz: c338e64470b4093743bc8f7b92e47698aa315560ac7904dd30014f8cd23dc6c6d970853a4c32b28788148d2e43850d7cabfd561bf03f335b78e11e09ed2b42c9
7
- data.tar.gz: a0d1574e6738232cbb320db2e73fa63dc7941751caa276e8e080e925dd04f716a5af196bd9c121cb64e41d818053e0a2e4c432a0c4d6057ddd5d4a8f195e9cc2
6
+ metadata.gz: 878e34ef217703a3cfda79fd036e45a07da3cabd4e11c7a08b5c96652c4fab85603905dd4e3b36358b86cb0fbd67ae26219176dd04749cda4f643e87f7ff8788
7
+ data.tar.gz: e1b9dbb32d1cc0be91e9910c643f326b09d7067b53b0885ccffd5895d03612ac536da15cdd638113b29eb0ab42d2d8b29c047eeb3a11b27102060f7af5b91966
data/README.md CHANGED
@@ -163,3 +163,6 @@ TmsuRuby.file.files("foo")
163
163
  ```
164
164
 
165
165
 
166
+ **Test && Examples**
167
+
168
+ See [automated_tests.rb](./automated_tests.rb), which can double as usage examples.
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).paths_query(string).map &method(:from_file)
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
@@ -1,3 +1,3 @@
1
1
  module TmsuFileDb
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmsu_file_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxpleaner