Class: Ayadn::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/ayadn/status.rb

Class Method Summary collapse

Class Method Details

.autoObject



238
239
240
241
242
243
# File 'lib/ayadn/status.rb', line 238

def self.auto
  view = "\nEntering the auto posting mode.\n\n".color(:cyan)
  view << "In this mode, each line you type (each time you hit ENTER!) is automatically posted to ADN.\n\n".color(:cyan)
  view << "At any moment, starting now, hit CTRL+C to exit.\n\n".color(:yellow)
  view << "\n\t--AUTO POSTING MODE ACTIVATED--\n\n".color(:red)
end

.blocked(username) ⇒ Object



118
119
120
# File 'lib/ayadn/status.rb', line 118

def self.blocked(username)
  "\nUser #{username} has been blocked.\n".color(:green)
end

.blocking(username) ⇒ Object



37
38
39
# File 'lib/ayadn/status.rb', line 37

def self.blocking(username)
  "\nBlocking #{username}".inverse
end

.cache_rangeObject



247
248
249
# File 'lib/ayadn/status.rb', line 247

def self.cache_range
  "\nPlease enter a number of hours between 1 and 168.\n\n".color(:red)
end

.canceledObject



214
215
216
# File 'lib/ayadn/status.rb', line 214

def self.canceled
  "\n\nCanceled.\n\n".color(:cyan)
end

.deleted(post_id) ⇒ Object



85
86
87
# File 'lib/ayadn/status.rb', line 85

def self.deleted(post_id)
  "\nPost #{post_id} has been deleted.\n".color(:green)
end

.deleted_m(message_id) ⇒ Object



88
89
90
# File 'lib/ayadn/status.rb', line 88

def self.deleted_m(message_id)
  "\nMessage #{message_id} has been deleted.\n".color(:green)
end

.deleting_message(message_id) ⇒ Object



19
20
21
# File 'lib/ayadn/status.rb', line 19

def self.deleting_message(message_id)
  "\nDeleting message #{message_id}\n".inverse
end

.deleting_post(post_id) ⇒ Object



16
17
18
# File 'lib/ayadn/status.rb', line 16

def self.deleting_post(post_id)
  "\nDeleting post #{post_id}\n".inverse
end

.doneObject



4
5
6
# File 'lib/ayadn/status.rb', line 4

def self.done
  "\nDone.\n".color(:green)
end

.downloaded(name) ⇒ Object



7
8
9
# File 'lib/ayadn/status.rb', line 7

def self.downloaded(name)
  "\nFile downloaded in #{Settings.config[:paths][:downloads]}/#{name}\n".color(:green)
end

.downloadingObject



10
11
12
# File 'lib/ayadn/status.rb', line 10

def self.downloading
  "Downloading from ADN...\n\n".inverse
end

.empty_fieldsObject



211
212
213
# File 'lib/ayadn/status.rb', line 211

def self.empty_fields
  "\nCanceled: couldn't get enough information (empty field).\n\n".color(:red)
end

.empty_listObject



139
140
141
# File 'lib/ayadn/status.rb', line 139

def self.empty_list
  "\n\nThe list is empty.\n\n".color(:red)
end

.error_missing_channel_idObject



130
131
132
# File 'lib/ayadn/status.rb', line 130

def self.error_missing_channel_id
  "\nYou have to specify a channel id.\n".color(:red)
end

.error_missing_hashtagObject



133
134
135
# File 'lib/ayadn/status.rb', line 133

def self.error_missing_hashtag
  "\nYou have to specify one or more hashtag(s).\n".color(:red)
end

.error_missing_message_idObject



127
128
129
# File 'lib/ayadn/status.rb', line 127

def self.error_missing_message_id
  "\nYou have to specify a message id.\n".color(:red)
end

.error_missing_parametersObject



136
137
138
# File 'lib/ayadn/status.rb', line 136

def self.error_missing_parameters
  "\nYou have to submit valid items. See 'ayadn -sg' for a list of valid parameters and values.\n".color(:red)
end

.error_missing_post_idObject



124
125
126
# File 'lib/ayadn/status.rb', line 124

def self.error_missing_post_id
  "\nYou have to specify a post id.\n".color(:red)
end

.error_missing_usernameObject



121
122
123
# File 'lib/ayadn/status.rb', line 121

def self.error_missing_username
  "\nYou have to specify a username.\n".color(:red)
end

.error_only_osxObject



208
209
210
# File 'lib/ayadn/status.rb', line 208

def self.error_only_osx
  "\nThis feature only works with Mac OS X and iTunes, sorry.\n\n".color(:red)
end

.followed(username) ⇒ Object



106
107
108
# File 'lib/ayadn/status.rb', line 106

def self.followed(username)
  "\nUser #{username} has been followed.\n".color(:green)
end

.following(username) ⇒ Object



25
26
27
# File 'lib/ayadn/status.rb', line 25

def self.following(username)
  "\nFollowing #{username}".inverse
end

.messageObject



175
176
177
# File 'lib/ayadn/status.rb', line 175

def self.message
  "\n#{Settings.config[:message_max_length]} ".color(:yellow) + "characters maximum.\n"
end

.message_from(username) ⇒ Object



157
158
159
# File 'lib/ayadn/status.rb', line 157

def self.message_from(username)
  "\nMessage from ".color(:cyan) + "#{Settings.config[:identity][:handle]} ".color(:green) + "to ".color(:cyan) + "#{username[0]}".color(:yellow) + ".".color(:cyan)
end

.must_be_in_indexObject



253
254
255
# File 'lib/ayadn/status.rb', line 253

def self.must_be_in_index
  "\nNumber must be in the range of the indexed posts.\n".color(:red)
end

.must_be_integerObject



187
188
189
# File 'lib/ayadn/status.rb', line 187

def self.must_be_integer
  "\nThis paramater must be an integer between 1 and 200.\n".color(:red)
end

.muted(username) ⇒ Object



112
113
114
# File 'lib/ayadn/status.rb', line 112

def self.muted(username)
  "\nUser #{username} has been muted.\n".color(:green)
end

.muting(username) ⇒ Object



31
32
33
# File 'lib/ayadn/status.rb', line 31

def self.muting(username)
  "\nMuting #{username}".inverse
end

.no_aliasObject



262
263
264
# File 'lib/ayadn/status.rb', line 262

def self.no_alias
  "\nThis alias doesn't exist.\n\n".color(:red)
end

.no_itunesObject



265
266
267
# File 'lib/ayadn/status.rb', line 265

def self.no_itunes
  "\nCanceled: unable to get info from iTunes.\n".color(:red)
end

.no_new_postsObject



190
191
192
# File 'lib/ayadn/status.rb', line 190

def self.no_new_posts
  "\nNo new posts since your last visit.\n\n".color(:cyan)
end

.no_pin_credsObject



199
200
201
# File 'lib/ayadn/status.rb', line 199

def self.no_pin_creds
  "\nAyadn couldn't find your Pinboard credentials.\n".color(:red)
end

.no_textObject



277
278
279
# File 'lib/ayadn/status.rb', line 277

def self.no_text
  "\n\nYou should provide some text.\n\n".color(:red)
end

.nobody_repostedObject



226
227
228
# File 'lib/ayadn/status.rb', line 226

def self.nobody_reposted
  "\nNobody reposted this post.\n\n".color(:red)
end

.nobody_starredObject



229
230
231
# File 'lib/ayadn/status.rb', line 229

def self.nobody_starred
  "\nNobody starred this post.\n\n".color(:red)
end

.not_authorizedObject



217
218
219
# File 'lib/ayadn/status.rb', line 217

def self.not_authorized
  "\nYou need to authorize Ayadn before using it.\n\nPlease run 'ayadn -auth' :)\n\n".color(:red)
