earthquake 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -137,7 +137,12 @@ You can try it by using the :eval command:
137
137
 
138
138
  ⚡ :eval notify 'Hello World!'
139
139
 
140
- Plugin
140
+ Plugins
141
+ ----
142
+
143
+ => [https://github.com/jugyo/earthquake/wiki/Plugin](https://github.com/jugyo/earthquake/wiki/Plugin)
144
+
145
+ Making Plugin
141
146
  ----
142
147
 
143
148
  **~/.earthquake/plugin** is the directory for plugins.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
data/earthquake.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{earthquake}
8
- s.version = "0.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo"]
12
- s.date = %q{2011-04-04}
12
+ s.date = %q{2011-04-06}
13
13
  s.default_executable = %q{earthquake}
14
14
  s.description = %q{Twitter Client on Terminal with Twitter Streaming API.}
15
15
  s.email = %q{jugyo.org@gmail.com}
@@ -193,6 +193,20 @@ Earthquake.init do
193
193
  }
194
194
  end
195
195
 
196
+ command %r|^:open\s+(\d+)$|, :as => :open do |m|
197
+ if match = twitter.status(m[1])["text"].match(URI.regexp(["http", "https"]))
198
+ browse match[0]
199
+ else
200
+ puts "no link found".c(41)
201
+ end
202
+ end
203
+
204
+ command %r|^:open\s+(\w+)$|, :as => :open do |m|
205
+ url = "https://twitter.com/#{m[1]}"
206
+ puts "Open: #{url}".c(:info)
207
+ browse url
208
+ end
209
+
196
210
  command :sh do
197
211
  system ENV["SHELL"] || 'sh'
198
212
  end
@@ -192,6 +192,10 @@ module Earthquake
192
192
  Notify.notify options[:title], message
193
193
  end
194
194
  alias_method :n, :notify
195
+
196
+ def browse(url)
197
+ Launchy::Browser.run(url)
198
+ end
195
199
  end
196
200
 
197
201
  extend Core
@@ -9,7 +9,7 @@ module Earthquake
9
9
  request_token = consumer.get_request_token
10
10
 
11
11
  puts "1) open: #{request_token.authorize_url}"
12
- Launchy::Browser.run(request_token.authorize_url) rescue nil
12
+ browse(request_token.authorize_url) rescue nil
13
13
 
14
14
  print "2) Enter the PIN: "
15
15
  pin = STDIN.gets.strip
@@ -69,6 +69,7 @@ module Earthquake
69
69
  :event => 42,
70
70
  :url => [4, 36]
71
71
  )
72
+ config[:raw_text] ||= false
72
73
 
73
74
  output do |item|
74
75
  next unless item["text"]
@@ -87,6 +88,7 @@ module Earthquake
87
88
  id = id2var(item["id"])
88
89
 
89
90
  text = item["text"].u
91
+ text.gsub!(/\s+/, ' ') unless config[:raw_text]
90
92
  text.gsub!(/@([0-9A-Za-z_]+)/) do |i|
91
93
  i.c(color_of($1))
92
94
  end
@@ -99,7 +101,11 @@ module Earthquake
99
101
 
100
102
  if item["_highlights"]
101
103
  item["_highlights"].each do |h|
102
- c = color_of(h).to_i + 10
104
+ if config[:color][:highlight].nil?
105
+ c = color_of(h).to_i + 10
106
+ else
107
+ c = :highlight
108
+ end
103
109
  text = text.gsub(/#{h}/i) do |i|
104
110
  i.c(c)
105
111
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: earthquake
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.2
5
+ version: 0.6.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - jugyo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-04 00:00:00 +09:00
13
+ date: 2011-04-06 00:00:00 +09:00
14
14
  default_executable: earthquake
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency