| 1 |
#!/usr/bin/ruby |
| 2 |
########################################################################## |
| 3 |
# Copyright (C) 2007 Ramos, Gastón - [email protected] |
| 4 |
# |
| 5 |
# This program is free software; you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation; either version 2 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
######################################################################### |
| 16 |
|
| 17 |
lib_path = File.expand_path(File.dirname(__FILE__)) |
| 18 |
lib_path = File.join lib_path, "../lib" |
| 19 |
|
| 20 |
require 'optparse' |
| •21 |
require File.join(lib_path, 'image_tooth') |
| 22 |
require File.join(lib_path, 'arg_parser') |
| 23 |
require 'ostruct' |
| 24 |
require 'pp' |
| 25 |
|
| 26 |
opt = ArgParser.parse(ARGV) |
| 27 |
|
| 28 |
if (opt.all and opt.folder) |
| 29 |
@img_tooth = ImageTooth.new |
| 30 |
@img_tooth.root_path = opt.folder |
| 31 |
@img_tooth.create_folders |
| 32 |
@img_tooth.gen_all |
| 33 |
elsif (opt.image and opt.folder) |
| 34 |
@img_tooth = ImageTooth.new |
| 35 |
@img_tooth.root_path = opt.folder |
| 36 |
@img_tooth.paint_img opt.image |
| 37 |
else |
| 38 |
ArgParser.parse(["-h"]) |
| 39 |
end |
| 40 |
|