Jump to content

tylerw

Member
  • Posts

    5
  • Joined

  • Last visited

Everything posted by tylerw

  1. @vitor I'd just like to point out how amazing it is that, Google Drive use-case aside, you've built an entire replacement for spotlight written in SQLite on top of Alfred!!! I've now been able to switch out some File Filters for your Script Filter in custom workflows I use, with capabilities like restricting the file type to directories and restricting the scope to particular subdirectories (using the filter variable above). Theoretically, any of us could use this on top of our whole OS drive by changing the path to '~/' and completely disable spotlight indexing!
  2. I wanted to change it dynamically so in the end I did this: Filter = "#{filter}%" Results = db.execute("SELECT fullpath FROM main WHERE #{Array.new(Query.length, 'basename LIKE ?').join(' AND ')} AND fullpath like ? ORDER BY accesstime DESC LIMIT ?;", Query, Filter, Limit).flatten Here's the error I get when I run `gem install pathname` I've substituted my username with $USER current directory: /Users/$USER/.gem/gems/pathname-0.1.0/ext/pathname /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210903-70329-wn4b37.rb extconf.rb checking for rb_file_s_birthtime()... no creating Makefile current directory: /Users/$USER/.gem/gems/pathname-0.1.0/ext/pathname make "DESTDIR=" clean current directory: /Users/$USER/.gem/gems/pathname-0.1.0/ext/pathname make "DESTDIR=" compiling pathname.c pathname.c:388:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_funcallv_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:388:12: note: did you mean 'rb_funcallv'? /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1870:7: note: 'rb_funcallv' declared here VALUE rb_funcallv(VALUE, ID, int, const VALUE*); ^ pathname.c:388:57: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_funcallv_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:429:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_funcallv_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:429:58: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_funcallv_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:450:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:450:61: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:472:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_funcallv_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:472:62: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_funcallv_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:680:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_block_call_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:680:16: note: did you mean 'rb_block_call'? /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1951:7: note: 'rb_block_call' declared here VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE); ^ pathname.c:680:69: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_block_call_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:683:16: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:683:61: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:1099:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:1099:77: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:1104:15: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:1104:57: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS' ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS); ^ pathname.c:1147:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return rb_block_call_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS); ^ pathname.c:1147:74: error: use of undeclared identifier 'RB_PASS_KEYWORDS' return rb_block_call_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS); ^ pathname.c:1152:15: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_KEYWORDS); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make: *** [pathname.o] Error 1 make failed, exit code 2 It seems to me that pathname is a built-inclass Worst case you can just do something like? begin require 'pathname' rescue LoadError puts "gem 'pathname' is not installed" system("gem install pathname") end
  3. That worked, thanks so much @vitor. Any suggestions on restricting scope to search a particular sub-directory within Google Drive? For example, suppose I want `gdd` to search `/Volumes/GoogleDrive/My Drive/dev/` (this is just an example, not my exact use case, I'm actually looking to just make my gdf workflow customizable for where it searches)
  4. I just tried building the cache and was running into an error. I eventually found that the error was due to `gem install pathname` failing. Finally, I realized my ruby already has `pathname` as a default library, and I was able to get the workflow working by changing the code to: ``` require 'pathname' gemfile do source 'https://rubygems.org' gem 'json' gem 'sqlite3' end ``` In other words, I moved pathname from being a gem to simply being required. The SQLite solution also works quite well despite the fact that with no exclusions it is a (relatively) massive 32MB database. It would be really nice to exclude some folders when we get around to that. One functionality I would also love to have is a way to filter only for folders. Maybe this is possible already? How would I create a workflow called `gdf` that filters the results to only show directories?
  5. Hey all, So I used to use BOTH Backup and Sync AND Drive File Stream, and now that I've been forced by Google to transition and consolidate I have major Spotlight issues. @vitor Your solution seems great. However, I was wondering if you could add exclusions? I have dev folders that have thousands of tiny files that I used to exclude from spotlight using Privacy before GDFS stopped working with spotlight.
×
×
  • Create New...