flumtter 5.4.0 → 5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 172a58ccba1cebebba54f06578778897391e2655
4
- data.tar.gz: 1978786bb8795ffad698c95201283478de4059f8
3
+ metadata.gz: 13d1dedbe6e2272bfc5a0703d9ca4ac97891205f
4
+ data.tar.gz: f2a259bf554cf3b41526b280b8ecf106246b492a
5
5
  SHA512:
6
- metadata.gz: 9aaa57eff2459a530a89cd8eaa66a73881cdf313a0242565c20d789f4a54ab4635450f0651949773c113c51b95321e605a427ddea3492d0a330c23151246dc39
7
- data.tar.gz: abca932b6739cb8f7c3442f338dd02d49466b81ea891a7a790fa3aaf8de873a2c0e5c0c7827f95c3db36c3ac32e1f390c9be0838a6988918405ace16d83345f8
6
+ metadata.gz: d2607cae78919444f5fcd1844a0cf1c0c78257ee6e97b5ad9875c0161a6452ba518e2f0022616b199213cd4022197dbd60cfc7632a8b5bb50e5a78cc715a792b
7
+ data.tar.gz: ee9ea90fe2b6bb37dc88a44706ead7549680d686268e9068e284416ec5139183eb6ad9b1dd7c803e6556ca56aaf256b18dafb195f3fb844db46925b0293cc10e
@@ -19,6 +19,14 @@ module Flumtter
19
19
  Plugins::Reply.update(obj, m2, twitter)
20
20
  end
21
21
  end
22
+ command("g", "Conversation") do |m|
23
+ error_handler do
24
+ obj, _ = parse_index(m[1])
25
+ if_tweet(obj, twitter) do |tweet|
26
+ Window::Conversation.new(tweet, twitter).show
27
+ end
28
+ end
29
+ end
22
30
  end
23
31
  end
24
32
  end
@@ -11,6 +11,10 @@ module Flumtter
11
11
  EOF
12
12
  end
13
13
 
14
+ def parse_time(time)
15
+ time.getlocal.strftime("%Y/%m/%d %H:%M:%S")
16
+ end
17
+
14
18
  def parse_index(text, with_screen_name=false)
15
19
  if m = text.match(index_regexp)
16
20
  obj = id2obj(m[1])
@@ -57,6 +57,8 @@ module Flumtter
57
57
  end
58
58
 
59
59
  class Element
60
+ include Util
61
+
60
62
  attr_reader :object
61
63
  def initialize(object, index)
62
64
  @object = object
@@ -0,0 +1,28 @@
1
+ module Flumtter
2
+ module Window
3
+ class ConversationBuf < Buf::Buf
4
+ def initialize(twitter)
5
+ @twitter = twitter
6
+ super(Window::TweetBase)
7
+ end
8
+
9
+ def prefetch
10
+ id = @buf.last&.object&.in_reply_to_status_id
11
+ add(
12
+ @twitter.rest.status(id)
13
+ ) unless id.nil?
14
+ end
15
+ end
16
+
17
+ class Conversation < Window::Buf::Screen
18
+ include Command::Tweet
19
+
20
+ def initialize(obj, twitter)
21
+ buf = ConversationBuf.new(twitter)
22
+ buf.add(obj)
23
+ super(buf, "Conversation")
24
+ add_command(twitter)
25
+ end
26
+ end
27
+ end
28
+ end
@@ -10,7 +10,7 @@ module Flumtter
10
10
  end
11
11
 
12
12
  def created_at
13
- @object.created_at.strftime("%Y/%m/%d %H:%M:%S")
13
+ parse_time(@object.created_at)
14
14
  end
15
15
 
16
16
  def header
@@ -10,7 +10,7 @@ module Flumtter
10
10
  end
11
11
 
12
12
  def created_at
13
- @object.created_at.strftime("%Y/%m/%d %H:%M:%S")
13
+ parse_time(@object.created_at)
14
14
  end
15
15
 
16
16
  def body
@@ -1,37 +1,12 @@
1
1
  module Flumtter
2
2
  plugin do
3
- class self::Buf < Window::Buf::Buf
4
- def initialize(twitter)
5
- @twitter = twitter
6
- super(Window::TweetBase)
7
- end
8
-
9
- def prefetch
10
- id = @buf.last&.object&.in_reply_to_status_id
11
- add(
12
- @twitter.rest.status(id)
13
- ) unless id.nil?
14
- end
15
- end
16
-
17
- class self::Conversation < Window::Buf::Screen
18
- include Command::Tweet
19
-
20
- def initialize(obj, twitter)
21
- buf = Plugins::Conversation::Buf.new(twitter)
22
- buf.add(obj)
23
- super(buf, "Conversation")
24
- add_command(twitter)
25
- end
26
- end
27
-
28
3
  Keyboard.add("g", "Conversation") do |m, twitter|
29
4
  error_handler do
30
5
  obj, _ = index_with_dialog(m[1], "Conversation Screen", <<~EOF)
31
6
  Please input target index.
32
7
  EOF
33
8
  if_tweet(obj, twitter) do |tweet|
34
- self::Conversation.new(tweet, twitter).show
9
+ Window::Conversation.new(tweet, twitter).show
35
10
  end
36
11
  end
37
12
  end
@@ -1,6 +1,8 @@
1
1
  module Flumtter
2
2
  module TimeLine
3
3
  class Base
4
+ include Util
5
+
4
6
  @@elements = []
5
7
 
6
8
  def self.[](key)
@@ -51,7 +53,7 @@ module Flumtter
51
53
  end
52
54
 
53
55
  def created_at
54
- @object.created_at.strftime("%Y/%m/%d %H:%M:%S")
56
+ parse_time(@object.created_at)
55
57
  end
56
58
 
57
59
  def index
@@ -16,7 +16,7 @@ module Flumtter
16
16
  end
17
17
 
18
18
  def created_at
19
- @object.target_object.created_at.strftime("%Y/%m/%d %H:%M:%S")
19
+ parse_time(@object.target_object.created_at)
20
20
  end
21
21
 
22
22
  def body
@@ -1,3 +1,3 @@
1
1
  module Flumtter
2
- VERSION = "5.4.0"
2
+ VERSION = "5.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flumtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - flum1025
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-08 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -152,6 +152,7 @@ files:
152
152
  - lib/flumtter/app/core/util.rb
153
153
  - lib/flumtter/app/core/windows/base.rb
154
154
  - lib/flumtter/app/core/windows/buf_window.rb
155
+ - lib/flumtter/app/core/windows/conversation.rb
155
156
  - lib/flumtter/app/core/windows/dialog.rb
156
157
  - lib/flumtter/app/core/windows/dmbase.rb
157
158
  - lib/flumtter/app/core/windows/dynamic_view.rb