hipbot 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,5 +58,11 @@ Run `hipbot` to see all available commands.
58
58
 
59
59
  ## TODO:
60
60
 
61
- * add support for custom response helpers
62
- * error handling, reconnecting
61
+ * add support for custom helpers
62
+ * mentions - returns list of @mentions in message
63
+ * sender_name - returns sender's first name
64
+ * allow injecting custom module to response object, adding arbitrary methods
65
+ * handle reconnecting after disconnect/failure
66
+ * add support for multiple regexps for one response
67
+ * add support for responses in particular room (`on //, :room => ['public'] do ...`)
68
+ * add extended logging
data/bot.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative './lib/hipbot'
1
+ require 'hipbot'
2
2
 
3
3
  class MyBot < Hipbot::Bot
4
4
  configure do |c|
@@ -14,4 +14,10 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "hipbot"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Hipbot::VERSION
17
+ gem.add_runtime_dependency "daemons", ["~> 1.1.8"]
18
+ gem.add_runtime_dependency "active_support", ["~> 3.0.0"]
19
+ gem.add_runtime_dependency "eventmachine", ["~> 0.12.10"]
20
+ gem.add_runtime_dependency "em-http-request", ["~> 0.3.0"]
21
+ gem.add_runtime_dependency "xmpp4r", ["~> 0.5"]
22
+ gem.add_runtime_dependency "google-weather", ["~> 0.3.0"]
17
23
  end
@@ -46,7 +46,11 @@ module Hipbot
46
46
  room.connection = ::Jabber::MUC::SimpleMUCClient.new(@jabber)
47
47
  room.connection.on_message do |time, sender, message|
48
48
  puts "#{Time.now} <#{sender}> #{message}"
49
- @bot.tell(sender, room.name, message)
49
+ begin
50
+ @bot.tell(sender, room.name, message)
51
+ rescue => e
52
+ puts e.inspect
53
+ end
50
54
  end
51
55
  room.connection.join("#{room.jid}/#{@bot.name}", nil, :history => false)
52
56
  end
@@ -70,6 +74,9 @@ module Hipbot
70
74
 
71
75
  def start!
72
76
  ::EM::run do
77
+ ::EM.error_handler do |e|
78
+ puts e.inspect
79
+ end
73
80
  Connection.new(self)
74
81
  end
75
82
  end
@@ -1,3 +1,3 @@
1
1
  module Hipbot
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hipbot
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,8 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-20 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2012-07-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: daemons
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.1.8
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.1.8
30
+ - !ruby/object:Gem::Dependency
31
+ name: active_support
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 3.0.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 3.0.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: eventmachine
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.12.10
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.12.10
62
+ - !ruby/object:Gem::Dependency
63
+ name: em-http-request
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.3.0
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.3.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: xmpp4r
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '0.5'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '0.5'
94
+ - !ruby/object:Gem::Dependency
95
+ name: google-weather
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 0.3.0
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 0.3.0
14
110
  description: Hipbot is a bot for HipChat, written in ruby & eventmachine.
15
111
  email:
16
112
  - pewniak747@gmail.com