atig 0.4.5 → 0.5.0

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.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.travis.yml +3 -2
  4. data/Gemfile +2 -0
  5. data/README.mkdn +2 -0
  6. data/Rakefile +0 -6
  7. data/atig.gemspec +21 -20
  8. data/bin/console +14 -0
  9. data/bin/setup +7 -0
  10. data/{bin → exe}/atig +0 -0
  11. data/lib/atig/agent/agent.rb +4 -4
  12. data/lib/atig/agent/dm.rb +4 -4
  13. data/lib/atig/agent/following.rb +3 -3
  14. data/lib/atig/agent/list.rb +2 -2
  15. data/lib/atig/agent/list_status.rb +6 -6
  16. data/lib/atig/agent/stream_follow.rb +2 -2
  17. data/lib/atig/agent/user_stream.rb +3 -3
  18. data/lib/atig/basic_twitter.rb +1 -3
  19. data/lib/atig/bitly.rb +1 -1
  20. data/lib/atig/channel/channel.rb +1 -1
  21. data/lib/atig/channel/list.rb +3 -3
  22. data/lib/atig/channel/retweet.rb +1 -1
  23. data/lib/atig/channel/timeline.rb +1 -1
  24. data/lib/atig/command/autofix.rb +4 -4
  25. data/lib/atig/command/destroy.rb +1 -1
  26. data/lib/atig/command/dm.rb +2 -2
  27. data/lib/atig/command/favorite.rb +1 -1
  28. data/lib/atig/command/info.rb +2 -2
  29. data/lib/atig/command/reply.rb +2 -2
  30. data/lib/atig/command/retweet.rb +2 -2
  31. data/lib/atig/command/search.rb +2 -2
  32. data/lib/atig/command/status.rb +3 -3
  33. data/lib/atig/command/user.rb +3 -3
  34. data/lib/atig/command/version.rb +3 -3
  35. data/lib/atig/db/followings.rb +5 -6
  36. data/lib/atig/db/statuses.rb +12 -10
  37. data/lib/atig/db/transaction.rb +1 -1
  38. data/lib/atig/gateway/channel.rb +1 -2
  39. data/lib/atig/gateway/session.rb +13 -13
  40. data/lib/atig/http.rb +4 -4
  41. data/lib/atig/ifilter/expand_url.rb +1 -1
  42. data/lib/atig/ifilter/retweet.rb +1 -1
  43. data/lib/atig/ifilter/retweet_time.rb +1 -1
  44. data/lib/atig/ifilter/sanitize.rb +1 -1
  45. data/lib/atig/ifilter/strip.rb +1 -1
  46. data/lib/atig/ifilter/xid.rb +1 -1
  47. data/lib/atig/oauth.rb +3 -3
  48. data/lib/atig/ofilter/escape_url.rb +1 -1
  49. data/lib/atig/ofilter/footer.rb +1 -1
  50. data/lib/atig/ofilter/geo.rb +1 -1
  51. data/lib/atig/ofilter/short_url.rb +1 -1
  52. data/lib/atig/option.rb +1 -1
  53. data/lib/atig/optparse.rb +22 -11
  54. data/lib/atig/search.rb +4 -2
  55. data/lib/atig/stream.rb +1 -1
  56. data/lib/atig/twitter.rb +5 -4
  57. data/lib/atig/update_checker.rb +2 -2
  58. data/lib/atig/url_escape.rb +1 -1
  59. data/lib/atig/version.rb +1 -1
  60. data/lib/memory_profiler.rb +1 -1
  61. data/spec/command/autofix_spec.rb +7 -8
  62. data/spec/command/destroy_spec.rb +12 -13
  63. data/spec/command/dm_spec.rb +5 -6
  64. data/spec/command/favorite_spec.rb +11 -12
  65. data/spec/command/limit_spec.rb +6 -7
  66. data/spec/command/location_spec.rb +4 -5
  67. data/spec/command/name_spec.rb +2 -3
  68. data/spec/command/option_spec.rb +28 -29
  69. data/spec/command/refresh_spec.rb +3 -4
  70. data/spec/command/reply_spec.rb +22 -23
  71. data/spec/command/retweet_spec.rb +17 -18
  72. data/spec/command/spam_spec.rb +4 -5
  73. data/spec/command/status_spec.rb +19 -20
  74. data/spec/command/thread_spec.rb +20 -21
  75. data/spec/command/time_spec.rb +18 -21
  76. data/spec/command/uptime_spec.rb +17 -18
  77. data/spec/command/user_info_spec.rb +13 -16
  78. data/spec/command/user_spec.rb +13 -14
  79. data/spec/command/version_spec.rb +25 -29
  80. data/spec/command/whois_spec.rb +25 -26
  81. data/spec/command_helper.rb +2 -2
  82. data/spec/db/followings_spec.rb +22 -23
  83. data/spec/db/listenable_spec.rb +2 -3
  84. data/spec/db/lists_spec.rb +16 -17
  85. data/spec/db/roman_spec.rb +3 -5
  86. data/spec/db/sized_uniq_array_spec.rb +13 -14
  87. data/spec/db/statuses_spec.rb +69 -70
  88. data/spec/ifilter/expand_url_spec.rb +18 -20
  89. data/spec/ifilter/retweet_spec.rb +4 -5
  90. data/spec/ifilter/retweet_time_spec.rb +4 -5
  91. data/spec/ifilter/sanitize_spec.rb +5 -6
  92. data/spec/ifilter/sid_spec.rb +6 -7
  93. data/spec/ifilter/strip_spec.rb +3 -4
  94. data/spec/ifilter/tid_spec.rb +6 -7
  95. data/spec/levenshtein_spec.rb +2 -3
  96. data/spec/ofilter/escape_url_spec.rb +13 -14
  97. data/spec/ofilter/footer_spec.rb +10 -11
  98. data/spec/ofilter/geo_spec.rb +12 -13
  99. data/spec/ofilter/short_url_spec.rb +28 -29
  100. data/spec/option_spec.rb +23 -24
  101. data/spec/sized_hash_spec.rb +5 -6
  102. data/spec/spec_helper.rb +8 -6
  103. data/spec/update_checker_spec.rb +14 -15
  104. metadata +9 -32
  105. data/docs/_static/allow.png +0 -0
  106. data/docs/_static/emacs.png +0 -0
  107. data/docs/_static/irc_setting.png +0 -0
  108. data/docs/_static/irssi.png +0 -0
  109. data/docs/_static/limechat.png +0 -0
  110. data/docs/_static/limechat_s.png +0 -0
  111. data/docs/_static/oauth_channel.png +0 -0
  112. data/docs/_static/screenshot.png +0 -0
  113. data/docs/_static/structure.png +0 -0
  114. data/docs/_static/verify.png +0 -0
  115. data/docs/changelog.rst +0 -233
  116. data/docs/commandline_options.rst +0 -21
  117. data/docs/commands.rst +0 -84
  118. data/docs/conf.py +0 -194
  119. data/docs/config.rst +0 -159
  120. data/docs/feature.rst +0 -41
  121. data/docs/hacking_guide.rst +0 -43
  122. data/docs/index.rst +0 -102
  123. data/docs/irc.rst +0 -31
  124. data/docs/options.rst +0 -76
  125. data/docs/quickstart.rst +0 -96
  126. data/docs/resize.sh +0 -7
  127. data/docs/tiarra.rst +0 -2
  128. data/docs/tig.rst +0 -21
  129. data/requirements.txt +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 600b07b559862ae694b0c7c99890c9e043a9aa6a
