ayadn 1.8.2 → 2.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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/CHANGELOG.md +73 -52
  4. data/README.md +17 -3
  5. data/ayadn.gemspec +3 -4
  6. data/doc/01-index.md +6 -5
  7. data/doc/02-install.md +23 -1
  8. data/doc/03-first-steps.md +22 -28
  9. data/doc/04-options.md +1 -1
  10. data/doc/05-streams.md +29 -9
  11. data/doc/06-post.md +13 -5
  12. data/doc/07-actions.md +63 -1
  13. data/doc/08-listings.md +112 -4
  14. data/doc/09-accounts.md +17 -3
  15. data/doc/10-nicerank.md +5 -5
  16. data/doc/11-blacklist.md +8 -14
  17. data/doc/12-alias.md +1 -13
  18. data/doc/14-set.md +8 -110
  19. data/doc/15-nowplaying.md +16 -4
  20. data/doc/18-contact.md +14 -13
  21. data/doc/19-examples.md +2 -0
  22. data/lib/ayadn/action.rb +322 -183
  23. data/lib/ayadn/alias.rb +17 -45
  24. data/lib/ayadn/annotations.rb +1 -1
  25. data/lib/ayadn/api.rb +7 -8
  26. data/lib/ayadn/app.rb +99 -12
  27. data/lib/ayadn/authorize.rb +92 -57
  28. data/lib/ayadn/blacklist.rb +52 -62
  29. data/lib/ayadn/check.rb +81 -74
  30. data/lib/ayadn/cnx.rb +77 -26
  31. data/lib/ayadn/databases.rb +890 -105
  32. data/lib/ayadn/debug.rb +30 -89
  33. data/lib/ayadn/descriptions.rb +876 -329
  34. data/lib/ayadn/endpoints.rb +2 -2
  35. data/lib/ayadn/errors.rb +9 -9
  36. data/lib/ayadn/extend.rb +8 -1
  37. data/lib/ayadn/fileops.rb +10 -8
  38. data/lib/ayadn/mark.rb +79 -56
  39. data/lib/ayadn/migration.rb +427 -0
  40. data/lib/ayadn/nicerank.rb +74 -72
  41. data/lib/ayadn/nowplaying.rb +123 -60
  42. data/lib/ayadn/nowwatching.rb +26 -10
  43. data/lib/ayadn/pinboard.rb +12 -7
  44. data/lib/ayadn/post.rb +40 -37
  45. data/lib/ayadn/profile.rb +5 -2
  46. data/lib/ayadn/scroll.rb +20 -5
  47. data/lib/ayadn/search.rb +30 -22
  48. data/lib/ayadn/set.rb +146 -50
  49. data/lib/ayadn/settings.rb +66 -67
  50. data/lib/ayadn/status.rb +459 -234
  51. data/lib/ayadn/stream.rb +80 -46
  52. data/lib/ayadn/switch.rb +51 -47
  53. data/lib/ayadn/tvshow.rb +47 -15
  54. data/lib/ayadn/version.rb +1 -1
  55. data/lib/ayadn/view.rb +119 -60
  56. data/lib/ayadn/workers.rb +144 -92
  57. data/lib/ayadn.rb +7 -8
  58. data/spec/mock/ayadn/accounts.sqlite +0 -0
  59. data/spec/mock/ayadn.sqlite +0 -0
  60. data/spec/unit/annotations_spec.rb +12 -13
  61. data/spec/unit/api_spec.rb +3 -4
  62. data/spec/unit/blacklistworkers_spec.rb +18 -23
  63. data/spec/unit/databases_spec.rb +51 -36
  64. data/spec/unit/endpoints_spec.rb +5 -2
  65. data/spec/unit/extend_spec.rb +24 -0
  66. data/spec/unit/nicerank_spec.rb +13 -13
  67. data/spec/unit/post_spec.rb +47 -36
  68. data/spec/unit/set_spec.rb +67 -96
  69. data/spec/unit/view_spec.rb +12 -6
  70. data/spec/unit/workers_spec.rb +38 -12
  71. data/tags +1285 -0
  72. metadata +29 -39
  73. data/spec/mock/aliases.db +0 -0
  74. data/spec/mock/blacklist.db +0 -0
  75. data/spec/mock/bookmarks.db +0 -0
  76. data/spec/mock/channels.db +0 -0
  77. data/spec/mock/index.db +0 -0
  78. data/spec/mock/nicerank.db +0 -0
  79. data/spec/mock/pagination.db +0 -0
  80. data/spec/mock/users.db +0 -0
  81. data/spec/unit/status_spec.rb +0 -9
