poundie 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +6 -1
- data/lib/poundie/plugin.rb +16 -1
- data/lib/poundie/plugins/debug.rb +15 -0
- data/lib/poundie.rb +1 -0
- metadata +8 -5
data/README.md
CHANGED
@@ -53,4 +53,9 @@ What can you do in the `action`?
|
|
53
53
|
tweet "https://twitter.com/steve_martocci/status/69140542038097921"
|
54
54
|
paste "Some long text"
|
55
55
|
|
56
|
-
That's about it for now.
|
56
|
+
That's about it for now.
|
57
|
+
|
58
|
+
## Available Plugins
|
59
|
+
|
60
|
+
* [poundie-last-tweet](https://github.com/nakajima/poundie-last-tweet) - Posts the last tweet from a given Twitter user to campfire
|
61
|
+
* [poundie-weather](https://github.com/nakajima/poundie-weather) - Posts weather information for a given city to campfire
|
data/lib/poundie/plugin.rb
CHANGED
@@ -21,13 +21,28 @@ module Poundie
|
|
21
21
|
define_method(:perform, &block)
|
22
22
|
end
|
23
23
|
|
24
|
+
def self.prefix(regex, &block)
|
25
|
+
match do |message|
|
26
|
+
message.body =~ regex
|
27
|
+
end
|
28
|
+
|
29
|
+
action do |message|
|
30
|
+
instance_exec(message.body.gsub(regex, ''), &block)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
24
34
|
def initialize(room)
|
25
35
|
@room = room
|
26
36
|
end
|
27
37
|
|
28
38
|
def call(message)
|
29
39
|
message = Poundie::Campfire::Message.new(message)
|
30
|
-
|
40
|
+
begin
|
41
|
+
match?(message) && perform(message)
|
42
|
+
rescue => e
|
43
|
+
puts "ERROR: #{e.message}"
|
44
|
+
raise e
|
45
|
+
end
|
31
46
|
end
|
32
47
|
|
33
48
|
private
|
data/lib/poundie.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poundie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pat Nakajima
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-13 00:00:00
|
18
|
+
date: 2011-05-13 00:00:00 -04:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: tinder
|
@@ -62,7 +63,9 @@ files:
|
|
62
63
|
- lib/poundie/campfire/user.rb
|
63
64
|
- lib/poundie/plugin.rb
|
64
65
|
- lib/poundie/plugins/greeter.rb
|
66
|
+
- lib/poundie/plugins/debug.rb
|
65
67
|
- lib/poundie/runner.rb
|
68
|
+
has_rdoc: true
|
66
69
|
homepage:
|
67
70
|
licenses: []
|
68
71
|
|
@@ -92,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
95
|
requirements: []
|
93
96
|
|
94
97
|
rubyforge_project:
|
95
|
-
rubygems_version: 1.
|
98
|
+
rubygems_version: 1.6.2
|
96
99
|
signing_key:
|
97
100
|
specification_version: 3
|
98
101
|
summary: A campfire bot
|