Class: Tex2png::Command
- Inherits:
-
Object
- Object
- Tex2png::Command
- Defined in:
- lib/tex2png/command.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(name) ⇒ Command
constructor
A new instance of Command.
- #run(*args) ⇒ Object
Constructor Details
#initialize(name) ⇒ Command
Returns a new instance of Command.
5 6 7 8 9 |
# File 'lib/tex2png/command.rb', line 5 def initialize(name) @name = name @path = IO.popen("which #{name}").read.chomp CommandNotFound.raise!(name) {path.empty?} end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/tex2png/command.rb', line 3 def name @name end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
3 4 5 |
# File 'lib/tex2png/command.rb', line 3 def out @out end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/tex2png/command.rb', line 3 def path @path end |