lib/ruby-processing/config.rb in ruby-processing-1.0.11 vs lib/ruby-processing/config.rb in ruby-processing-2.4.1
- old
+ new
@@ -1,6 +1,17 @@
-require "yaml"
+require 'psych'
module Processing
- CONFIG_FILE_PATH = File.expand_path("~/.rp5rc")
- CONFIG = (YAML::load_file(CONFIG_FILE_PATH) rescue {}).freeze
+
+ if Processing.exported?
+ CONFIG = {'PROCESSING_ROOT' => RP5_ROOT}
+ end
+
+ unless defined? CONFIG
+ begin
+ CONFIG_FILE_PATH=File.expand_path("~/.rp5rc")
+ CONFIG = (Psych.load_file(CONFIG_FILE_PATH))
+ rescue
+ warn("WARNING: you need to set PROCESSING_ROOT in ~/.rp5rc")
+ end
+ end
end