Sha256: 46f07f9a1e9f8129a5fad301f61f575651294d77ac7721e683ef71acc37c5f11
Contents?: true
Size: 1.12 KB
Versions: 5
Compression:
Stored size: 1.12 KB
Contents
= Launchd Plist Example In this example, we edit an Apple Launchd plist, to modify a couple of the keys and write them back to the same file. For setting the plist file attributes see {Plist4r::Plist}. For more information specifically about Launchd Plists, see {Plist4r::PlistType::Launchd}. # standard method launchd_plist = Plist4r.open "/Library/LaunchDaemons/com.mydomain.MyApp.plist" launchd_plist[:label] # => "com.mydomain.Myapp" launchd_plist[:start_on_mount] = true launchd_plist.save # block method launchd_plist = Plist4r.open "/Library/LaunchDaemons/com.mydomain.MyApp.plist" do # plist attributes filename # => "/Library/LaunchDaemons/com.mydomain.MyApp.plist" file_format # => :xml plist_type # => :launchd # read label # => "com.mydomain.Myapp" program_arguments # => ["/Applications/MyApp.app/Contents/MacOS/MyApp"] queue_directories # => ["/dir/to/watch/1","/dir/to/watch/2","etc..."] run_at_load # => false start_on_mount # => false # write run_at_load true store "StartOnMount" true # call launchd_plist.save save end
Version data entries
5 entries across 5 versions & 1 rubygems