10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/peaberry/plist_installer.rb', line 10
def install
dir = File.dirname(PLIST_PATH)
FileUtils.mkdir_p(dir) unless FileTest.directory?(dir)
open(PLIST_PATH, 'w') do |plist|
ruby_bin_path =
if RbConfig.respond_to?(:ruby)
RbConfig.ruby
else
File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
end
peaberry_script_path = File.expand_path(File.join(File.dirname(__FILE__), '../../bin/peaberry'))
plist.print ERB.new(File.read(PLIST_ERB_PATH)).result(binding)
end
system 'launchctl', 'load', PLIST_PATH
end
|