hipchat_bot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +19 -5
- data/lib/hipchat_bot.rb +6 -1
- data/lib/hipchat_bot/version.rb +1 -1
- metadata +105 -95
data/README.md
CHANGED
@@ -2,13 +2,28 @@
|
|
2
2
|
|
3
3
|
Simple and configurable bot for Hipchat!
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
**NOTE**: Originally adapted from [happy_fun_time_bot](https://github.com/gammons/happy_fun_time_bot),
|
6
|
+
but revised with a new shorter name, some improvements
|
7
|
+
and to work on Ruby 1.9.3 since the original does not seem to work.
|
7
8
|
|
8
|
-
100% of the credit to https://github.com/gammons/happy_fun_time_bot
|
9
|
+
100% of the credit for this goes to [happy_fun_time_bot](https://github.com/gammons/happy_fun_time_bot)
|
9
10
|
and [gammons](https://github.com/gammons) for this gem. I just made it work on 1.9.3
|
10
11
|
|
11
|
-
|
12
|
+
First install the gem:
|
13
|
+
|
14
|
+
Add this line to your application's Gemfile:
|
15
|
+
|
16
|
+
gem 'hipchat_bot'
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install hipchat_bot
|
25
|
+
|
26
|
+
Now let's take a look at how this works:
|
12
27
|
|
13
28
|
```ruby
|
14
29
|
#!/usr/bin/env ruby
|
@@ -70,5 +85,4 @@ HipChat Bot: Deploying now!
|
|
70
85
|
|
71
86
|
## Copyright
|
72
87
|
|
73
|
-
Copyright (c) 2012 Nathan Esquenazi. See LICENSE.txt for further details.
|
74
88
|
Copyright (c) 2011 Grant Ammons. See LICENSE.txt for further details.
|
data/lib/hipchat_bot.rb
CHANGED
@@ -47,6 +47,11 @@ class HipchatBot
|
|
47
47
|
loop { sleep 1 }
|
48
48
|
end
|
49
49
|
|
50
|
+
# @hipchat.say "HELLO"
|
51
|
+
def say(message)
|
52
|
+
send_response(message)
|
53
|
+
end
|
54
|
+
|
50
55
|
private
|
51
56
|
|
52
57
|
def process(from, command)
|
@@ -55,7 +60,7 @@ class HipchatBot
|
|
55
60
|
responders.select {|r| r.responds_to?($1) }.map do |responder|
|
56
61
|
args = command.split
|
57
62
|
args.shift
|
58
|
-
ret =
|
63
|
+
ret = instance_exec(from, args.join(' '), &responder.block)
|
59
64
|
send_response(ret)
|
60
65
|
ret
|
61
66
|
end
|
data/lib/hipchat_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,119 +1,119 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hipchat_bot
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Nathan Esquenazi
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-11-14 00:00:00 -08:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: xmpp4r
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: json
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
33
25
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
38
33
|
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: json
|
39
37
|
prerelease: false
|
40
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
54
47
|
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: httparty
|
55
51
|
prerelease: false
|
56
|
-
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
53
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
63
64
|
name: rspec
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '2'
|
70
|
-
type: :development
|
71
65
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '2'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: yard
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
81
67
|
none: false
|
82
|
-
requirements:
|
68
|
+
requirements:
|
83
69
|
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 7
|
72
|
+
segments:
|
73
|
+
- 2
|
74
|
+
version: "2"
|
86
75
|
type: :development
|
76
|
+
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: yard
|
87
79
|
prerelease: false
|
88
|
-
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
81
|
none: false
|
90
|
-
requirements:
|
82
|
+
requirements:
|
91
83
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 7
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
- 6
|
89
|
+
- 0
|
93
90
|
version: 0.6.0
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: bundler
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ~>
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '1'
|
102
91
|
type: :development
|
92
|
+
version_requirements: *id005
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: bundler
|
103
95
|
prerelease: false
|
104
|
-
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
105
97
|
none: false
|
106
|
-
requirements:
|
98
|
+
requirements:
|
107
99
|
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 1
|
102
|
+
segments:
|
103
|
+
- 1
|
104
|
+
version: "1"
|
105
|
+
type: :development
|
106
|
+
version_requirements: *id006
|
110
107
|
description: Easily create hipchat bots that can respond to anything!
|
111
|
-
email:
|
108
|
+
email:
|
112
109
|
- nesquena@gmail.com
|
113
110
|
executables: []
|
111
|
+
|
114
112
|
extensions: []
|
113
|
+
|
115
114
|
extra_rdoc_files: []
|
116
|
-
|
115
|
+
|
116
|
+
files:
|
117
117
|
- .gitignore
|
118
118
|
- Gemfile
|
119
119
|
- LICENSE.txt
|
@@ -129,30 +129,40 @@ files:
|
|
129
129
|
- lib/responder.rb
|
130
130
|
- spec/hip_chat_spec.rb
|
131
131
|
- spec/spec_helper.rb
|
132
|
+
has_rdoc: true
|
132
133
|
homepage: http://github.com/bazaarlabs/hipchat_bot
|
133
134
|
licenses: []
|
135
|
+
|
134
136
|
post_install_message:
|
135
137
|
rdoc_options: []
|
136
|
-
|
138
|
+
|
139
|
+
require_paths:
|
137
140
|
- lib
|
138
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
139
142
|
none: false
|
140
|
-
requirements:
|
141
|
-
- -
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
|
144
|
-
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
hash: 3
|
147
|
+
segments:
|
148
|
+
- 0
|
149
|
+
version: "0"
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
151
|
none: false
|
146
|
-
requirements:
|
147
|
-
- -
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
hash: 3
|
156
|
+
segments:
|
157
|
+
- 0
|
158
|
+
version: "0"
|
150
159
|
requirements: []
|
160
|
+
|
151
161
|
rubyforge_project:
|
152
|
-
rubygems_version: 1.
|
162
|
+
rubygems_version: 1.6.2
|
153
163
|
signing_key:
|
154
164
|
specification_version: 3
|
155
165
|
summary: Simple XMPP bot framework
|
156
|
-
test_files:
|
166
|
+
test_files:
|
157
167
|
- spec/hip_chat_spec.rb
|
158
168
|
- spec/spec_helper.rb
|