end

.not_blocked(post_id) ⇒ Object



82
83
84
# File 'lib/ayadn/status.rb', line 82

def self.not_blocked(post_id)
  "Could not block user #{username} (doesn't exist, or is already blocked)\n".color(:red)
end

.not_deleted(post_id) ⇒ Object



52
53
54
# File 'lib/ayadn/status.rb', line 52

def self.not_deleted(post_id)
  "Could not delete post #{post_id} (post isn't yours, or is already deleted)\n".color(:red)
end

.not_followed(post_id) ⇒ Object



70
71
72
# File 'lib/ayadn/status.rb', line 70

def self.not_followed(post_id)
  "Could not follow user #{username} (doesn't exist, or you already follow)\n".color(:red)
end

.not_foundObject



142
143
144
# File 'lib/ayadn/status.rb', line 142

def self.not_found
  "\n\n404 NOT FOUND - Object does not exist or has been deleted\n\n"
end

.not_mutableObject



184
185
186
# File 'lib/ayadn/status.rb', line 184

def self.not_mutable
  "\nThis parameter is not modifiable for the time being, sorry.\n".color(:red)
end

.not_muted(post_id) ⇒ Object



76
77
78
# File 'lib/ayadn/status.rb', line 76

def self.not_muted(post_id)
  "Could not mute user #{username} (doesn't exist, or is already muted)\n".color(:red)
end

.not_reposted(post_id) ⇒ Object



61
62
63
# File 'lib/ayadn/status.rb', line 61

def self.not_reposted(post_id)
  "Could not repost post #{post_id} (post has been deleted?)\n".color(:red)
end

.not_starred(post_id) ⇒ Object



55
56
57
# File 'lib/ayadn/status.rb', line 55

def self.not_starred(post_id)
  "Could not star post #{post_id} (post doesn't exist, or is already starred)\n".color(:red)
end

.not_unblocked(post_id) ⇒ Object



79
80
81
# File 'lib/ayadn/status.rb', line 79

def self.not_unblocked(post_id)
  "Could not unblock user #{username} (doesn't exist, or wasn't already blocked)\n".color(:red)
end

.not_unfollowed(post_id) ⇒ Object



67
68
69
# File 'lib/ayadn/status.rb', line 67

def self.not_unfollowed(post_id)
  "Could not unfollow user #{username} (doesn't exist, or wasn't already followed)\n".color(:red)
end

.not_unmuted(post_id) ⇒ Object



73
74
75
# File 'lib/ayadn/status.rb', line 73

def self.not_unmuted(post_id)
  "Could not unmute user #{username} (doesn't exist, or wasn't already muted)\n".color(:red)
end

.not_unreposted(post_id) ⇒ Object



58
59
60
# File 'lib/ayadn/status.rb', line 58

def self.not_unreposted(post_id)
  "Could not unrepost post #{post_id} (post isn't yours, isn't a repost, or has been deleted)\n".color(:red)
end

.not_unstarred(post_id) ⇒ Object



64
65
66
# File 'lib/ayadn/status.rb', line 64

def self.not_unstarred(post_id)
  "Could not unstar post #{post_id} (post isn't yours, isn't starred, or has been deleted)\n".color(:red)
end

.not_your_repostObject



232
233
234
# File 'lib/ayadn/status.rb', line 232

def self.not_your_repost
  "\nThis post isn't one of your reposts.\n\n".color(:red)
end

.not_your_starredObject



235
236
237
# File 'lib/ayadn/status.rb', line 235

def self.not_your_starred
  "\nThis isn't one of your starred posts.\n\n".color(:red)
end

.pin_creds_savedObject



202
203
204
# File 'lib/ayadn/status.rb', line 202

def self.pin_creds_saved
  "\n\nCredentials successfully encoded and saved in database.\n\n".color(:green)
end

.pin_passwordObject



271
272
273
# File 'lib/ayadn/status.rb', line 271

