Module: Wavesync::PythonVenv
- Defined in:
- lib/wavesync/python_venv.rb
Constant Summary collapse
- PYTHON_PATH =
File.('~/.wavesync-venv/bin/python3').freeze
Class Method Summary collapse
-
.available? ⇒ Boolean
: () -> bool.
-
.essentia_available? ⇒ Boolean
: () -> bool?.
-
.run_script(script, file_path) ⇒ Object
: (String script, String file_path) -> String.
Class Method Details
.available? ⇒ Boolean
: () -> bool
11 12 13 |
# File 'lib/wavesync/python_venv.rb', line 11 def self.available? File.executable?(PYTHON_PATH) end |
.essentia_available? ⇒ Boolean
: () -> bool?
16 17 18 |
# File 'lib/wavesync/python_venv.rb', line 16 def self.essentia_available? available? && system("#{PYTHON_PATH} -c 'import essentia' > /dev/null 2>&1") end |
.run_script(script, file_path) ⇒ Object
: (String script, String file_path) -> String
21 22 23 |
# File 'lib/wavesync/python_venv.rb', line 21 def self.run_script(script, file_path) `#{PYTHON_PATH} -c #{Shellwords.escape(script)} #{Shellwords.escape(file_path)} 2>/dev/null` end |