ircnotify 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -58,16 +58,14 @@ By default `ircnofity` reads the config from `~/.ircnotify`
58
58
 
59
59
 
60
60
  ```
61
- Options:
62
- ircnotifier 0.0.1
63
61
  Usage:
64
62
  ircnotifier <opts> --message "your message"
65
63
 
66
64
  Options:
67
- --config, -c <s>: Config file (default: /Users/lukasz/.ircnotifier)
68
- --message, -m <s>: Your message (default: test)
69
- --help, -e: Show this message
70
-
65
+ --config, -c <s>: Config file (default: /Users/lukasz/.ircnotify)
66
+ --message, -m <s>: Your message (default: test)
67
+ --verbose, -v: Be very verbose (default off)
68
+ --help, -h: Show this message
71
69
  ```
72
70
 
73
71
  ## Installation
data/ircnotify.gemspec CHANGED
@@ -18,4 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
  gem.add_runtime_dependency "cinch", ">= 0"
20
20
  gem.add_runtime_dependency "trollop", ">= 0"
21
+ gem.add_development_dependency "pry", ">= 0"
21
22
  end
@@ -11,6 +11,7 @@ module Ircnotify
11
11
  EOS
12
12
  opt :config, "Config file", :type => :string, :default => File.expand_path("~/.ircnotify")
13
13
  opt :message, "Your message", :type => :string, :default => 'test'
14
+ opt :verbose, "Be very verbose", :type => :bool, :default => false
14
15
  # TODO
15
16
  # opt :notice, "Use /notice <channel>", :default => false
16
17
  # opt :channels, "Comma-delimited list or irc channels", :type => :string, :default => 'test'
@@ -18,7 +19,7 @@ module Ircnotify
18
19
  end
19
20
 
20
21
  IRC_CONF.merge! ::YAML::load_file File.expand_path options.delete(:config)
21
- notifier = Ircnotify::Notifier.new options.delete(:message)
22
+ notifier = Ircnotify::Notifier.new options.delete(:message), options.delete(:verbose)
22
23
  notifier.notify
23
24
 
24
25
  end
@@ -1,7 +1,8 @@
1
1
  module Ircnotify
2
2
  class Notifier
3
- def initialize message, is_notice=false
3
+ def initialize message, verbose=false
4
4
  @bot = ::Cinch::Bot.new do
5
+ self.loggers = NullLogger.new if not verbose
5
6
  configure do |c|
6
7
  # TODO FIXME
7
8
  # this doesn't handle all nested config options!
@@ -0,0 +1,6 @@
1
+ module Ircnotify
2
+ class NullLogger
3
+ def method_missing *args
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Ircnotify
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/ircnotify.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  require 'trollop'
2
2
  require 'cinch'
3
3
  require 'yaml'
4
+ require 'logger'
4
5
  require File.expand_path("../ircnotify/version", __FILE__)
5
6
  require File.expand_path("../ircnotify/main", __FILE__)
7
+ require File.expand_path("../ircnotify/null_logger",__FILE__)
6
8
  require File.expand_path("../ircnotify/notifier",__FILE__)
7
9
 
8
10
  module Ircnotify
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ircnotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-05 00:00:00.000000000 Z
12
+ date: 2012-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cinch
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: pry
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
46
62
  description: Send a message to your IRC server/channel straight from the terminal
47
63
  email:
48
64
  - lukasz@coffeesounds.com
@@ -62,6 +78,7 @@ files:
62
78
  - lib/ircnotify.rb
63
79
  - lib/ircnotify/main.rb
64
80
  - lib/ircnotify/notifier.rb
81
+ - lib/ircnotify/null_logger.rb
65
82
  - lib/ircnotify/version.rb
66
83
  homepage: ''
67
84
  licenses: []