def self.pin_password
  "\nPlease enter your Pinboard password (invisible, CTRL+C to cancel): ".color(:green)
end

.pin_usernameObject



268
269
270
# File 'lib/ayadn/status.rb', line 268

def self.pin_username
  "Please enter your Pinboard username (CTRL+C to cancel): ".color(:green)
end

.postObject



172
173
174
# File 'lib/ayadn/status.rb', line 172

def self.post
  "\n#{Settings.config[:post_max_length]} ".color(:yellow) + "characters maximum.\n"
end

.post_404(post_id) ⇒ Object



259
260
261
# File 'lib/ayadn/status.rb', line 259

def self.post_404(post_id)
  "\nImpossible to find #{post_id}. This post may have been deleted.\n".color(:red)
end

.postingObject



13
14
15
# File 'lib/ayadn/status.rb', line 13

def self.posting
  "Posting to ADN...\n\n".inverse
end

.readlineObject



163
164
165
# File 'lib/ayadn/status.rb', line 163

def self.readline
  "\nType your text. ".color(:cyan) + "[CTRL+D] ".color(:green) + "to validate, ".color(:cyan) + "[CTRL+C] ".color(:red) + "to cancel.\n".color(:cyan)
end

.redirectingObject



223
224
225
# File 'lib/ayadn/status.rb', line 223

def self.redirecting
  "\nPost is a repost. Redirecting...\n".color(:cyan)
end

.reducing(db) ⇒ Object



244
245
246
# File 'lib/ayadn/status.rb', line 244

def self.reducing db
  "\nPlease wait while Ayadn is pruning and compacting the #{db} database...\n".color(:cyan)
end

.replyObject

def self.classic

"\nType your text. ".color(:cyan) + "[ENTER] ".color(:green) + "to validate, ".color(:cyan) + "[CTRL+C] ".color(:red) + "to cancel.\n\n".color(:cyan)

end



169
170
171
# File 'lib/ayadn/status.rb', line 169

def self.reply
  "\n#{Settings.config[:post_max_length]} ".color(:yellow) + "characters maximum.\n"
end

.replying_to(post_id) ⇒ Object



160
161
162
# File 'lib/ayadn/status.rb', line 160

def self.replying_to(post_id)
  "\nReplying to post #{post_id}...\n".color(:green)
end

.reposted(post_id) ⇒ Object



97
98
99
# File 'lib/ayadn/status.rb', line 97

def self.reposted(post_id)
  "\nPost #{post_id} has been reposted.\n".color(:green)
end

.reposting(post_id) ⇒ Object



43
44
45
# File 'lib/ayadn/status.rb', line 43

def self.reposting(post_id)
  "\nReposting #{post_id}".inverse
end

.saving_pinObject



205
206
207
# File 'lib/ayadn/status.rb', line 205

def self.saving_pin
  "\nSaving post text and links to Pinboard...\n\n".color(:yellow)
end

.starred(post_id) ⇒ Object



91
92
93
# File 'lib/ayadn/status.rb', line 91

def self.starred(post_id)
  "\nPost #{post_id} has been starred.\n".color(:green)
end

.starring(post_id) ⇒ Object



49
50
51
# File 'lib/ayadn/status.rb', line 49

def self.starring(post_id)
  "\nStarring #{post_id}".inverse
end

.stoppedObject



145
146
147
# File 'lib/ayadn/status.rb', line 145

def self.stopped
  "\n\nStopped.".color(:red)
end

.thresholdObject



250
251
252
# File 'lib/ayadn/status.rb', line 250

def self.threshold
  "\nPlease enter a value between 0.1 and 3.5, example: 2.1\n\n".color(:red)
end

.too_long(size, max_size) ⇒ Object



274
275
276
# File 'lib/ayadn/status.rb', line 274

def self.too_long size, max_size
  "\n\nCanceled: too long. #{max_size} max, #{size - max_size} characters to remove.\n\n\n".color(:red)
