Class: LaunchdTools::PathParser
- Inherits:
-
Object
- Object
- LaunchdTools::PathParser
- Defined in:
- lib/launchd_tools/path_parser.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#xml_doc ⇒ Object
readonly
Returns the value of attribute xml_doc.
Instance Method Summary collapse
-
#initialize(path) ⇒ PathParser
constructor
A new instance of PathParser.
-
#parse ⇒ Object
returns a parsed launchd job.
- #parse_env ⇒ Object
- #parse_program_args ⇒ Object
Constructor Details
#initialize(path) ⇒ PathParser
Returns a new instance of PathParser.
11 12 13 |
# File 'lib/launchd_tools/path_parser.rb', line 11 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/launchd_tools/path_parser.rb', line 10 def path @path end |
#xml_doc ⇒ Object (readonly)
Returns the value of attribute xml_doc.
10 11 12 |
# File 'lib/launchd_tools/path_parser.rb', line 10 def xml_doc @xml_doc end |
Instance Method Details
#parse ⇒ Object
returns a parsed launchd job
16 17 18 |
# File 'lib/launchd_tools/path_parser.rb', line 16 def parse LaunchdJob.new({ 'EnvironmentVariables' => parse_env, 'ProgramArguments' => parse_program_args }) end |
#parse_env ⇒ Object
20 21 22 23 |
# File 'lib/launchd_tools/path_parser.rb', line 20 def parse_env variables = EnvironmentParser.new(xml_doc).parse EnvironmentVariables.new(variables).to_a end |
#parse_program_args ⇒ Object
25 26 27 |
# File 'lib/launchd_tools/path_parser.rb', line 25 def parse_program_args ProgramArgsParser.new(xml_doc).parse end |