earthquake 0.9.3 → 0.9.4
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.
- data/bin/earthquake +7 -1
- data/earthquake.gemspec +1 -1
- data/lib/earthquake/commands.rb +3 -3
- data/lib/earthquake/core.rb +3 -5
- data/lib/earthquake/version.rb +1 -1
- metadata +4 -4
data/bin/earthquake
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
gem 'slop', '~> 2.0'
|
3
2
|
require 'slop'
|
4
3
|
|
5
4
|
argv = ARGV.dup
|
@@ -16,6 +15,13 @@ rescue => e
|
|
16
15
|
exit!
|
17
16
|
end
|
18
17
|
options = slop.to_hash
|
18
|
+
|
19
|
+
# XXX: work around slop's feature (bug?)
|
20
|
+
options.each do |key, val|
|
21
|
+
val = val.nil? ? nil : true if key.to_s =~ /^no-/
|
22
|
+
options[key] = val
|
23
|
+
end
|
24
|
+
|
19
25
|
options.delete(:help)
|
20
26
|
options[:dir] = argv.shift unless argv.empty?
|
21
27
|
|
data/earthquake.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_runtime_dependency "launchy"
|
27
27
|
s.add_runtime_dependency "oauth"
|
28
28
|
s.add_runtime_dependency "twitter_oauth", "= 0.4.3"
|
29
|
-
s.add_runtime_dependency "slop", "~>
|
29
|
+
s.add_runtime_dependency "slop", "~> 3.0"
|
30
30
|
s.add_development_dependency "rspec", "~> 2.0"
|
31
31
|
s.add_development_dependency "bundler"
|
32
32
|
|
data/lib/earthquake/commands.rb
CHANGED
@@ -218,7 +218,7 @@ Earthquake.init do
|
|
218
218
|
end
|
219
219
|
|
220
220
|
# :recent jugyo
|
221
|
-
command %r|^:recent\s
|
221
|
+
command %r|^:recent\s+@?([^\/\s]+)$|, :as => :recent do |m|
|
222
222
|
puts_items twitter.user_timeline(:screen_name => m[1])
|
223
223
|
end
|
224
224
|
|
@@ -395,7 +395,7 @@ Earthquake.init do
|
|
395
395
|
|
396
396
|
help :sent_messages, "list direct messages sent"
|
397
397
|
|
398
|
-
command %r|^:message (\w+)\s+(.*)|, :as => :message do |m|
|
398
|
+
command %r|^:message @?(\w+)\s+(.*)|, :as => :message do |m|
|
399
399
|
async_e { twitter.message(*m[1, 2]) } if confirm("message '#{m[2]}' to @#{m[1]}")
|
400
400
|
end
|
401
401
|
|
@@ -482,7 +482,7 @@ Earthquake.init do
|
|
482
482
|
gist_id = uri.path[/\d+/]
|
483
483
|
meta = JSON.parse(open("https://api.github.com/gists/#{gist_id}").read)
|
484
484
|
filename = meta["files"].keys[0]
|
485
|
-
raw =
|
485
|
+
raw = meta['files'][filename]['content']
|
486
486
|
|
487
487
|
puts '-' * 80
|
488
488
|
puts raw.c(36)
|
data/lib/earthquake/core.rb
CHANGED
@@ -246,15 +246,13 @@ module Earthquake
|
|
246
246
|
end
|
247
247
|
|
248
248
|
def error(e)
|
249
|
-
|
249
|
+
puts "[ERROR] #{e.message}\n #{e.backtrace.join("\n ")}".c(:notice)
|
250
250
|
end
|
251
251
|
|
252
252
|
def notify(message, options = {})
|
253
|
-
|
254
|
-
title = args.delete(:title)
|
253
|
+
title = options.delete(:title) || 'earthquake'
|
255
254
|
message = message.is_a?(String) ? message : message.inspect
|
256
|
-
|
257
|
-
Notify.notify title, message.e
|
255
|
+
Notify.notify title, message, options
|
258
256
|
end
|
259
257
|
alias_method :n, :notify
|
260
258
|
|
data/lib/earthquake/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: earthquake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: twitter-stream
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ~>
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: '
|
149
|
+
version: '3.0'
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,7 @@ dependencies:
|
|
154
154
|
requirements:
|
155
155
|
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: '
|
157
|
+
version: '3.0'
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: rspec
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|