/etc/ngraph-gtk/init.d/20append_addins_ruby.nsc is in ngraph-gtk-plugin-ruby 6.07.02-2build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | if system::plugin_check ruby
then
true
else
exit
fi
if exist -q menu
then
new regexp name=ADDIN
regexp:ADDIN:@='^#\s*Description:\s*(.+)'
new regexp name=COMMENT
regexp:COMMENT:@='^#'
new io name=ADDIN
io:ADDIN:mode="r"
new sarray name=ADDIN
sarray::delimiter=","
for addin in "${system::home_dir}"/*.rb "${system::data_dir}"/addin/*.rb
do
if [ -f "$addin" ]
then
io:ADDIN:open "$addin"
while l=`get io -field gets`
do
if regexp:COMMENT:match "$l"
then
if regexp:ADDIN:match "$l"
then
sarray:ADDIN:split "${regexp:ADDIN:get:'0 1'}"
if [ ${sarray:ADDIN:num} -gt 3 ]
then
new sarray name=TMP
sarray:TMP:push "${sarray:ADDIN:shift}"
sarray:TMP:push "${sarray:ADDIN:shift}"
sarray:TMP:push "${sarray:ADDIN:join:','}"
cpy sarray:TMP,ADDIN @
del sarray:TMP
fi
if [ ${sarray:ADDIN:num} -eq 3 ]
then
sarray:ADDIN:put 2 "$addin ${sarray:ADDIN:get:2}"
else
sarray:ADDIN:put 2 "$addin"
fi
sarray:ADDIN:unshift "ruby.nsc"
menu::addin_list_append sarray:ADDIN
fi
else
break
fi
done
io:ADDIN:close
fi
done
del regexp:ADDIN
del regexp:COMMENT
del io:ADDIN
del sarray:ADDIN
fi
|