birdgrinder 0.1.1 → 0.1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -94,12 +94,15 @@ module BirdGrinder
94
94
  # set correctly so twitter users can see what it is replying
95
95
  # to.
96
96
  #
97
+ # Use the :type option to override the default reply behavior. For example,
98
+ # to reply to an @-mention via direct message, specify :type => :dm
99
+ #
97
100
  # @param [String] message the message to reply with
98
101
  # @see http://github.com/Sutto/perennial/blob/master/lib/perennial/dispatchable.rb
99
- def reply(message)
102
+ def reply(message, opts = {})
100
103
  message = message.to_s.strip
101
104
  return if @user.blank? || @client.blank? || message.blank?
102
- if @last_message_direct
105
+ if @last_message_direct || opts[:type].to_s == 'dm'
103
106
  @client.dm(@user, message)
104
107
  else
105
108
  opts = {}
@@ -131,4 +134,4 @@ module BirdGrinder
131
134
  end
132
135
 
133
136
  end
134
- end
137
+ end
@@ -38,7 +38,7 @@ module BirdGrinder
38
38
  else
39
39
  logger.debug "Got item, processing and scheduling next check"
40
40
  begin
41
- handle_action Yajl::Parser.parse(res)
41
+ process_action Yajl::Parser.parse(res)
42
42
  rescue Yajl::ParseError => e
43
43
  logger.error "Couldn't parse json: #{e.message}"
44
44
  end
data/lib/bird_grinder.rb CHANGED
@@ -8,7 +8,7 @@ require 'em-http'
8
8
  module BirdGrinder
9
9
  include Perennial
10
10
 
11
- VERSION = [0, 1, 1, 0]
11
+ VERSION = [0, 1, 1, 1]
12
12
 
13
13
  def self.version(include_minor = false)
14
14
  VERSION[0, (include_minor ? 4 : 3)].join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birdgrinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-26 00:00:00 +08:00
12
+ date: 2009-10-19 00:00:00 +08:00
13
13
  default_executable: birdgrinder
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -109,7 +109,7 @@ files:
109
109
  - test/bird_grinder_test.rb
110
110
  - test/test_helper.rb
111
111
  - examples/bird_grinder_client.rb
112
- has_rdoc: false
112
+ has_rdoc: true
113
113
  homepage: http://tyrannosexaraptor.com
114
114
  licenses: []
115
115
 
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements: []
134
134
 
135
135
  rubyforge_project:
136
- rubygems_version: 1.3.2
136
+ rubygems_version: 1.3.5
137
137
  signing_key:
138
138
  specification_version: 3
139
139
  summary: Evented Twitter Library of Doom