Class: Mir::Runner
- Inherits:
-
Object
- Object
- Mir::Runner
- Defined in:
- lib/mir/01_runner.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.run(*arguments) ⇒ Object
7 8 9 |
# File 'lib/mir/01_runner.rb', line 7 def self.run *arguments new.run(arguments) end |
Instance Method Details
#header ⇒ Object
27 28 29 |
# File 'lib/mir/01_runner.rb', line 27 def header puts "Mir (#{VERSION}) - (c) JC Le Lann 2023" end |
#run(arguments) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mir/01_runner.rb', line 11 def run arguments = args = (arguments) begin if filename=args[:file] image=Mir::Image.open(filename) viewer=ViewerApp.new(image) viewer.run else raise "need a ppm file : mir [options] <file>" end rescue Exception => e puts e unless [:mute] return false end end |