data/lib/ayadn/scroll.rb CHANGED
@@ -6,7 +6,7 @@ module Ayadn
6
6
  @api = api
7
7
  @view = view
8
8
  @view.hide_cursor
9
- @chars = %w{ | / - \\ }
9
+ @chars = %w{ - \\ | / }
10
10
  at_exit { @view.show_cursor }
11
11
  end
12
12
 
@@ -20,6 +20,7 @@ module Ayadn
20
20
  end
21
21
 
22
22
  def scroll_it(target, options)
23
+ Settings.global[:scrolling] = true
23
24
  options = check_raw(options)
24
25
  orig_target = target
25
26
  @nr = NiceRank.new
@@ -29,10 +30,12 @@ module Ayadn
29
30
  stream['data'].empty? ? niceranks = {} : niceranks = @nr.get_ranks(stream)
30
31
  Debug.stream stream, options, target
31
32
  target = "explore:#{target}" if explore?(target) # explore but not global
33
+ clear() if Settings.options[:scroll][:spinner] == true
32
34
  show_if_new(stream, options, target, niceranks)
33
35
  target = orig_target if target =~ /explore/
34
36
  options = save_then_return(stream, options, target)
35
37
  countdown
38
+ print "..." if Settings.options[:scroll][:spinner] == true
36
39
  rescue Interrupt
37
40
  canceled
38
41
  end
@@ -40,15 +43,18 @@ module Ayadn
40
43
  end
41
44
 
42
45
  def mentions(username, options)
46
+ Settings.global[:scrolling] = true
43
47
  options = check_raw(options)
44
48
  id = @api.get_user(username)['data']['id']
45
49
  loop do
46
50
  begin
47
51
  stream = @api.get_mentions(username, options)
48
52
  Debug.stream stream, options, username
53
+ clear() if Settings.options[:scroll][:spinner] == true
49
54
  show_if_new(stream, options, "mentions:#{id}")
50
55
  options = save_then_return(stream, options, "mentions:#{id}")
51
56
  countdown
57
+ print "..." if Settings.options[:scroll][:spinner] == true
52
58
  rescue Interrupt
53
59
  canceled
54
60
  end
@@ -56,15 +62,18 @@ module Ayadn
56
62
  end
57
63
 
58
64
  def posts(username, options)
65
+ Settings.global[:scrolling] = true
59
66
  options = check_raw(options)
60
67
  id = @api.get_user(username)['data']['id']
61
68
  loop do
62
69
  begin
63
70
  stream = @api.get_posts(username, options)
64
71
  Debug.stream stream, options, username
72
+ clear() if Settings.options[:scroll][:spinner] == true
65
73
  show_if_new(stream, options, "posts:#{id}")
66
74
  options = save_then_return(stream, options, "posts:#{id}")
67
75
  countdown
76
+ print "..." if Settings.options[:scroll][:spinner] == true
68
77
  rescue Interrupt
69
78
  canceled
70
79
  end
@@ -72,14 +81,17 @@ module Ayadn
72
81
  end
73
82
 
74
83
  def convo(post_id, options)
84
+ Settings.global[:scrolling] = true
75
85
  options = check_raw(options)
76
86
  loop do
77
87
  begin
78
88
  stream = @api.get_convo(post_id, options)
79
89
  Debug.stream stream, options, post_id
90
+ clear() if Settings.options[:scroll][:spinner] == true
80
91
  show_if_new(stream, options, "replies:#{post_id}")
81
92
  options = save_then_return(stream, options, "replies:#{post_id}")
82
93
  countdown
94
+ print "..." if Settings.options[:scroll][:spinner] == true
83
95
  rescue Interrupt
84
96
  canceled
85
97
  end
@@ -87,13 +99,15 @@ module Ayadn
87
99
  end
88
100
 
89
101
  def messages(channel_id, options)
102
+ Settings.global[:scrolling] = true
90
103
  options = check_raw(options)
91
104
  loop do
92
105
  begin
93
106
  stream = @api.get_messages(channel_id, options)
94
107
  Debug.stream stream, options, channel_id
108
+ clear() if Settings.options[:scroll][:spinner] == true
95
109
  show_if_new(stream, options, "channel:#{channel_id}")
96
- if Settings.options[:marker][:update_messages] == true
110
+ if Settings.options[:marker][:messages] == true
97
111
  unless resp['meta']['max_id'].nil?
98
112
  marked = @api.update_marker("channel:#{channel_id}", stream['meta']['max_id'])
99
113
  updated = JSON.parse(marked)
@@ -104,6 +118,7 @@ module Ayadn
104
118
  end
105
119
  options = save_then_return(stream, options, "channel:#{channel_id}")
106
120
  countdown
121
+ print "..." if Settings.options[:scroll][:spinner] == true
107
122
  rescue Interrupt
108
123
  canceled
109
124
  end
@@ -113,12 +128,12 @@ module Ayadn
113
128
  private
114
129
 
115
130
  def countdown
116
- Settings.options[:timeline][:show_spinner] == true ? waiting : pause
131
+ Settings.options[:scroll][:spinner] == true ? waiting : pause
117
132
  end
118
133
 
119
134
  def clear
120
135
  print("\r")
121
- print(" ".ljust(5))
136
+ print(" ".ljust(40))
122
137
  print("\r")
123
138
  end
124
139
 
@@ -208,7 +223,7 @@ module Ayadn
208
223
  end
209
224
 
210
225
  def canceled
211
- puts Status.canceled
226
+ Status.new.canceled
212
227
  exit
213
228
  end
214
229
  end
data/lib/ayadn/search.rb CHANGED
@@ -7,25 +7,29 @@ module Ayadn
7
7
  @api = api
8
8
  @view = view
9
9
  @workers = workers
10
+ @check = Check.new
10
11
  end
11
12
 
12
13
  def hashtag(hashtag, options)
13
- Settings.options[:force] = true if options[:force]
14
+ Settings.global[:force] = true if options[:force]
14
15
  @view.downloading(options)
15
16
  stream = @api.get_hashtag(hashtag)
16
- Check.no_data(stream, 'hashtag')
17
+ @check.no_data(stream, 'hashtag')
17
18
  if options[:extract]
18
19
  @view.all_hashtag_links(stream, hashtag)
19
20
  else
20
21
  @view.render(stream, options)
22
+ if Settings.options[:timeline][:compact] == true && !options[:raw]
23
+ puts "\n"
24
+ end
21
25
  end
22
26
  end
23
27
 
24
28
  def find(words, options)
25
- Settings.options[:force] = true if options[:force]
29
+ Settings.global[:force] = true if options[:force]
26
30
  @view.downloading(options)
27
31
  stream = get_stream(words, options)
28
- Check.no_data(stream, 'search')
32
+ @check.no_data(stream, 'search')
29
33
  if options[:users]
30
34
  get_users(stream, options)
31
35
  elsif options[:channels]
@@ -33,10 +37,30 @@ module Ayadn
33
37
  else
34
38
  get_generic(stream, words, options)
35
39
  end
40
+ if Settings.options[:timeline][:compact] == true && !options[:raw]
41
+ puts "\n"
42
+ end
36
43
  end
37
44
 
38
45
  private
39
46
 
47
+ def get_stream words, options
48
+ if options[:users]
49
+ @api.search_users words, options
50
+ elsif options[:annotations]
51
+ @api.search_annotations words, options
52
+ elsif options[:channels]
53
+ @api.search_channels words, options
54
+ elsif options[:messages]
55
+ words = words.split(',')
56
+ channel_id = @workers.get_channel_id_from_alias(words[0])
57
+ words.shift
58
+ @api.search_messages channel_id, words.join(','), options
59
+ else
60
+ @api.get_search words, options
61
+ end
62
+ end
63
+
40
64
  def get_generic stream, words, options
41
65
  if options[:extract]
42
66
  @view.all_search_links(stream, words)
@@ -52,26 +76,10 @@ module Ayadn
52
76
  def get_users stream, options
53
77
  sorted = stream['data'].sort_by {|obj| obj['counts']['followers']}
54
78
  sorted.each do |obj|
55
- puts @view.big_separator
79
+ puts @view.big_separator unless Settings.options[:timeline][:compact] == true
56
80
  @view.show_userinfos(obj, nil, false)
57
81
  end
58
- end
59
-
60
- def get_stream words, options
61
- if options[:users]
62
- @api.search_users words, options
63
- elsif options[:annotations]
64
- @api.search_annotations words, options
65
- elsif options[:channels]
66
- @api.search_channels words, options
67
- elsif options[:messages]
68
- words = words.split(',')
69
- channel_id = @workers.get_channel_id_from_alias(words[0])
70
- words.shift
71
- @api.search_messages channel_id, words.join(','), options
72
- else
73
- @api.get_search words, options
74
- end
82
+ puts "\n" if Settings.options[:timeline][:compact] == true
75
83
  end
76
84
 
77
85
  end
data/lib/ayadn/set.rb CHANGED
@@ -8,7 +8,8 @@ module Ayadn
8
8
  if args[0]
9
9
  scroll_config.send(args[0], args[1])
10
10
  else
11
- abort(Status.error_missing_parameters)
11
+ Status.new.error_missing_parameters
12
+ exit
12
13
  end
13
14
  scroll_config.save
14
15
  end
@@ -20,7 +21,8 @@ module Ayadn
20
21
  unless args.length != 2
21
22
  movie_config.send(args[0], args[1])
22
23
  else
23
- abort(Status.error_missing_parameters)
24
+ Status.new.error_missing_parameters
25
+ exit
24
26
  end
25
27
  movie_config.save
26
28
  end
@@ -32,7 +34,8 @@ module Ayadn
32
34
  unless args.length != 2
33
35
  tvshow_config.send(args[0], args[1])
34
36
  else
35
- abort(Status.error_missing_parameters)
37
+ Status.new.error_missing_parameters
38
+ exit
36
39
  end
37
40
  tvshow_config.save
38
41
  end
@@ -44,11 +47,37 @@ module Ayadn
44
47
  unless args.length != 2
45
48
  marker_config.send(args[0], args[1])
46
49
  else
47
- abort(Status.error_missing_parameters)
50
+ Status.new.error_missing_parameters
51
+ exit
48
52
  end
49
53
  marker_config.save
50
54
  end
51
55
 
56
+ desc "channels ITEM TRUE/FALSE", "Set values for stream markers"
57
+ map "channel" => :channels
58
+ def channels(*args)
59
+ channels_config = SetChannels.new
60
+ unless args.length != 2
61
+ channels_config.send(args[0], args[1])
62
+ else
63
+ Status.new.error_missing_parameters
64
+ exit
65
+ end
66
+ channels_config.save
67
+ end
68
+
69
+ desc "blacklist ITEM TRUE/FALSE", "Set values for the blacklist"
70
+ def blacklist(*args)
71
+ blacklist_config = SetBlacklist.new
72
+ unless args.length != 2
73
+ blacklist_config.send(args[0], args[1])
74
+ else
75
+ Status.new.error_missing_parameters
76
+ exit
77
+ end
78
+ blacklist_config.save
79
+ end
80
+
52
81
  desc "nicerank ITEM VALUE", "Set NiceRank filter values"
53
82
  long_desc Descriptions.set_nicerank
54
83
  def nicerank *args
@@ -56,7 +85,8 @@ module Ayadn
56
85
  if args[0]
57
86
  nicerank_config.send(args[0], args[1])
58
87
  else
59
- abort(Status.error_missing_parameters)
88
+ Status.new.error_missing_parameters
89
+ exit
60
90
  end
61
91
  nicerank_config.save
62
92
  end
@@ -69,13 +99,14 @@ module Ayadn
69
99
  begin
70
100
  timeline_config.send(args[0], args[1])
71
101
  rescue NoMethodError, ArgumentError
72
- puts Status.error_missing_parameters
102
+ Status.new.error_missing_parameters
73
103
  exit
74
104
  rescue => e
75
105
  raise e
76
106
  end
77
107
  else
78
- abort(Status.error_missing_parameters)
108
+ Status.new.error_missing_parameters
109
+ exit
79
110
  end
80
111
  timeline_config.save
81
112
  end
@@ -89,13 +120,14 @@ module Ayadn
89
120
  begin
90
121
  counts_config.send(args[0], args[1])
91
122
  rescue NoMethodError, ArgumentError
92
- puts Status.error_missing_parameters
123
+ Status.new.error_missing_parameters
93
124
  exit
94
125
  rescue => e
95
126
  raise e
96
127
  end
97
128
  else
98
- abort(Status.error_missing_parameters)
129
+ Status.new.error_missing_parameters
130
+ exit
99
131
  end
100
132
  counts_config.save
101
133
  end
@@ -111,13 +143,14 @@ module Ayadn
111
143
  begin
112
144
  color_config.send(args[0], args[1])
113
145
  rescue NoMethodError, ArgumentError
114
- puts Status.error_missing_parameters
146
+ Status.new.error_missing_parameters
115
147
  exit
116
148
  rescue => e
117
149
  raise e
118
150
  end
119
151
  else
120
- abort(Status.error_missing_parameters)
152
+ Status.new.error_missing_parameters
153
+ exit
121
154
  end
122
155
  color_config.save
123
156
  end
@@ -130,13 +163,14 @@ module Ayadn
130
163
  begin
131
164
  backup_config.send(args[0], args[1])
132
165
  rescue NoMethodError, ArgumentError
133
- puts Status.error_missing_parameters
166
+ Status.new.error_missing_parameters
134
167
  exit
135
168
  rescue => e
136
169
  raise e
137
170
  end
138
171
  else
139
- abort(Status.error_missing_parameters)
172
+ Status.new.error_missing_parameters
173
+ exit
140
174
  end
141
175
  backup_config.save
142
176
  end
@@ -145,7 +179,7 @@ module Ayadn
145
179
  long_desc Descriptions.set_defaults
146
180
  def defaults
147
181
  Settings.restore_defaults
148
- puts Status.done
182
+ Status.new.done
149
183
  end
150
184
 
151
185
  desc "formats ITEM VALUE", "Set values for formatting fields"
@@ -156,13 +190,14 @@ module Ayadn
156
190
  command = args.shift
157
191
  formats_config.send(command, args)
158
192
  rescue NoMethodError, ArgumentError
159
- puts Status.error_missing_parameters
193
+ Status.new.error_missing_parameters
160
194
  exit
161
195
  rescue => e
162
196
  raise e
163
197
  end
164
198
  else
165
- abort(Status.error_missing_parameters)
199
+ Status.new.error_missing_parameters
200
+ exit
166
201
  end
167
202
  formats_config.save
168
203
  end
@@ -178,7 +213,8 @@ module Ayadn
178
213
  when "false", "0", "no"
179
214
  false
180
215
  else
181
- abort(Status.error_missing_parameters)
216
+ Status.new.error_missing_parameters
217
+ exit
182
218
  end
183
219
  end
184
220
 
@@ -187,15 +223,7 @@ module Ayadn
187
223
  if x >= min && x <= max
188
224
  x
189
225
  else
190
- abort(Status.must_be_integer)
191
- end
192
- end
193
-
194
- def self.cache_range value
195
- if value >= 1 && value <= 168
196
- value.round
197
- else
198
- abort(Status.cache_range)
226
+ Status.new.must_be_integer
199
227
  end
