ayadn 1.7.4 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/doc/05-streams.md +10 -0
- data/lib/ayadn/action.rb +5 -1
- data/lib/ayadn/errors.rb +1 -1
- data/lib/ayadn/post.rb +4 -0
- data/lib/ayadn/set.rb +1 -1
- data/lib/ayadn/settings.rb +3 -1
- data/lib/ayadn/stream.rb +31 -16
- data/lib/ayadn/version.rb +1 -1
- data/lib/ayadn/view.rb +18 -6
- data/lib/ayadn/workers.rb +9 -2
- data/spec/unit/workers_spec.rb +1 -0
- 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: b101f2949d37db133dd7f1955d95aec8fac1424c
|
4
|
+
data.tar.gz: 32222443d4c962edaf8fbbb2658bb9716284c55c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26014e72af700bcecee4792546ca015ca9efdb8083042b3bf2498cc940ef11501917d946f7d30f149b3b19ce2a88f027d7270b8741b298e8660a5be85cd6c62c
|
7
|
+
data.tar.gz: 74d280a4461e5f78ec746e4506b23cd433f3338a118a960324b7849b6d92c12b1e6e3d28523ff1ec2fc372273813c39c706b099897e1af563ef8440862aca838
|
data/CHANGELOG.md
CHANGED
data/doc/05-streams.md
CHANGED
@@ -115,6 +115,16 @@ Differences will occur due to ADN policy:
|
|
115
115
|
|
116
116
|
- Other streams, search, tags: temporarily disables the Blacklist databases
|
117
117
|
|
118
|
+
### COMPACT
|
119
|
+
|
120
|
+
Removes the line-breaks when possible, and forces the view to be "compact".
|
121
|
+
|
122
|
+
Set it with:
|
123
|
+
|
124
|
+
`ayadn set timeline compact true`
|
125
|
+
|
126
|
+
You may want to change colors to create visual marks between posts if you choose the compact view, i.e. putting the all header in the same color (post id, username, name, etc).
|
127
|
+
|
118
128
|
|
119
129
|
# GLOBAL
|
120
130
|
|
data/lib/ayadn/action.rb
CHANGED
@@ -379,7 +379,11 @@ module Ayadn
|
|
379
379
|
Errors.repost(post_id, resp['repost_of']['id'])
|
380
380
|
@view.show_simple_post([resp['repost_of']], options)
|
381
381
|
end
|
382
|
-
|
382
|
+
if Settings.options[:timeline][:compact] == true
|
383
|
+
puts "\nAUTHOR:\n".inverse
|
384
|
+
else
|
385
|
+
puts "AUTHOR:\n".inverse
|
386
|
+
end
|
383
387
|
if response['data']['username'] == Settings.config[:identity][:username]
|
384
388
|
@view.show_userinfos(stream, @api.get_token_info['data'], true)
|
385
389
|
else
|
data/lib/ayadn/errors.rb
CHANGED
data/lib/ayadn/post.rb
CHANGED
@@ -106,6 +106,10 @@ module Ayadn
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def post_size(post) # works on a string
|
109
|
+
words = post.split(" ")
|
110
|
+
result = []
|
111
|
+
words.each { |word| result << get_markdown_text(word) }
|
112
|
+
post = result.join(" ")
|
109
113
|
size, max_size = post.length, Settings.config[:post_max_length]
|
110
114
|
if size < 1
|
111
115
|
abort(error_text_empty)
|
data/lib/ayadn/set.rb
CHANGED
@@ -431,7 +431,7 @@ module Ayadn
|
|
431
431
|
@input = meth.to_s
|
432
432
|
@output = validate(options)
|
433
433
|
case @input
|
434
|
-
when 'directed', 'html', 'show_source', 'show_symbols', 'show_real_name', 'show_date', 'show_spinner', 'show_debug'
|
434
|
+
when 'directed', 'html', 'show_source', 'show_symbols', 'show_real_name', 'show_date', 'show_spinner', 'show_debug', 'compact'
|
435
435
|
Settings.options[:timeline][meth.to_sym] = @output
|
436
436
|
when 'deleted', 'annotations'
|
437
437
|
abort(Status.not_mutable)
|
data/lib/ayadn/settings.rb
CHANGED
@@ -99,6 +99,7 @@ module Ayadn
|
|
99
99
|
conf[:movie] = {hashtag: 'nowwatching'} if conf[:movie].nil?
|
100
100
|
conf[:tvshow] = {hashtag: 'nowwatching'} if conf[:tvshow].nil?
|
101
101
|
conf[:formats][:list] = {reverse: true} if conf[:formats][:list].nil?
|
102
|
+
conf[:timeline][:compact] = false if conf[:timeline][:compact].nil?
|
102
103
|
|
103
104
|
@options = conf
|
104
105
|
self.write_config_file(config_file, @options)
|
@@ -174,7 +175,8 @@ module Ayadn
|
|
174
175
|
show_real_name: true,
|
175
176
|
show_date: true,
|
176
177
|
show_spinner: true,
|
177
|
-
show_debug: false
|
178
|
+
show_debug: false,
|
179
|
+
compact: false
|
178
180
|
},
|
179
181
|
counts: {
|
180
182
|
default: 50,
|
data/lib/ayadn/stream.rb
CHANGED
@@ -14,11 +14,16 @@ module Ayadn
|
|
14
14
|
options = settings.dup
|
15
15
|
options[:filter] = nicerank_true()
|
16
16
|
@view.downloading(options)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
unless options[:scroll]
|
18
|
+
stream = @api.get_global(options)
|
19
|
+
Settings.options[:force] == true ? niceranks = {} : niceranks = NiceRank.new.get_ranks(stream)
|
20
|
+
Check.no_new_posts(stream, options, 'global')
|
21
|
+
Databases.save_max_id(stream, 'global') unless stream['meta']['max_id'].nil?
|
22
|
+
@view.render(stream, options, niceranks)
|
23
|
+
end
|
24
|
+
if Settings.options[:timeline][:compact] == true && options[:scroll] == true
|
25
|
+
@view.clear_screen()
|
26
|
+
end
|
22
27
|
Scroll.new(@api, @view).global(options) if options[:scroll]
|
23
28
|
end
|
24
29
|
|
@@ -39,10 +44,15 @@ module Ayadn
|
|
39
44
|
def stream meth, options, target
|
40
45
|
Settings.options[:force] = true if options[:force]
|
41
46
|
@view.downloading(options)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
47
|
+
unless options[:scroll]
|
48
|
+
stream = @api.send("get_#{meth}".to_sym, options)
|
49
|
+
Check.no_new_posts(stream, options, target)
|
50
|
+
Databases.save_max_id(stream)
|
51
|
+
@view.render(stream, options)
|
52
|
+
end
|
53
|
+
if Settings.options[:timeline][:compact] == true && options[:scroll] == true
|
54
|
+
@view.clear_screen()
|
55
|
+
end
|
46
56
|
Scroll.new(@api, @view).send(meth, options) if options[:scroll]
|
47
57
|
end
|
48
58
|
|
@@ -52,13 +62,18 @@ module Ayadn
|
|
52
62
|
Check.no_username(username)
|
53
63
|
username = @workers.add_arobase(username)
|
54
64
|
@view.downloading(options)
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
65
|
+
unless options[:scroll]
|
66
|
+
stream = @api.get_mentions(username, options)
|
67
|
+
Check.no_user(stream, username)
|
68
|
+
Databases.save_max_id(stream)
|
69
|
+
Check.no_data(stream, 'mentions')
|
70
|
+
options = options.dup
|
71
|
+
options[:in_mentions] = true
|
72
|
+
@view.render(stream, options)
|
73
|
+
end
|
74
|
+
if Settings.options[:timeline][:compact] == true && options[:scroll] == true
|
75
|
+
@view.clear_screen()
|
76
|
+
end
|
62
77
|
Scroll.new(@api, @view).mentions(username, options) if options[:scroll]
|
63
78
|
end
|
64
79
|
|
data/lib/ayadn/version.rb
CHANGED
data/lib/ayadn/view.rb
CHANGED
@@ -551,12 +551,12 @@ module Ayadn
|
|
551
551
|
def build_content(content)
|
552
552
|
view = ""
|
553
553
|
view << build_header(content)
|
554
|
-
view << "\n"
|
554
|
+
view << "\n" unless Settings.options[:timeline][:compact] == true
|
555
555
|
view << content[:text]
|
556
|
-
view << "\n"
|
556
|
+
view << "\n" unless Settings.options[:timeline][:compact] == true
|
557
557
|
if content[:has_checkins]
|
558
558
|
view << build_checkins(content)
|
559
|
-
view << "\n"
|
559
|
+
view << "\n" unless Settings.options[:timeline][:compact] == true
|
560
560
|
end
|
561
561
|
unless content[:links].empty?
|
562
562
|
view << "\n"
|
@@ -565,7 +565,15 @@ module Ayadn
|
|
565
565
|
view << "\n"
|
566
566
|
end
|
567
567
|
end
|
568
|
-
|
568
|
+
if Settings.options[:timeline][:compact] == true
|
569
|
+
if content[:links].empty?
|
570
|
+
view << "\n"
|
571
|
+
else
|
572
|
+
view
|
573
|
+
end
|
574
|
+
else
|
575
|
+
view << "\n\n"
|
576
|
+
end
|
569
577
|
end
|
570
578
|
|
571
579
|
def build_header(content)
|
@@ -598,8 +606,12 @@ module Ayadn
|
|
598
606
|
else
|
599
607
|
num_dots = 10
|
600
608
|
end
|
601
|
-
|
602
|
-
|
609
|
+
if Settings.options[:timeline][:compact] == true
|
610
|
+
hd = "\n"
|
611
|
+
else
|
612
|
+
hd = (".".color(Settings.options[:colors][:dots])) * num_dots
|
613
|
+
hd << "\n"
|
614
|
+
end
|
603
615
|
formatted = { header: hd }
|
604
616
|
content[:checkins].each do |key, val|
|
605
617
|
formatted[key] = val
|
data/lib/ayadn/workers.rb
CHANGED
@@ -113,7 +113,9 @@ module Ayadn
|
|
113
113
|
else
|
114
114
|
table << [ "@#{username} ".color(Settings.options[:colors][:username]), "", posts_day ]
|
115
115
|
end
|
116
|
-
|
116
|
+
if index + 1 != list.length && Settings.options[:timeline][:compact] == false
|
117
|
+
table << :separator
|
118
|
+
end
|
117
119
|
end
|
118
120
|
table
|
119
121
|
end
|
@@ -472,7 +474,12 @@ module Ayadn
|
|
472
474
|
sentences << words.join(' ')
|
473
475
|
words = Array.new
|
474
476
|
end
|
475
|
-
|
477
|
+
if Settings.options[:timeline][:compact] == true
|
478
|
+
without_linebreaks = sentences.keep_if { |s| s != "" }
|
479
|
+
without_linebreaks.join("\n")
|
480
|
+
else
|
481
|
+
sentences.join("\n")
|
482
|
+
end
|
476
483
|
end
|
477
484
|
|
478
485
|
def links_from_posts(stream)
|
data/spec/unit/workers_spec.rb
CHANGED
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.7.
|
4
|
+
version: 1.7.5
|
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-
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|