lib/rconf/support/environment_updater.rb in rconf-0.7.13 vs lib/rconf/support/environment_updater.rb in rconf-0.7.15

- old
+ new

@@ -26,9 +26,25 @@ # # === Return # true:: If bash resource or profile file was updated # false:: Otherwise def self.update(code, dependencies=[]) + new.do_update(code, dependencies) + end + + # Update bash resource or profile file to define given environment variable + # or append to existing environment variable + # + # === Parameters + # code(String):: Code to be inserted in bash resource file + # dependencies(Array):: List of environment variables that code will update + # (Use to put code after these env var are set in the + # existing bash resource file) + # + # === Return + # true:: If bash resource or profile file was updated + # false:: Otherwise + def do_update(code, dependencies=[]) if Platform.darwin? candidates = [ '.bash_profile' ] else candidates = ['.bash_profile', '.bashrc'] end