200
228
  end
201
229
 
@@ -212,7 +240,7 @@ module Ayadn
212
240
  if value > 0 and value < 5
213
241
  value
214
242
  else
215
- abort(Status.threshold)
243
+ Status.new.threshold
216
244
  end
217
245
  end
218
246
 
@@ -224,8 +252,9 @@ module Ayadn
224
252
  def self.color(color)
225
253
  colors_list = %w{red green magenta cyan yellow blue white black}
226
254
  unless colors_list.include?(color.to_s)
227
- puts Status.error_missing_parameters
228
- abort(Status.valid_colors(colors_list))
255
+ Status.new.error_missing_parameters
256
+ Status.new.valid_colors(colors_list)
257
+ exit
229
258
  else
230
259
  return color.to_sym
231
260
  end
@@ -242,6 +271,8 @@ module Ayadn
242
271
  Settings.get_token()
243
272
  Settings.init_config()
244
273
  Logs.create_logger()
274
+ @thor = Thor::Shell::Color.new
275
+ @status = Status.new
245
276
  end
246
277
 
247
278
  def save
@@ -250,9 +281,11 @@ module Ayadn
250
281
  end
251
282
 
252
283
  def log
253
- x = "New value for '#{@input}' in '#{@category}' => #{@output}"
254
- puts "\n#{x}\n".color(:cyan)
255
- Logs.rec.info x
284
+ @status.say do
285
+ @thor.say_status(:updated, "'#{@input}' in '#{@category}'", :cyan)
286
+ @thor.say_status(:content, "'#{@output}'", :green)
287
+ end
288
+ Logs.rec.info "new value for '#{@input}' in '#{@category}' => '#{@output}'"
256
289
  end
257
290
 
258
291
  end
@@ -266,13 +299,19 @@ module Ayadn
266
299
 
267
300
  def table(args)
268
301
  type = args.shift.downcase
269
- value = args[0].to_i
270
302
  if type == 'width'
303
+ value = args[0].to_i
271
304
  @input = 'table width'
272
305
  @output = Validators.width_range(value)
273
306
  Settings.options[:formats][:table][:width] = @output
307
+ elsif type == 'borders' || type == 'border'
308
+ value = args[0]
309
+ @input = 'table borders'
310
+ @output = Validators.boolean(value)
311
+ Settings.options[:formats][:table][:borders] = @output
274
312
  else
275
- abort(Status.error_missing_parameters)
313
+ @status.error_missing_parameters
314
+ exit
276
315
  end
277
316
  end
278
317
 
@@ -288,7 +327,8 @@ module Ayadn
288
327
  @output = Validators.boolean(value)
289
328
  Settings.options[:formats][:list][:reverse] = @output
290
329
  else
291
- abort(Status.error_missing_parameters)
330
+ @status.error_missing_parameters
331
+ exit
292
332
  end
293
333
  end
294
334
 
@@ -315,6 +355,18 @@ module Ayadn
315
355
  Settings.options[:scroll][:timer] = @output
316
356
  end
317
357
 
358
+ def date(value)
359
+ @input = 'date'
360
+ @output = Validators.boolean(value)
361
+ Settings.options[:scroll][:date] = @output
362
+ end
363
+
364
+ def spinner(value)
365
+ @input = 'spinner'
366
+ @output = Validators.boolean(value)
367
+ Settings.options[:scroll][:spinner] = @output
368
+ end
369
+
318
370
  end
319
371
 
320
372
  class SetMovie < SetBase
@@ -360,10 +412,14 @@ module Ayadn
360
412
  Settings.options[:nicerank][:filter] = @output
361
413
  end
362
414
 
363
- def filter_unranked value
364
- @input = 'filter_unranked'
415
+ def active value
416
+ filter(value)
417
+ end
418
+
419
+ def unranked value
420
+ @input = 'unranked'
365
421
  @output = Validators.boolean(value)
