ruboty-twitter 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7054de4e663ec545a91db7e9ee46ed65b1f03f7d
4
- data.tar.gz: 1466ec57e52cf3a1d4f93b953e12310ff94f133c
3
+ metadata.gz: 068eb5924c62fb807884d13e940f99c6d3473206
4
+ data.tar.gz: 1633c0ab9edff3e66b4b6c86ccd0c623c1bbbfaa
5
5
  SHA512:
6
- metadata.gz: 66a42d14f1052889e21685453469785a5564a83022cfee39ff66ef297ce7bea756f165b3643d6bb20a99c24616dc3f8e3149dd4f2449c85edae056cdffe6024d
7
- data.tar.gz: d8d794a754805b66b3b8de31711b27b97c398aa83c4b86618c49e66efe4562bbd3c4dccc9163607ed94f13b1b24cf3aef30bdf66c62f8b7a7a292f2a9a35d8cf
6
+ metadata.gz: 18c5d74679c8f8d91d3d93eacaec0c6f24ad41e1fb3e475441aa206ac6874cdb3376f786987f9fcd025201c2e6578ebb6fca78a8666249ede2b37948c204b252
7
+ data.tar.gz: 8803438f8a7530588c9edc21942eacff6075afcf5282b5569f7e226b85ae37373dbdfdac132aac0a9e3c50bd3de9c9cde9e3b94a3bd4b1e57b86fd5ef2453fb0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.5
2
+ * Print debug message on tweet
3
+
1
4
  ## 0.0.4
2
5
  * Fix adapter interface
3
6
  * Support `in_reply_to_status_id`
@@ -1,3 +1,4 @@
1
+ require "active_support/core_ext/object/try"
1
2
  require "mem"
2
3
  require "twitter"
3
4
 
@@ -17,17 +18,7 @@ module Ruboty
17
18
  end
18
19
 
19
20
  def say(message)
20
- case message
21
- when String
22
- body = message
23
- when Hash
24
- body = message[:body]
25
- if tweet = message[:original][:tweet]
26
- options = { in_reply_to_status_id: tweet.id }
27
- end
28
- end
29
-
30
- client.update(body, options)
21
+ client.update(message[:body], in_reply_to_status_id: message[:original][:tweet].try(:id))
31
22
  end
32
23
 
33
24
  private
@@ -36,6 +27,7 @@ module Ruboty
36
27
  stream.user do |tweet|
37
28
  case tweet
38
29
  when ::Twitter::Tweet
30
+ Ruboty.logger.debug("@#{tweet.user.screen_name}: #{tweet.text}")
39
31
  robot.receive(
40
32
  body: tweet.text,
41
33
  from: tweet.user.screen_name,
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Twitter
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ["lib"]
18
18
 
19
+ spec.add_dependency "activesupport"
19
20
  spec.add_dependency "ruboty"
20
21
  spec.add_dependency "twitter", ">= 5.0.0"
21
22
  spec.add_development_dependency "bundler", "~> 1.6"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-twitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-05 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: ruboty
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
117
  version: '0'
104
118
  requirements: []
105
119
  rubyforge_project:
106
- rubygems_version: 2.2.2
120
+ rubygems_version: 2.4.5
107
121
  signing_key:
108
122
  specification_version: 4
109
123
  summary: An ruboty adapter for twitter.