class Object
Public Instance Methods
clean_vars(dir)
click to toggle source
# File lib/alphred/tasks.rb, line 66 def clean_vars(dir) info_plist = File.join(dir, 'info.plist') vars = `/usr/libexec/PlistBuddy -c "Print :variablesdontexport" #{info_plist}` return if vars.empty? vars = vars.split("\n")[1..-2].map(&:strip) vars.each do |var| sh "/usr/libexec/PlistBuddy -c \"Set :variables:#{var} ''\" #{info_plist}" end end
restore_bundler_config() { || ... }
click to toggle source
# File lib/alphred/tasks.rb, line 50 def restore_bundler_config path = File.join(workflow_dir, '.bundle', 'config') config = File.read(path) yield ensure File.write(path, config, mode: ?w) end
vendor_deps()
click to toggle source
# File lib/alphred/tasks.rb, line 58 def vendor_deps args = %w[ --standalone --path vendor/bundle --without development test ] cmd = "bundle install #{args.join(' ')}" sh "chruby-exec 2.0.0 -- #{cmd}" end
workflow_dir()
click to toggle source
# File lib/alphred/tasks.rb, line 89 def workflow_dir Rake.application.original_dir end
workflow_name()
click to toggle source
# File lib/alphred/tasks.rb, line 85 def workflow_name workflow_dir.pathmap('%f') end
zip_workflow(dir)
click to toggle source
# File lib/alphred/tasks.rb, line 77 def zip_workflow(dir) cd dir do output = File.join(workflow_dir, workflow_name.pathmap('%n.alfredworkflow')) sh "zip -rq #{output} *" end end