4
- data.tar.gz: ae106983e3d0c5846c41c8ff8e93370f981ac7d7
3
+ metadata.gz: 7289f78b0e27eb209b0db4dd0c8521c2f815def7
4
+ data.tar.gz: dafd598ceb3604b19b2504644f606497e5aa23c3
5
5
  SHA512:
6
- metadata.gz: c9b3350f024a475f036f26734c2e5fae1bbd3fb73a93279579b060a44a04a897a88d2e7b66e8cd226d76eeedc16475e6ece90099900ee0cd6cea7c6fff6d1a35
7
- data.tar.gz: 00ff15638abddb5064b478a30c3c30e15c3c15b36991418fc90f1adfd7f566a63c493360d7befe27d0c37c0e2368406a8cfde2124bf402406a72e8793020deec
6
+ metadata.gz: c1c26f3096adff2dfd36b4ab023a1bd1c03cf2748ce7a763ddc2e1981f1ec7f08afbf57a42e0657c3e6b2b75bf846f08c449efb9c2e5f95d292d32a64117adae
7
+ data.tar.gz: edb161638ae3aaa32c39cb45739fde1f1cfd77087f4f4f4f539ed2ec11ae35144d9d1f341b63302d888e9ab7f19531926007e7c2c4b2b338e6927cbe738e07e9
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
+ --require spec_helper
1
2
  --color
