ayadn 1.2.1 → 1.2.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/ayadn/scroll.rb +34 -5
- data/lib/ayadn/set.rb +3 -0
- data/lib/ayadn/settings.rb +2 -1
- data/lib/ayadn/version.rb +1 -1
- data/lib/ayadn/view.rb +3 -2
- data/lib/ayadn/workers.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b368e6b16ec1903579576dc5a461f3037e5e7fd
|
4
|
+
data.tar.gz: 485754ebd58ac05955588af81b4fda20bff937b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acfcc32900d14e089df868901d0bd066675849e2708398d93c3cfc5aaa61a6a5d596bbaf11e7c7bd2adca9b536379de5ca6d8afed288960901a79c774f5d133b
|
7
|
+
data.tar.gz: 1390378aaf18adf3f0f2ec1dc70df9ae1d4df927a161fb5793dd3ceeb5875d54c1b91df81c6d49589c5ce34cea82db044db85328dd67982b104decaa04c71767
|
data/CHANGELOG.md
CHANGED
data/lib/ayadn/scroll.rb
CHANGED
@@ -5,6 +5,7 @@ module Ayadn
|
|
5
5
|
def initialize(api, view)
|
6
6
|
@api = api
|
7
7
|
@view = view
|
8
|
+
@chars = %w{ | / - \\ }
|
8
9
|
end
|
9
10
|
|
10
11
|
def method_missing(meth, options, niceranks = {})
|
@@ -35,7 +36,7 @@ module Ayadn
|
|
35
36
|
show_if_new(stream, options, target, niceranks)
|
36
37
|
target = orig_target if target =~ /explore/
|
37
38
|
options = save_then_return(stream, options)
|
38
|
-
|
39
|
+
countdown
|
39
40
|
rescue Interrupt
|
40
41
|
canceled
|
41
42
|
end
|
@@ -51,7 +52,7 @@ module Ayadn
|
|
51
52
|
stream = @api.get_mentions(username, options)
|
52
53
|
show_if_new(stream, options, "mentions:#{id}")
|
53
54
|
options = save_then_return(stream, options)
|
54
|
-
|
55
|
+
countdown
|
55
56
|
rescue Interrupt
|
56
57
|
canceled
|
57
58
|
end
|
@@ -67,7 +68,7 @@ module Ayadn
|
|
67
68
|
stream = @api.get_posts(username, options)
|
68
69
|
show_if_new(stream, options, "posts:#{id}")
|
69
70
|
options = save_then_return(stream, options)
|
70
|
-
|
71
|
+
countdown
|
71
72
|
rescue Interrupt
|
72
73
|
canceled
|
73
74
|
end
|
@@ -81,7 +82,7 @@ module Ayadn
|
|
81
82
|
stream = @api.get_convo(post_id, options)
|
82
83
|
show_if_new(stream, options, "replies:#{post_id}")
|
83
84
|
options = save_then_return(stream, options)
|
84
|
-
|
85
|
+
countdown
|
85
86
|
rescue Interrupt
|
86
87
|
canceled
|
87
88
|
end
|
@@ -95,7 +96,7 @@ module Ayadn
|
|
95
96
|
stream = @api.get_messages(channel_id, options)
|
96
97
|
show_if_new(stream, options, "channel:#{channel_id}")
|
97
98
|
options = save_then_return(stream, options)
|
98
|
-
|
99
|
+
countdown
|
99
100
|
rescue Interrupt
|
100
101
|
canceled
|
101
102
|
end
|
@@ -104,6 +105,27 @@ module Ayadn
|
|
104
105
|
|
105
106
|
private
|
106
107
|
|
108
|
+
def countdown
|
109
|
+
if Settings.options[:timeline][:show_spinner] == true
|
110
|
+
waiting
|
111
|
+
else
|
112
|
+
pause
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def clear
|
117
|
+
print("\r")
|
118
|
+
print(" ".ljust(5))
|
119
|
+
print("\r")
|
120
|
+
end
|
121
|
+
|
122
|
+
def spin
|
123
|
+
print(@chars[0]) # Print the next character...
|
124
|
+
sleep(0.1) # ...wait 100ms...
|
125
|
+
print("\b") # ...move the cursor back by one...
|
126
|
+
@chars.push(@chars.shift) # ...rotate the characters array.
|
127
|
+
end
|
128
|
+
|
107
129
|
def get(target, options)
|
108
130
|
case target
|
109
131
|
when 'global'
|
@@ -130,6 +152,13 @@ module Ayadn
|
|
130
152
|
end
|
131
153
|
end
|
132
154
|
|
155
|
+
def waiting
|
156
|
+
interval = Settings.options[:scroll][:timer] * 10
|
157
|
+
interval.times do
|
158
|
+
spin
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
133
162
|
def pause
|
134
163
|
sleep Settings.options[:scroll][:timer]
|
135
164
|
end
|
data/lib/ayadn/set.rb
CHANGED
data/lib/ayadn/settings.rb
CHANGED
data/lib/ayadn/version.rb
CHANGED
data/lib/ayadn/view.rb
CHANGED
@@ -8,12 +8,13 @@ module Ayadn
|
|
8
8
|
|
9
9
|
def show_posts_with_index(data, options, niceranks = {})
|
10
10
|
posts, view = build_stream_with_index(data, options, niceranks)
|
11
|
-
puts view
|
11
|
+
puts view unless view == ""
|
12
12
|
Databases.save_indexed_posts(posts)
|
13
13
|
end
|
14
14
|
|
15
15
|
def show_posts(data, options, niceranks = {})
|
16
|
-
|
16
|
+
resp = build_stream_without_index(data, options, niceranks)
|
17
|
+
puts resp unless resp == ""
|
17
18
|
end
|
18
19
|
|
19
20
|
def show_raw(stream)
|
data/lib/ayadn/workers.rb
CHANGED
@@ -285,8 +285,9 @@ module Ayadn
|
|
285
285
|
end
|
286
286
|
|
287
287
|
def colorize_text(text, mentions)
|
288
|
-
reg_split = '[
|
289
|
-
reg_tag = '#([A-Za-z0-9_]{1,255})(?![\w+])'
|
288
|
+
reg_split = '[~:-;,?!\'&`^=+<>*%()\/"“”’°£$€.…]'
|
289
|
+
#reg_tag = '#([A-Za-z0-9_]{1,255})(?![\w+])'
|
290
|
+
reg_tag = '#([[:alpha:]0-9_]{1,255})(?![\w+])'
|
290
291
|
reg_mention = '@([A-Za-z0-9_]{1,20})(?![\w+])'
|
291
292
|
reg_sentence = '^.+[\r\n]*'
|
292
293
|
handles = Array.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ayadn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dejonckheere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|