Class: Ayadn::Status

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

Class Method Summary collapse

Class Method Details

.autoObject



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

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

.bad_pathObject



297
298
299
# File 'lib/ayadn/status.rb', line 297

def self.bad_path
  "\n\nCouldn't upload this file (path seems wrong).\n\n".color(:red)
end

.blocked(username) ⇒ Object



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

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

.blocking(username) ⇒ Object



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

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

.cache_rangeObject



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

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

.canceledObject



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

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

.deleted(post_id) ⇒ Object



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

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

.deleted_m(message_id) ⇒ Object



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

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

.deleting_message(message_id) ⇒ Object



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

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

.deleting_post(post_id) ⇒ Object



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

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



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

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

.empty_fieldsObject



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

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

.empty_listObject



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

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

.error_missing_channel_idObject



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

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

.error_missing_hashtagObject



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

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

.error_missing_message_idObject



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

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

.error_missing_parametersObject



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

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



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

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

.error_missing_titleObject



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

def self.error_missing_title
  "\nYou have to specify (part of) a movie title.\n".color(:red)
end

.error_missing_usernameObject



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

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

.error_only_osxObject



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

def self.error_only_osx
  "\nThis feature only works with iTunes by default. If you've got a Last.fm account, add the option:\n\n`ayadn -np --lastfm` (short: `-l`).\n\n".color(:red)
end

.fetching_from(source) ⇒ Object



306
307
308
# File 'lib/ayadn/status.rb', line 306

def self.fetching_from source
  "\nFetching informations from #{source}...\n".color(:green)
end

.followed(username) ⇒ Object



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

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

.following(username) ⇒ Object



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

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

.itunes_storeObject



303
304
305
# File 'lib/ayadn/status.rb', line 303

def self.itunes_store
  "Fetching informations from the Itunes Store...\n".color(:green)
end


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

def self.links_saved(name)
  "\nLinks exported to file #{Settings.config[:paths][:lists]}/#{name}\n".color(:green)
end

.messageObject



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

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

.message_from(username) ⇒ Object



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

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



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

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

.must_be_integerObject



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

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

.muted(username) ⇒ Object



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

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

.muting(username) ⇒ Object



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

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

.no_aliasObject



279
280
281
# File 'lib/ayadn/status.rb', line 279

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

.no_curlObject



300
301
302
# File 'lib/ayadn/status.rb', line 300

def self.no_curl
  "\n\nAyadn needs 'curl' to upload files. Please install 'curl' (or check that it's properly declared in your $PATH).\n\n".color(:red)
end

.no_force(target) ⇒ Object



318
319
320
# File 'lib/ayadn/status.rb', line 318

def self.no_force target
  "\n'#{target}' can't be displayed (could be muted, blocked, in the Blacklist, etc). Use option '--force' ('-f') to try and display this content anyway.\n\n".color(:blue)
end

.no_itunesObject



282
283
284
# File 'lib/ayadn/status.rb', line 282

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

.no_movieObject



309
310
311
# File 'lib/ayadn/status.rb', line 309

def self.no_movie
  "\nSorry, can't find this movie.\n".color(:blue)
end

.no_new_messagesObject



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

def self.no_new_messages
  "\n   No new messages since your last visit.\n".color(:cyan)
end

.no_new_postsObject



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

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

.no_pin_credsObject



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

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

.no_showObject



312
313
314
# File 'lib/ayadn/status.rb', line 312

def self.no_show
  "\nSorry, can't find this show.\n".color(:blue)
end

.no_show_infosObject



315
316
317
# File 'lib/ayadn/status.rb', line 315

def self.no_show_infos
  "\nSorry, can't find informations about this show.\n".color(:blue)
end

.no_textObject



294
295
296
# File 'lib/ayadn/status.rb', line 294

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

.nobody_repostedObject



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

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

.nobody_starredObject



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

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

.not_authorizedObject



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

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



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

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

.not_deleted(post_id) ⇒ Object



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

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

.not_followed(post_id) ⇒ Object



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

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

.not_foundObject



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

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

.not_mutableObject



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

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

.not_muted(post_id) ⇒ Object



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

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

.not_reposted(post_id) ⇒ Object



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

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

.not_starred(post_id) ⇒ Object



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

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

.not_unblocked(post_id) ⇒ Object



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

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

.not_unfollowed(post_id) ⇒ Object



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

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

.not_unmuted(post_id) ⇒ Object



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

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

.not_unreposted(post_id) ⇒ Object



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

def self.not_unreposted(post_id)
  "\nCould 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



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

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

.not_your_repostObject



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

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

.not_your_starredObject



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

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

.pin_creds_savedObject



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

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

.pin_passwordObject



288
289
290
# File 'lib/ayadn/status.rb', line 288

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

.pin_usernameObject



285
286
287
# File 'lib/ayadn/status.rb', line 285

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

.postObject



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

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

.post_404(post_id) ⇒ Object



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

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

.postingObject



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

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

.profile_optionsObject



321
322
323
# File 'lib/ayadn/status.rb', line 321

def self.profile_options
  "\n\nYou have to specify what to update or delete: --bio, --name, --blog, --twitter or --web.\n\n".color(:red)
end

.readlineObject



177
178
179
# File 'lib/ayadn/status.rb', line 177

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



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

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

.reducing(db) ⇒ Object



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

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



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

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

.replying_to(post_id) ⇒ Object



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

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

.reposted(post_id) ⇒ Object



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

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

.reposting(post_id) ⇒ Object



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

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

.saving_pinObject



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

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

.starred(post_id) ⇒ Object



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

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

.starring(post_id) ⇒ Object



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

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

.stoppedObject



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

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

.thresholdObject



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

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



291
292
293
# File 'lib/ayadn/status.rb', line 291

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



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

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



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

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

.unblocking(username) ⇒ Object



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

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

.unfollowed(username) ⇒ Object



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

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

.unfollowing(username) ⇒ Object



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

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

.unmuted(username) ⇒ Object



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

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

.unmuting(username) ⇒ Object



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

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

.unreposted(post_id) ⇒ Object



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

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

.unreposting(post_id) ⇒ Object



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

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

.unstarred(post_id) ⇒ Object



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

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

.unstarring(post_id) ⇒ Object



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

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

.uploading(files) ⇒ Object



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

def self.uploading files
  files.length > 1 ? pl = "s" : pl = ""
  "\nUploading file#{pl} to ADN...".color(:cyan)
end

.user_404(username) ⇒ Object



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

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



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

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

.writingObject



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

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

.wrong_argumentsObject



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

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

.wtfObject



237
238
239
# File 'lib/ayadn/status.rb', line 237

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

.yourmessage(username = nil) ⇒ Object



164
165
166
167
168
169
170
# File 'lib/ayadn/status.rb', line 164

def self.yourmessage username = nil
  if username.nil?
    "Your message:\n\n".color(:cyan)
  else
    "Your message to ".color(:cyan) + username.color(:green) + ":\n\n".color(:cyan)
  end
end

.yourpostObject



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

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