Skip to content

Commit

Permalink
Update and install import.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
tach committed Aug 8, 2008
1 parent 46a7cee commit e6ca82b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
3 changes: 2 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include /usr/share/cdbs/1/rules/debhelper.mk
RUBYLIBDIR = $(shell ruby -rrbconfig -e "puts RbConfig::CONFIG['rubylibdir']")

install/rbphoto::
mkdir -p $(DEB_DESTDIR)/$(RUBYLIBDIR)
mkdir -p $(DEB_DESTDIR)/$(RUBYLIBDIR)/rbphoto
install -m 755 bin/* $(DEB_DESTDIR)/usr/bin/
install -m 755 lib/rbphoto.rb $(DEB_DESTDIR)/$(RUBYLIBDIR)
install -m 755 lib/rbphoto/import.rb $(DEB_DESTDIR)/$(RUBYLIBDIR)/rbphoto
52 changes: 27 additions & 25 deletions lib/rbphoto/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,6 @@ def datetime
end

class RbPhoto
class Args < Hash
def initialize
parser = GetoptLong.new(
['--datedir', '-D', GetoptLong::NO_ARGUMENT],
['--force', '-f', GetoptLong::NO_ARGUMENT],
['--no-gui', '-G', GetoptLong::NO_ARGUMENT],
['--help', '-h', GetoptLong::NO_ARGUMENT],
['--with-movie', '-M', GetoptLong::NO_ARGUMENT],
['--move', '-m', GetoptLong::NO_ARGUMENT],
['--without-rename', '-N', GetoptLong::NO_ARGUMENT],
['--no-act', '-n', GetoptLong::NO_ARGUMENT],
['--photographer', '-p', GetoptLong::REQUIRED_ARGUMENT],
['--version', '-V', GetoptLong::NO_ARGUMENT],
['--verbose', '-v', GetoptLong::NO_ARGUMENT])
begin
parser.each do |name, arg|
arg = true if (arg == "")
self[name.sub(/^--/, '').gsub(/-/, '_').downcase] = arg
end
rescue
self['help'] = true
end
end
end

class Import
include GetText
bindtextdomain("rbphoto")
Expand Down Expand Up @@ -198,6 +173,33 @@ def version
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
_EOT
end

class Options
def initialize
parser = GetoptLong.new(
['--datedir', '-D', GetoptLong::NO_ARGUMENT],
['--force', '-f', GetoptLong::NO_ARGUMENT],
['--no-gui', '-G', GetoptLong::NO_ARGUMENT],
['--help', '-h', GetoptLong::NO_ARGUMENT],
['--with-movie', '-M', GetoptLong::NO_ARGUMENT],
['--move', '-m', GetoptLong::NO_ARGUMENT],
['--without-rename', '-N', GetoptLong::NO_ARGUMENT],
['--no-act', '-n', GetoptLong::NO_ARGUMENT],
['--photographer', '-p', GetoptLong::REQUIRED_ARGUMENT],
['--version', '-V', GetoptLong::NO_ARGUMENT],
['--verbose', '-v', GetoptLong::NO_ARGUMENT])
begin
parser.each do |name, arg|
arg = true if (arg == "")
name = name.sub(/^--/, '').gsub(/-/, '_').downcase
instance_variable_set("@#{name}", arg)
end
rescue
@help = true
end
end
attr_accessor :datedir :force :no_gui :help :with_movie :move :without_rename :no_act :photographer :version :verbose
end
end
end

Expand Down

0 comments on commit e6ca82b

Please sign in to comment.