end

.type_and_target_missingObject



193
194
195
# File 'lib/ayadn/status.rb', line 193

def self.type_and_target_missing
  "\nYou have to submit a TYPE (mention, hashtag, client name) and a TARGET (a @username, a hashtag, a client name)\n\n".color(:red)
end

.unblocked(username) ⇒ Object



115
116
117
# File 'lib/ayadn/status.rb', line 115

def self.unblocked(username)
  "\nUser #{username} has been unblocked.\n".color(:green)
end

.unblocking(username) ⇒ Object



34
35
36
# File 'lib/ayadn/status.rb', line 34

def self.unblocking(username)
  "\nUnblocking #{username}".inverse
end

.unfollowed(username) ⇒ Object



103
104
105
# File 'lib/ayadn/status.rb', line 103

def self.unfollowed(username)
  "\nUser #{username} has been unfollowed.\n".color(:green)
end

.unfollowing(username) ⇒ Object



22
23
24
# File 'lib/ayadn/status.rb', line 22

def self.unfollowing(username)
  "\nUnfollowing #{username}".inverse
end

.unmuted(username) ⇒ Object



109
110
111
# File 'lib/ayadn/status.rb', line 109

def self.unmuted(username)
  "\nUser #{username} has been unmuted.\n".color(:green)
end

.unmuting(username) ⇒ Object



28
29
30
# File 'lib/ayadn/status.rb', line 28

def self.unmuting(username)
  "\nUnmuting #{username}".inverse
end

.unreposted(post_id) ⇒ Object



94
95
96
# File 'lib/ayadn/status.rb', line 94

def self.unreposted(post_id)
  "\nPost #{post_id} has been unreposted.\n".color(:green)
end

.unreposting(post_id) ⇒ Object



40
41
42
# File 'lib/ayadn/status.rb', line 40

def self.unreposting(post_id)
  "\nUnreposting #{post_id}".inverse
end

.unstarred(post_id) ⇒ Object



100
101
102
# File 'lib/ayadn/status.rb', line 100

def self.unstarred(post_id)
  "\nPost #{post_id} has been unstarred.\n".color(:green)
end

.unstarring(post_id) ⇒ Object



46
47
48
# File 'lib/ayadn/status.rb', line 46

def self.unstarring(post_id)
  "\nUnstarring #{post_id}".inverse
end

.user_404(username) ⇒ Object



256
257
258
# File 'lib/ayadn/status.rb', line 256

def self.user_404 username
  "\nUser #{username} doesn't exist. It could be a deleted account.\n".color(:red)
end

.valid_colors(colors_list) ⇒ Object

def self.method_missing(meth, args)

"\nThe command '#{meth} #{args}' doesn't exist.\n".color(:red)

end



181
182
183
# File 'lib/ayadn/status.rb', line 181

def self.valid_colors(colors_list)
  "\nThe valid colors are: #{colors_list}\n".color(:cyan)
end

.writingObject



148
149
150
# File 'lib/ayadn/status.rb', line 148

def self.writing
  "\nPosting as ".color(:cyan) + "#{Settings.config[:identity][:handle]}".color(:green) + ".".color(:cyan)
end

.wrong_argumentsObject



196
197
198
# File 'lib/ayadn/status.rb', line 196

def self.wrong_arguments
  "\nYou have to submit valid arguments.\n\n".color(:red)
end

.wtfObject



220
221
222
# File 'lib/ayadn/status.rb', line 220

def self.wtf
  "\nSomething wrong happened. :(\n\n".color(:red)
end

.yourmessageObject



154
155
156
# File 'lib/ayadn/status.rb', line 154

def self.yourmessage
  "Your message:\n\n".color(:cyan)
end

.yourpostObject



151
152
153
# File 'lib/ayadn/status.rb', line 151

def self.yourpost
  "Your post:\n\n".color(:cyan)
end