termtter 0.8.6 → 0.8.7
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/Rakefile +1 -0
- data/lib/plugin/stdout.rb +9 -8
- data/lib/termtter/version.rb +1 -1
- metadata +12 -2
data/Rakefile
CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_dependency("json_pure", ">= 1.1.3")
|
28
28
|
s.add_dependency("configatron", ">= 2.2.2")
|
29
29
|
s.add_dependency("highline", ">= 1.5.0")
|
30
|
+
s.add_dependency("termcolor", ">= 0.2.4")
|
30
31
|
s.authors = %w(jugyo ujihisa)
|
31
32
|
s.email = 'jugyo.org@gmail.com'
|
32
33
|
s.homepage = 'http://wiki.github.com/jugyo/termtter'
|
data/lib/plugin/stdout.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'termcolor'
|
4
4
|
require 'erb'
|
5
5
|
|
6
6
|
configatron.plugins.stdout.set_default(
|
@@ -8,7 +8,7 @@ configatron.plugins.stdout.set_default(
|
|
8
8
|
[:none, :red, :green, :yellow, :blue, :magenta, :cyan])
|
9
9
|
configatron.plugins.stdout.set_default(
|
10
10
|
:timeline_format,
|
11
|
-
'
|
11
|
+
'<90><%=time%></90> <<%=status_color%>><%=status%></<%=status_color%>> <90><%=id%></90>')
|
12
12
|
|
13
13
|
$highline = HighLine.new
|
14
14
|
|
@@ -32,20 +32,21 @@ module Termtter::Client
|
|
32
32
|
if s.in_reply_to_status_id
|
33
33
|
status += " (reply to #{s.in_reply_to_status_id})"
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
time = "(#{s.created_at.strftime(time_format)})"
|
37
37
|
id = s.id
|
38
|
-
|
38
|
+
erbed_text = ERB.new(configatron.plugins.stdout.timeline_format).result(binding)
|
39
|
+
puts TermColor.parse(erbed_text)
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
43
|
def self.print_statuses_with_date(statuses, sort = true)
|
43
44
|
print_statuses(statuses, sort, '%m-%d %H:%M')
|
44
45
|
end
|
45
|
-
|
46
|
+
|
46
47
|
add_hook do |statuses, event|
|
47
48
|
next if statuses.empty?
|
48
|
-
|
49
|
+
|
49
50
|
case event
|
50
51
|
when :update_friends_timeline, :list_friends_timeline
|
51
52
|
print_statuses(statuses)
|
@@ -53,10 +54,10 @@ module Termtter::Client
|
|
53
54
|
print_statuses_with_date(statuses)
|
54
55
|
end
|
55
56
|
end
|
56
|
-
|
57
|
+
|
57
58
|
end
|
58
59
|
# stdout.rb
|
59
60
|
# output statuses to stdout
|
60
61
|
# example config
|
61
62
|
# configatron.plugins.stdout.colors = [:none, :red, :green, :yellow, :blue, :magenta, :cyan]
|
62
|
-
# configatron.plugins.stdout.timeline_format = '
|
63
|
+
# configatron.plugins.stdout.timeline_format = '<90><%=time%></90> <<%=status_color%>><%=status%></<%=status_color%>> <90><%=id%></90>'
|
data/lib/termtter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: termtter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jugyo
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-02-
|
13
|
+
date: 2009-02-28 00:00:00 +09:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -43,6 +43,16 @@ dependencies:
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 1.5.0
|
45
45
|
version:
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: termcolor
|
48
|
+
type: :runtime
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.2.4
|
55
|
+
version:
|
46
56
|
description: Termtter is a terminal based Twitter client
|
47
57
|
email: jugyo.org@gmail.com
|
48
58
|
executables:
|