366
- Settings.options[:nicerank][:filter_unranked] = @output
422
+ Settings.options[:nicerank][:unranked] = @output
367
423
  end
368
424
 
369
425
  def threshold value
@@ -372,12 +428,6 @@ module Ayadn
372
428
  Settings.options[:nicerank][:threshold] = @output
373
429
  end
374
430
 
375
- def cache value
376
- @input = 'cache'
377
- @output = Validators.cache_range(value.to_i)
378
- Settings.options[:nicerank][:cache] = @output
379
- end
380
-
381
431
  end
382
432
 
383
433
  class SetBackup < SetBase
@@ -395,7 +445,7 @@ module Ayadn
395
445
  @input = meth.to_s
396
446
  @output = validate(options)
397
447
  case @input
398
- when 'auto_save_sent_posts', 'auto_save_sent_messages', 'auto_save_lists'
448
+ when 'posts', 'messages', 'lists'
399
449
  Settings.options[:backup][meth.to_sym] = @output
400
450
  else
401
451
  super
@@ -419,7 +469,7 @@ module Ayadn
419
469
  @input = meth.to_s
420
470
  @output = validate(options)
421
471
  case @input
422
- when 'update_messages'
472
+ when 'messages'
423
473
  Settings.options[:marker][meth.to_sym] = @output
424
474
  else
425
475
  super
@@ -428,6 +478,54 @@ module Ayadn
428
478
 
429
479
  end
430
480
 
481
+ class SetChannels < SetBase
482
+
483
+ def initialize
484
+ super
485
+ @category = 'channels'
486
+ end
487
+
488
+ def validate(value)
489
+ Validators.boolean(value)
490
+ end
491
+
492
+ def method_missing(meth, options)
493
+ @input = meth.to_s
494
+ @output = validate(options)
495
+ case @input
496
+ when 'links'
497
+ Settings.options[:channels][meth.to_sym] = @output
498
+ else
499
+ super
500
+ end
501
+ end
502
+
503
+ end
504
+
505
+ class SetBlacklist < SetBase
506
+
507
+ def initialize
508
+ super
509
+ @category = 'blacklist'
510
+ end
511
+
512
+ def validate(value)
513
+ Validators.boolean(value)
514
+ end
515
+
516
+ def method_missing(meth, options)
517
+ @input = meth.to_s
518
+ @output = validate(options)
519
+ case @input
520
+ when 'active', 'activated'
521
+ Settings.options[:blacklist][meth.to_sym] = @output
522
+ else
523
+ super
524
+ end
525
+ end
526
+
527
+ end
528
+
431
529
  class SetCounts < SetBase
432
530
 
433
531
  def initialize
@@ -467,10 +565,8 @@ module Ayadn
467
565
  @input = meth.to_s
468
566
  @output = validate(options)
469
567
  case @input
470
- when 'directed', 'html', 'show_source', 'show_symbols', 'show_real_name', 'show_date', 'show_spinner', 'show_debug', 'compact', 'show_channel_oembed'
568
+ when 'directed', 'source', 'symbols', 'name', 'date', 'debug', 'compact'
471
569
  Settings.options[:timeline][meth.to_sym] = @output
472
- when 'deleted', 'annotations'
473
- abort(Status.not_mutable)
474
570
  else
475
571
  super
476
572
  end
@@ -493,7 +589,7 @@ module Ayadn
493
589
  @input = meth.to_s.capitalize
494
590
  @output = validate(options)
495
591
  case meth.to_s
496
- when 'id', 'index', 'username', 'name', 'date', 'link', 'dots', 'hashtags', 'mentions', 'source', 'symbols', 'unread', 'debug'
592
+ when 'id', 'index', 'username', 'name', 'date', 'link', 'dots', 'hashtags', 'mentions', 'source', 'symbols', 'unread', 'debug', 'excerpt'
497
593
  Settings.options[:colors][meth.to_sym] = @output
498
594
  when 'hashtag', 'mention', 'symbol'
499
595
  Settings.options[:colors]["#{meth}s".to_sym] = @output