Module: Ircnotify

Defined in:
lib/ircnotify.rb,
lib/ircnotify/main.rb,
lib/ircnotify/version.rb,
lib/ircnotify/notifier.rb,
lib/ircnotify/null_logger.rb

Defined Under Namespace

Classes: Notifier, NullLogger

Constant Summary collapse

IRC_CONF =
{}
VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.mainObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ircnotify/main.rb', line 3

def self.main
  options = ::Trollop::options do
    banner <<-EOS
    ircnotifier #{::Ircnotify::VERSION}
    Usage:
      ircnotifier <opts> --message "your message"

    Options:
    EOS
    opt :config, "Config file", :type => :string, :default => File.expand_path("~/.ircnotify")
    opt :message, "Your message", :type => :string, :default => 'test'
    opt :verbose, "Be very verbose", :type => :bool, :default => false
    # TODO
    # opt :notice, "Use /notice <channel>", :default => false
    # opt :channels, "Comma-delimited list or irc channels", :type => :string, :default => 'test'

  end

  IRC_CONF.merge! ::YAML::load_file File.expand_path options.delete(:config)
  notifier = Ircnotify::Notifier.new  options.delete(:message), options.delete(:verbose)
  notifier.notify

end