2
3
  --profile
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
- - 2.1.0
4
+ - 2.1
5
+ - 2.2
6
+ - ruby-head
6
7
 
7
8
  script: bundle exec rake spec
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem 'rspec', '~> 3.0.0.beta2'
@@ -1,6 +1,8 @@
1
1
  Atig.rb - Another Twitter Irc Gateway
2
2
  ===========================================
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/atig.png)](https://rubygems.org/gems/atig) [![Code Climate](https://codeclimate.com/github/atig/atig.png)](https://codeclimate.com/github/atig/atig) [![Build Status](https://travis-ci.org/atig/atig.png)](https://travis-ci.org/atig/atig)
5
+
4
6
  OVERVIEW
5
7
  --------
6
8
  Atig.rb is Twitter Irc Gateway.
data/Rakefile CHANGED
@@ -17,10 +17,4 @@ RSpec::Core::RakeTask.new do |t|
17
17
  t.pattern = 'spec/**/*_spec.rb'
18
18
  end
19
19
 
20
- desc "building document with sphinx"
21
- task :docs do
22
- build_dir = "docs/_build"
23
- `LC_CTYPE=C sphinx-build -b html -d #{build_dir}/doctrees -D latex_paper_size=a4 docs #{build_dir}/html`
24
- end
25
-
26
20
  task :default => [:spec, :clean]
@@ -1,28 +1,29 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  require File.expand_path('../lib/atig/version', __FILE__)
3
3
 
4
- Gem::Specification.new do |gem|
5
- gem.authors = ["MIZUNO Hiroki", "SHIBATA Hiroshi", ]
6
- gem.email = ["mzp@ocaml.jp", "shibata.hiroshi@gmail.com"]
7
- gem.description = %q{Atig.rb is Twitter Irc Gateway.}
8
- gem.summary = %q{Atig.rb is forked from cho45's tig.rb. We improve some features of tig.rb.}
9
- gem.homepage = "https://github.com/mzp/atig"
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "atig"
6
+ spec.version = Atig::VERSION
7
+ spec.authors = ["MIZUNO Hiroki", "SHIBATA Hiroshi", ]
8
+ spec.email = ["mzp@ocaml.jp", "shibata.hiroshi@gmail.com"]
10
9
 
11
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
- gem.files = `git ls-files`.split("\n")
13
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
- gem.name = "atig"
15
- gem.require_paths = ["lib"]
16
- gem.version = Atig::VERSION
10
+ spec.summary = %q{Atig.rb is forked from cho45's tig.rb. We improve some features of tig.rb.}
11
+ spec.description = %q{Atig.rb is Twitter Irc Gateway.}
12
+ spec.homepage = "https://github.com/atig/atig"
17
13
 
18
- gem.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
14
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
15
+ spec.bindir = "exe"
16
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.require_paths = ["lib"]
18
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ spec.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
19
20
 
20
- gem.add_dependency 'sqlite3', ['>= 1.3.2']
21
- gem.add_dependency 'net-irc', ['>= 0']
22
- gem.add_dependency 'oauth', ['>= 0']
23
- gem.add_dependency 'twitter-text', ['~> 1.7.0']
21
+ spec.add_dependency 'sqlite3', ['>= 1.3.2']
22
+ spec.add_dependency 'net-irc', ['>= 0']
23
+ spec.add_dependency 'oauth', ['>= 0']
24
+ spec.add_dependency 'twitter-text', ['~> 1.7.0']
24
25
 
25
- gem.add_development_dependency 'bundler'
26
- gem.add_development_dependency 'rspec'
27
- gem.add_development_dependency 'coveralls'
26
+ spec.add_development_dependency 'bundler'
27
+ spec.add_development_dependency 'rake'
28
+ spec.add_development_dependency 'coveralls'
28
29
  end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "atig"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
File without changes
@@ -15,18 +15,18 @@ module Atig
15
15
  log :info, "initialize"
16
16
 
17
17
  @api.repeat( interval ) do|t|
18
- q = { :count => 200 }
18
+ q = { count: 200 }
19
19
  if @prev
20
- q.update :since_id => @prev
20
+ q.update since_id: @prev
21
21
  else
22
- q.update :count => 20
22
+ q.update count: 20
23
23
  end
24
24
 
25
25
  sources = t.get( path, q)
26
26
 
27
27
  sources.reverse_each do|s|
28
28
  db.statuses.transaction do|d|
29
- d.add :source => source, :status => s, :user => s.user
29
+ d.add source: source, status: s, user: s.user
30
30
  end
31
31
  end
32
32
 
@@ -15,18 +15,18 @@ module Atig
15
15
  log :info, "initialize"
16
16
 
17
17
  @api.repeat(600) do|t|
18
- q = { :count => 200 }
18
+ q = { count: 200 }
19
19
  if @prev
20
- q.update :since_id => @prev
20
+ q.update since_id: @prev
21
21
  else
22
- q.update :count => 1
22
+ q.update count: 1
23
23
  end
24
24
  dms = t.get("direct_messages", q)
25
25
  log :debug, "You have #{dms.size} dm."
26
26
 
27
27
  dms.reverse_each do|dm|
28
28
  db.dms.transaction do|d|
29
- d.add :status => dm, :user => dm.sender
29
+ d.add status: dm, user: dm.sender
30
30
  end
31
31
  end
32
32
  end
@@ -22,15 +22,15 @@ module Atig
22
22
 
23
23
  def update(api)
24
24
  if @db.followings.empty?
25
- friends = api.page("friends/list", :users, {:user_id => @db.me.id, :count => 100})
25
+ friends = api.page("friends/list", :users, {user_id: @db.me.id, count: 100})
26
26
  else
27
27
  @db.me = api.post("account/update_profile")
28
28
  return if @db.me.friends_count == @db.followings.size
29
- friends = api.page("friends/list", :users, {:user_id => @db.me.id, :count => 100})
29
+ friends = api.page("friends/list", :users, {user_id: @db.me.id, count: 100})
30
30
  end
31
31
 
32
32
  if @opts.only
33
- followers = api.page("friends/ids", :ids, {:user_id => @db.me.id, :count => 2500})
33
+ followers = api.page("friends/ids", :ids, {user_id: @db.me.id, count: 2500})
34
34
  friends.each do|friend|
35
35
  friend[:only] = !followers.include?(friend.id)
36
36
  end
@@ -18,7 +18,7 @@ module Atig
18
18
  if name == :all then
19
19
  full_update t
20
20
  else
21
- @db.lists[name].update t.page("lists/members", :users, {:owner_screen_name => @db.me.screen_name, :slug => name})
21
+ @db.lists[name].update t.page("lists/members", :users, {owner_screen_name: @db.me.screen_name, slug: name})
22
22
  end
23
23
  end
24
24
  end
@@ -41,7 +41,7 @@ module Atig
41
41
  end
42
42
  begin
43
43
  users[name] =
44
- t.page("lists/members", :users, {:owner_screen_name => list.user.screen_name, :slug => list.slug})
44
+ t.page("lists/members", :users, {owner_screen_name: list.user.screen_name, slug: list.slug})
45
45
  rescue => e
46
46
  log :error, e.inspect
47
47
  users[name] =
@@ -18,17 +18,17 @@ class Atig::Agent::ListStatus
18
18
  db.lists.each do |name, _|
19
19
  log :debug, "retrieve #{name} statuses"
20
20
  q = {}
21
- q.update(:since_id => @prev[name]) if @prev.key?(name)
21
+ q.update(since_id: @prev[name]) if @prev.key?(name)
22
22
 
23
23
  screen_name, slug = parse name
24
- q.update(:owner_screen_name => screen_name, :slug => slug)
24
+ q.update(owner_screen_name: screen_name, slug: slug)
25
25
  statuses = t.get("lists/statuses", q)
26
26
  statuses.reverse_each do|status|
27
27
  db.statuses.transaction do|d|
28
- d.add(:status => status,
29
- :user => status.user,
30
- :source => :list,
31
- :list => name)
28
+ d.add(status: status,
29
+ user: status.user,
30
+ source: :list,
31
+ list: name)
32
32
  end
33
33
  end
34
34
  @prev[name] = statuses[0].id if statuses && statuses.size > 0
@@ -24,10 +24,10 @@ module Atig
24
24
 
25
25
  @api.stream do|t|
26
26
  Thread.pass until @follows
27
- t.watch('statuses/filter', :follow => @follows) do |status|
27
+ t.watch('statuses/filter', follow: @follows) do |status|
28
28
  if status and status.user
29
29
  db.transaction do|d|
30
- d.statuses.add :status => status, :user => status.user, :source => :stream_follow
30
+ d.statuses.add status: status, user: status.user, source: :stream_follow
31
31
  end
32
32
  end
33
33
  end
@@ -16,7 +16,7 @@ module Atig
16
16
  log :info, "initialize"
17
17
 
18
18
  @api.stream do|t|
19
- options = context.opts.allreplies ? {:replies => :all} : {}
19
+ options = context.opts.allreplies ? {replies: :all} : {}
20
20
 
21
21
  t.watch('user', options) do |status|
22
22
  # @log.debug status.inspect
@@ -24,11 +24,11 @@ module Atig
24
24
  if status.direct_message
25
25
  dm = status.direct_message
26
26
  db.dms.transaction do|d|
27
- d.add :status => dm, :user => dm.sender
27
+ d.add status: dm, user: dm.sender
28
28
  end
29
29
  elsif status and status.user
30
30
  db.statuses.transaction do|d|
31
- d.add :status => status, :user => status.user, :source => :user_stream
31
+ d.add status: status, user: status.user, source: :user_stream
32
32
  end
33
33
  elsif status and status.event
34
34
  case status.event
@@ -29,8 +29,6 @@ module Atig
29
29
  uri.path += ".json" if path != "users/username_available"
30
30
  uri.query = query.to_query_str unless query.empty?
31
31
 
32
- header = {}
33
-
34
32
  begin
35
33
  ret = request(uri, opts)
36
34
  rescue OpenSSL::SSL::SSLError => e
@@ -99,7 +97,7 @@ module Atig
99
97
  methods.each do |m|
100
98
  self.module_eval <<END
101
99
  def #{m}(path, query = {}, opts = {})
102
- opts.update( :method => :#{m})
100
+ opts.update( method: :#{m})
103
101
  api path, query, opts
104
102
  end
105
103
  END
@@ -27,7 +27,7 @@ module Atig
27
27
  if @login and @key
28
28
  bitly.path = "/shorten"
29
29
  bitly.query = {
30
- :format => "json", :longUrl => url, :login => @login, :apiKey => @key,
30
+ format: "json", longUrl: url, login: @login, apiKey: @key,
31
31
  }.to_query_str(";")
32
32
  req = @http.req(:get, bitly, {})
33
33
  res = @http.http(bitly, 5, 10).request(req)
@@ -5,7 +5,7 @@ module Atig
5
5
  class Channel
6
6
  def initialize(context, gateway, db)
7
7
  @db = db
8
- @channel = gateway.channel channel_name, :handler=>self
8
+ @channel = gateway.channel channel_name, handler:self
9
9
  @channel.join_me
10
10
 
11
11
  db.statuses.listen do|entry|
@@ -12,14 +12,14 @@ module Atig
12
12
  def on_invite(api, nick)
13
13
  return if @name.include? '^'
14
14
 
15
- api.post("lists/members/create", :screen_name => nick, :owner_screen_name => @db.me.screen_name, :slug => @name )
15
+ api.post("lists/members/create", screen_name: nick, owner_screen_name: @db.me.screen_name, slug: @name )
16
16
  @db.lists.invalidate @name
17
17
  end
18
18
 
19
19
  def on_kick(api, nick)
20
20
  return if @name.include? '^'
21
21
 
22
- api.post("lists/members/destroy", :screen_name => nick, :owner_screen_name => @db.me.screen_name, :slug => @name )
22
+ api.post("lists/members/destroy", screen_name: nick, owner_screen_name: @db.me.screen_name, slug: @name )
23
23
  @db.lists.invalidate @name
24
24
  end
25
25
 
@@ -31,7 +31,7 @@ module Atig
31
31
 
32
32
  def initialize(context, gateway, db)
33
33
  @channels = Hash.new do|hash,name|
34
- channel = gateway.channel "##{name}", :handler => Handler.new(db, name)
34
+ channel = gateway.channel "##{name}", handler: Handler.new(db, name)
35
35
  channel.join_me
36
36
  hash[name] = channel
37
37
  end
@@ -7,7 +7,7 @@ module Atig
7
7
  def initialize(context, gateway, db)
8
8
  super
9
9
 
10
- db.statuses.find_all(:limit=>50).reverse_each {|entry|
10
+ db.statuses.find_all(limit:50).reverse_each {|entry|
11
11
  message entry
12
12
  }
13
13
 
@@ -16,7 +16,7 @@ module Atig
16
16
  @channel.notify "Client options: #{context.opts.marshal_dump.inspect}"
17
17
 
18
18
  # つないだときに発言がないとさみしいので
19
- db.statuses.find_all(:limit=>50).reverse_each do|entry|
19
+ db.statuses.find_all(limit:50).reverse_each do|entry|
20
20
  case entry.source
21
21
  when :timeline, :me
22
22
  @channel.message entry
@@ -31,17 +31,17 @@ module Atig
31
31
  return
32
32
  end
33
33
  text = mesg.split(" ", 2)[1]
34
- q = gateway.output_message(:status => text)
34
+ q = gateway.output_message(status: text)
35
35
 
36
- prev,*_ = db.statuses.find_by_user( db.me, :limit => 1)
36
+ prev,*_ = db.statuses.find_by_user( db.me, limit: 1)
37
37
 
38
38
  unless fix?(command, q[:status], prev) then
39
- api.delay(0, :retry=>3) do|t|
39
+ api.delay(0, retry:3) do|t|
40
40
  ret = t.post("statuses/update", q)
41
41
  gateway.update_status ret, target
42
42
  end
43
43
  else
44
- api.delay(0, :retry=>3) do|t|
44
+ api.delay(0, retry:3) do|t|
45
45
  yield "Similar update in previous. Conclude that it has error."
46
46
  yield "And overwrite previous as new status: #{q[:status]}"
47
47
 
@@ -18,7 +18,7 @@ module Atig
18
18
  if entry = Info.find_status(db, tid)
19
19
  if entry.user.id == db.me.id
20
20
  api.delay(0) do|t|
21
- res = t.post("statuses/destroy/#{entry.status.id}")
21
+ t.post("statuses/destroy/#{entry.status.id}")
22
22
  yield "Destroyed: #{entry.status.text}"
23
23
 
24
24
  db.statuses.transaction do|d|
@@ -20,8 +20,8 @@ module Atig
20
20
  text = mesg.split(" ", 3)[2]
21
21
  api.delay(0) do|t|
22
22
  t.post("direct_messages/new",{
23
- :screen_name => user,
24
- :text => text
23
+ screen_name: user,
24
+ text: text
25
25
  })
26
26
  yield "Sent message to #{user}: #{text}"
27
27
  end
@@ -14,7 +14,7 @@ module Atig
14
14
  args.each do|tid|
15
15
  if entry = Info.find_status(db, tid)
16
16
  api.delay(0){|t|
17
- res = t.post("favorites/#{method}", {:id => entry.status.id})
17
+ t.post("favorites/#{method}", {id: entry.status.id})
18
18
  yield "#{command.upcase}: #{entry.user.screen_name}: #{entry.status.text}"
19
19
  }
20
20
  else
@@ -21,7 +21,7 @@ module Atig
21
21
  api.delay(0) do|t|
22
22
  status = t.get "statuses/show/#{id}"
23
23
  db.statuses.transaction do|d|
24
- d.add :status => status, :user => status.user, :source => :thread
24
+ d.add status: status, user: status.user, source: :thread
25
25
  f.call d.find_by_status_id(id)
26
26
  end
27
27
  end
@@ -30,7 +30,7 @@ module Atig
30
30
 
31
31
  def find_status(db, tid_or_screen_name)
32
32
  find = lambda do|x|
33
- xs = db.statuses.find_by_screen_name(x, :limit=>1)
33
+ xs = db.statuses.find_by_screen_name(x, limit:1)
34
34
  unless xs.empty? then
35
35
  xs.first
36
36
  else
@@ -21,8 +21,8 @@ module Atig
21
21
 
22
22
  text = "@#{name} #{text}" if text.nil? or not text.include?("@#{name}")
23
23
 
24
- q = gateway.output_message(:status => text,
25
- :in_reply_to_status_id => entry.status.id)
24
+ q = gateway.output_message(status: text,
25
+ in_reply_to_status_id: entry.status.id)
26
26
 
27
27
  api.delay(0) do|t|
28
28
  ret = t.post("statuses/update", q)