earthquake 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,6 +36,10 @@ Commands
36
36
 
37
37
  ⚡ :exit
38
38
 
39
+ ### Reconnect
40
+
41
+ ⚡ :reconnect
42
+
39
43
  ### Restart
40
44
 
41
45
  ⚡ :restart
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
data/earthquake.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{earthquake}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo"]
@@ -58,7 +58,11 @@ module Earthquake
58
58
  end
59
59
 
60
60
  command :search do |m|
61
- puts_items twitter.search(m[1])["results"].each { |s| s["user"] = {"screen_name" => s["from_user"]} }.reverse
61
+ puts_items twitter.search(m[1])["results"].each { |s|
62
+ s["user"] = {"screen_name" => s["from_user"]}
63
+ }.each {|s|
64
+ s["highlights"] = [m[1]]
65
+ }.reverse
62
66
  end
63
67
 
64
68
  command :retweet do |m|
@@ -62,7 +62,7 @@ module Earthquake
62
62
  begin
63
63
  require_dependency lib
64
64
  rescue Exception => e
65
- puts "<on_red>[ERROR] #{e.message.e}\n#{e.backtrace.join("\n").e}</on_red>".t
65
+ error e
66
66
  end
67
67
  end
68
68
  end
@@ -154,6 +154,10 @@ module Earthquake
154
154
  end
155
155
  end
156
156
 
157
+ def error(e)
158
+ notify "[ERROR] #{e.message}\n#{e.backtrace.join("\n")}"
159
+ end
160
+
157
161
  def notify(message, options = {:title => 'earthquake'})
158
162
  Notify.notify options[:title], message
159
163
  end
@@ -26,7 +26,7 @@ module Earthquake
26
26
  puts "<yellow>Command not found</yellow>".t
27
27
  end
28
28
  rescue Exception => e
29
- puts "<on_red>[ERROR] #{e.message.e}\n#{e.backtrace.join("\n").e}</on_red>".t
29
+ error e
30
30
  end
31
31
  end
32
32
 
@@ -73,7 +73,7 @@ module Earthquake
73
73
  begin
74
74
  results + (completion.call(text) || [])
75
75
  rescue Exception => e
76
- notify "[ERROR] #{e.message}\n#{e.backtrace.join("\n")}"
76
+ error e
77
77
  results
78
78
  end
79
79
  end
@@ -33,7 +33,7 @@ module Earthquake
33
33
  begin
34
34
  p.call(item)
35
35
  rescue => e
36
- puts e, e.backtrace
36
+ error e
37
37
  end
38
38
  end
39
39
  end
@@ -87,6 +87,16 @@ module Earthquake
87
87
  c = color_of($1)
88
88
  "<#{c}>#{i}</#{c}>"
89
89
  end
90
+
91
+ if item["highlights"]
92
+ item["highlights"].each do |h|
93
+ c = color_of(h).to_i + 10
94
+ text = text.gsub(/#{h}/i) do |i|
95
+ "<#{c}>#{i}</#{c}>"
96
+ end
97
+ end
98
+ end
99
+
90
100
  status = "<90>#{statuses.join(" ").e}</90> " +
91
101
  "<#{user_color}>#{item["user"]["screen_name"].e}</#{user_color}>: " +
92
102
  "#{text}<90>#{misc.e} #{source.e}</90>"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: earthquake
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.1
5
+ version: 0.4.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - jugyo