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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f64d4a9f123865a1ffdc6e4c5fca9964e69e474
4
- data.tar.gz: cefb09e6ed542aefc4524eca6d241ca8349573ba
3
+ metadata.gz: 2b368e6b16ec1903579576dc5a461f3037e5e7fd
4
+ data.tar.gz: 485754ebd58ac05955588af81b4fda20bff937b8
5
5
  SHA512:
6
- metadata.gz: 3d8614bf8d44a5b17545c53a88ce3494f599f1eb5b6ca87518e6c42b724cdb6f2ff678ff84c2ad85804cc128d46a9124e55ee60123992088f29cfc10b2f05061
7
- data.tar.gz: 3e7f351f1ef032ed543aed575ee3e0598bf59e31a6156bc1c3d7f12cbff3f7954e69a8a4502910b6e1df0fdd3b211f88fb04ec42fdc1402bea077edcb790a713
6
+ metadata.gz: acfcc32900d14e089df868901d0bd066675849e2708398d93c3cfc5aaa61a6a5d596bbaf11e7c7bd2adca9b536379de5ca6d8afed288960901a79c774f5d133b
7
+ data.tar.gz: 1390378aaf18adf3f0f2ec1dc70df9ae1d4df927a161fb5793dd3ceeb5875d54c1b91df81c6d49589c5ce34cea82db044db85328dd67982b104decaa04c71767
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 1.2.2 - 'Chris'
2
+
3
+ - No more empty lines in the scroll
4
+ - Spinner while waiting for posts (false by default)
5
+ - Hashtags support accented characters
6
+
1
7
  # 1.2.1 - 'Vinz'
2
8
 
3
9
  - Fixed the exclusion bug in NiceRank filters
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
- pause
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
- pause
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
- pause
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
- pause
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
- pause
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
@@ -376,6 +376,9 @@ module Ayadn
376
376
  end
377
377
  Settings.options[:timeline][:show_nicerank] = value
378
378
  end
379
+ def show_spinner value
380
+ Settings.options[:timeline][:show_spinner] = value
381
+ end
379
382
  end
380
383
 
381
384
  class SetColor
@@ -152,7 +152,8 @@ module Ayadn
152
152
  show_symbols: true,
153
153
  show_real_name: true,
154
154
  show_date: true,
155
- show_nicerank: false
155
+ show_nicerank: false,
156
+ show_spinner: false
156
157
  },
157
158
  counts: {
158
159
  default: 50,
data/lib/ayadn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Ayadn
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.2"
4
4
  end
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
- puts build_stream_without_index(data, options, niceranks)
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.1
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-20 00:00:00.000000000 Z
11
+ date: 2014-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor