Class: Ayadn::Status
- Inherits:
-
Object
- Object
- Ayadn::Status
- Defined in:
- lib/ayadn/status.rb
Instance Method Summary collapse
- #already_reposted ⇒ Object
- #already_starred ⇒ Object
- #ask_clear_blacklist ⇒ Object
- #ask_clear_bookmarks ⇒ Object
- #ask_clear_databases ⇒ Object
- #auto ⇒ Object
- #ayadn ⇒ Object
- #bad_path ⇒ Object
- #blocked(username) ⇒ Object
- #blocking(username) ⇒ Object
- #canceled ⇒ Object
- #deleted(post_id) ⇒ Object
- #deleted_m(message_id) ⇒ Object
- #deleting_message(message_id) ⇒ Object
- #deleting_post(post_id) ⇒ Object
- #done ⇒ Object
- #downloaded(name) ⇒ Object
- #downloading ⇒ Object
- #empty_fields ⇒ Object
- #empty_list ⇒ Object
- #error_missing_channel_id ⇒ Object
- #error_missing_message_id ⇒ Object
- #error_missing_parameters ⇒ Object
- #error_missing_post_id ⇒ Object
- #error_missing_title ⇒ Object
- #error_missing_username ⇒ Object
- #error_only_osx ⇒ Object
- #fetching_from(source) ⇒ Object
- #followed(username) ⇒ Object
- #following(username) ⇒ Object
- #has_to_migrate ⇒ Object
-
#info(status, message, color = nil) ⇒ Object
—.
-
#initialize ⇒ Status
constructor
A new instance of Status.
- #itunes_store ⇒ Object
- #itunes_store_track(store) ⇒ Object
- #links_saved(name) ⇒ Object
- #message ⇒ Object
- #message_from(username) ⇒ Object
- #must_be_in_index ⇒ Object
- #must_be_integer ⇒ Object
- #muted(username) ⇒ Object
- #muting(username) ⇒ Object
- #no_alias ⇒ Object
- #no_curl ⇒ Object
- #no_force(target) ⇒ Object
- #no_itunes ⇒ Object
- #no_movie ⇒ Object
- #no_new_messages ⇒ Object
- #no_new_posts ⇒ Object
- #no_pin_creds ⇒ Object
- #no_show ⇒ Object
- #no_show_infos ⇒ Object
- #no_text ⇒ Object
- #no_username ⇒ Object
- #nobody_reposted ⇒ Object
- #nobody_starred ⇒ Object
- #not_authorized ⇒ Object
- #not_blocked(username) ⇒ Object
- #not_deleted(post_id) ⇒ Object
- #not_deleted_m(post_id) ⇒ Object
- #not_followed(username) ⇒ Object
- #not_muted(username) ⇒ Object
- #not_reposted(post_id) ⇒ Object
- #not_starred(post_id) ⇒ Object
- #not_unblocked(username) ⇒ Object
- #not_unfollowed(username) ⇒ Object
- #not_unmuted(username) ⇒ Object
- #not_unreposted(post_id) ⇒ Object
- #not_unstarred(post_id) ⇒ Object
- #not_your_repost ⇒ Object
- #not_your_starred ⇒ Object
- #ok? ⇒ Boolean
- #one_username ⇒ Object
- #pin_creds_saved ⇒ Object
- #pin_password ⇒ Object
- #pin_username ⇒ Object
- #post ⇒ Object
- #post_404(post_id) ⇒ Object
- #post_info ⇒ Object
- #posting ⇒ Object
- #profile_options ⇒ Object
- #readline ⇒ Object
- #redirecting ⇒ Object
- #reply ⇒ Object
- #replying_to(post_id) ⇒ Object
- #repost_info ⇒ Object
- #reposted(post_id) ⇒ Object
- #reposting(post_id) ⇒ Object
- #saving_pin ⇒ Object
-
#say ⇒ Object
expects a block.
- #server_error(bool) ⇒ Object
- #starred(post_id) ⇒ Object
- #starring(post_id) ⇒ Object
- #threshold ⇒ Object
- #to_be_posted ⇒ Object
- #too_long(size, max_size) ⇒ Object
- #type_and_target_missing ⇒ Object
- #unblocked(username) ⇒ Object
- #unblocking(username) ⇒ Object
- #unfollowed(username) ⇒ Object
- #unfollowing(username) ⇒ Object
- #unmuted(username) ⇒ Object
- #unmuting(username) ⇒ Object
- #unread_from_channel(channel_id) ⇒ Object
- #unreposted(post_id) ⇒ Object
- #unreposting(post_id) ⇒ Object
- #unstarred(post_id) ⇒ Object
- #unstarring(post_id) ⇒ Object
- #updating_profile ⇒ Object
- #user_404(username) ⇒ Object
- #valid_colors(colors_list) ⇒ Object
- #version ⇒ Object
- #writing ⇒ Object
- #wrong_arguments ⇒ Object
- #wtf ⇒ Object
- #yourmessage(username = nil) ⇒ Object
- #yourpost ⇒ Object
Constructor Details
#initialize ⇒ Status
5 6 7 |
# File 'lib/ayadn/status.rb', line 5 def initialize @thor = Thor::Shell::Color.new end |
Instance Method Details
#already_reposted ⇒ Object
160 161 162 |
# File 'lib/ayadn/status.rb', line 160 def already_reposted info("ok", "already reposted", "green") end |
#already_starred ⇒ Object
156 157 158 |
# File 'lib/ayadn/status.rb', line 156 def already_starred info("ok", "already starred", "green") end |
#ask_clear_blacklist ⇒ Object
513 514 515 |
# File 'lib/ayadn/status.rb', line 513 def ask_clear_blacklist info("question", "are you sure you want to erase all the content of your blacklist database? [y/N]", "red") end |
#ask_clear_bookmarks ⇒ Object
517 518 519 |
# File 'lib/ayadn/status.rb', line 517 def ask_clear_bookmarks info("question", "are you sure you want to erase all the content of your bookmarks database? [y/N]", "red") end |
#ask_clear_databases ⇒ Object
509 510 511 |
# File 'lib/ayadn/status.rb', line 509 def ask_clear_databases info("question", "are you sure you want to erase all the content of your aliases database? [y/N]", "red") end |
#auto ⇒ Object
347 348 349 350 351 352 353 354 |
# File 'lib/ayadn/status.rb', line 347 def auto say do @thor.say_status :info, "entering the auto posting mode", :cyan @thor.say_status :info, "each line you type (each time you hit ENTER) is automatically posted to ADN", :cyan @thor.say_status :info, "at any moment, starting now, hit CTRL+C to exit", :cyan @thor.say_status :info, "AUTO POSTING MODE ACTIVATED", :yellow end end |
#ayadn ⇒ Object
490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/ayadn/status.rb', line 490 def ayadn "\n\\t\\t _____ __ __ _____ ____ _____\n\\t\\t | _ | | | _ | \\\\| | |\n\\t\\t | |_ _| | | | | | |\n\\t\\t |__|__| |_| |__|__|____/|_|___|\n\n\n AYADN\nend\n" |
#bad_path ⇒ Object
404 405 406 |
# File 'lib/ayadn/status.rb', line 404 def bad_path info("error", "couldn't upload this file (path seems wrong)", "red") end |
#blocked(username) ⇒ Object
184 185 186 |
# File 'lib/ayadn/status.rb', line 184 def blocked(username) info("blocked", username, "green") end |
#blocking(username) ⇒ Object
64 65 66 |
# File 'lib/ayadn/status.rb', line 64 def blocking(username) @thor.say_status :blocking, username, :yellow end |
#canceled ⇒ Object
13 14 15 16 17 18 |
# File 'lib/ayadn/status.rb', line 13 def canceled say do puts "\n" @thor.say_status :canceled, "", :red end end |
#deleted(post_id) ⇒ Object
132 133 134 |
# File 'lib/ayadn/status.rb', line 132 def deleted(post_id) info("deleted", "post #{post_id}", "green") end |
#deleted_m(message_id) ⇒ Object
136 137 138 |
# File 'lib/ayadn/status.rb', line 136 def deleted_m() info("deleted", "message #{message_id}", "green") end |
#deleting_message(message_id) ⇒ Object
40 41 42 |
# File 'lib/ayadn/status.rb', line 40 def () @thor.say_status :deleting, "message #{message_id}", :yellow end |
#deleting_post(post_id) ⇒ Object
36 37 38 |
# File 'lib/ayadn/status.rb', line 36 def deleting_post(post_id) @thor.say_status :deleting, "post #{post_id}", :yellow end |
#done ⇒ Object
9 10 11 |
# File 'lib/ayadn/status.rb', line 9 def done info("done", "", "green") end |
#downloaded(name) ⇒ Object
20 21 22 |
# File 'lib/ayadn/status.rb', line 20 def downloaded(name) info("downloaded", "#{Settings.config[:paths][:downloads]}/#{name}", "green") end |
#downloading ⇒ Object
28 29 30 |
# File 'lib/ayadn/status.rb', line 28 def downloading info("connected", "downloading from ADN", "yellow") end |
#empty_fields ⇒ Object
309 310 311 |
# File 'lib/ayadn/status.rb', line 309 def empty_fields info("canceled", "couldn't get enough information (empty field)", "red") end |
#empty_list ⇒ Object
215 216 217 |
# File 'lib/ayadn/status.rb', line 215 def empty_list info("info", "the list is empty", "yellow") end |
#error_missing_channel_id ⇒ Object
204 205 206 |
# File 'lib/ayadn/status.rb', line 204 def error_missing_channel_id info("error", "please specify a channel id", "red") end |
#error_missing_message_id ⇒ Object
200 201 202 |
# File 'lib/ayadn/status.rb', line 200 def info("error", "please specify a message id", "red") end |
#error_missing_parameters ⇒ Object
208 209 210 211 212 213 |
# File 'lib/ayadn/status.rb', line 208 def error_missing_parameters say do @thor.say_status :error, "please submit valid items", :red @thor.say_status :info, "see `ayadn -sg` for a list of valid parameters and values", :cyan end end |
#error_missing_post_id ⇒ Object
196 197 198 |
# File 'lib/ayadn/status.rb', line 196 def error_missing_post_id info("error", "please specify a post id", "red") end |
#error_missing_title ⇒ Object
188 189 190 |
# File 'lib/ayadn/status.rb', line 188 def error_missing_title info("error", "please specify (part of) a movie title", "red") end |
#error_missing_username ⇒ Object
192 193 194 |
# File 'lib/ayadn/status.rb', line 192 def error_missing_username info("error", "please specify a username", "red") end |
#error_only_osx ⇒ Object
302 303 304 305 306 307 |
# File 'lib/ayadn/status.rb', line 302 def error_only_osx say do @thor.say_status :error, "this feature only works with iTunes by default", :red @thor.say_status :info, "if you've got a Last.fm account, use `ayadn -NP --lastfm` (short: `-l`)", :cyan end end |
#fetching_from(source) ⇒ Object
419 420 421 |
# File 'lib/ayadn/status.rb', line 419 def fetching_from(source) info("connexion", "fetching informations from #{source}", "green") end |
#followed(username) ⇒ Object
168 169 170 |
# File 'lib/ayadn/status.rb', line 168 def followed(username) info("followed", username, "green") end |
#following(username) ⇒ Object
48 49 50 |
# File 'lib/ayadn/status.rb', line 48 def following(username) @thor.say_status :following, username, :yellow end |
#has_to_migrate ⇒ Object
457 458 459 460 461 462 |
# File 'lib/ayadn/status.rb', line 457 def has_to_migrate say do @thor.say_status :upgrade, "Ayadn 1.x user data detected", :red @thor.say_status :migrate, "please run `ayadn migrate` to upgrade your account", :yellow end end |
#info(status, message, color = nil) ⇒ Object
546 547 548 549 550 551 552 553 554 555 |
# File 'lib/ayadn/status.rb', line 546 def info(status, , color = nil) if color.nil? lamb = lambda { @thor.say_status(status.to_sym, .to_s) } else lamb = lambda { @thor.say_status(status.to_sym, .to_s, color.to_sym) } end puts "\n" lamb.call puts "\n" end |
#itunes_store ⇒ Object
415 416 417 |
# File 'lib/ayadn/status.rb', line 415 def itunes_store info("connexion", "fetching informations from the iTunes Store", "green") end |
#itunes_store_track(store) ⇒ Object
525 526 527 528 |
# File 'lib/ayadn/status.rb', line 525 def itunes_store_track(store) puts "\n" @thor.say_status "next", "Ayadn will use these elements to insert album artwork and a link", :cyan end |
#links_saved(name) ⇒ Object
24 25 26 |
# File 'lib/ayadn/status.rb', line 24 def links_saved(name) info("done", "links exported to file #{Settings.config[:paths][:lists]}/#{name}", "green") end |
#message ⇒ Object
261 262 263 |
# File 'lib/ayadn/status.rb', line 261 def @thor.say_status "max", "#{Settings.config[:message_max_length]} characters", "cyan" end |
#message_from(username) ⇒ Object
234 235 236 237 238 |
# File 'lib/ayadn/status.rb', line 234 def (username) puts "\n" @thor.say_status "from", "#{Settings.config[:identity][:handle]}", "yellow" @thor.say_status "to", "#{username[0]}", "yellow" end |
#must_be_in_index ⇒ Object
363 364 365 |
# File 'lib/ayadn/status.rb', line 363 def must_be_in_index info("error", "number must be in the range of the indexed posts", "red") end |
#must_be_integer ⇒ Object
270 271 272 |
# File 'lib/ayadn/status.rb', line 270 def must_be_integer info("error", "this paramater must be an integer between 1 and 200", "red") end |
#muted(username) ⇒ Object
176 177 178 |
# File 'lib/ayadn/status.rb', line 176 def muted(username) info("muted", username, "green") end |
#muting(username) ⇒ Object
56 57 58 |
# File 'lib/ayadn/status.rb', line 56 def muting(username) @thor.say_status :muting, username, :yellow end |
#no_alias ⇒ Object
375 376 377 |
# File 'lib/ayadn/status.rb', line 375 def no_alias info("error", "this alias doesn't exist", "red") end |
#no_curl ⇒ Object
408 409 410 411 412 413 |
# File 'lib/ayadn/status.rb', line 408 def no_curl say do @thor.say_status :error, "Ayadn needs 'curl' to upload files", :red @thor.say_status :next, "please install 'curl' (or check that it's properly declared in your $PATH)", :yellow end end |
#no_force(target) ⇒ Object
435 436 437 438 439 440 |
# File 'lib/ayadn/status.rb', line 435 def no_force(target) say do @thor.say_status :error, "'#{target}' can't be displayed (could be muted, blocked, in the Blacklist, etc)", :red @thor.say_status :info, "please use option '--force' ('-f') to try and display this content anyway", :cyan end end |
#no_itunes ⇒ Object
379 380 381 |
# File 'lib/ayadn/status.rb', line 379 def no_itunes info("canceled", "unable to get info from iTunes", "red") end |
#no_movie ⇒ Object
423 424 425 |
# File 'lib/ayadn/status.rb', line 423 def no_movie info("error", "sorry, can't find this movie", "red") end |
#no_new_messages ⇒ Object
278 279 280 |
# File 'lib/ayadn/status.rb', line 278 def info("info", "no new messages", "cyan") end |
#no_new_posts ⇒ Object
274 275 276 |
# File 'lib/ayadn/status.rb', line 274 def no_new_posts info("info", "no new posts since your last visit with Ayadn", "cyan") end |
#no_pin_creds ⇒ Object
290 291 292 |
# File 'lib/ayadn/status.rb', line 290 def no_pin_creds info("error", "Ayadn couldn't find your Pinboard credentials", "red") end |
#no_show ⇒ Object
427 428 429 |
# File 'lib/ayadn/status.rb', line 427 def no_show info("error", "sorry, can't find this show", "red") end |
#no_show_infos ⇒ Object
431 432 433 |
# File 'lib/ayadn/status.rb', line 431 def no_show_infos info("error", "sorry, can't find informations about this show", "red") end |
#no_text ⇒ Object
400 401 402 |
# File 'lib/ayadn/status.rb', line 400 def no_text info("error", "no text", "red") end |
#no_username ⇒ Object
450 451 452 453 454 455 |
# File 'lib/ayadn/status.rb', line 450 def no_username say do @thor.say_status :error, "Ayadn couldn't get your username", :red @thor.say_status :next, "please try again", :yellow end end |
#nobody_reposted ⇒ Object
331 332 333 |
# File 'lib/ayadn/status.rb', line 331 def nobody_reposted info("error", "nobody reposted this post", "red") end |
#nobody_starred ⇒ Object
335 336 337 |
# File 'lib/ayadn/status.rb', line 335 def nobody_starred info("error", "nobody starred this post", "red") end |
#not_authorized ⇒ Object
313 314 315 316 317 318 |
# File 'lib/ayadn/status.rb', line 313 def say do @thor.say_status :error, "no user authorized", :red @thor.say_status :auth, "please run `ayadn -auth` to authorize an account", :yellow end end |
#not_blocked(username) ⇒ Object
128 129 130 |
# File 'lib/ayadn/status.rb', line 128 def not_blocked(username) info("error", "could not block user #{username} (doesn't exist, or is already blocked)", "red") end |
#not_deleted(post_id) ⇒ Object
84 85 86 |
# File 'lib/ayadn/status.rb', line 84 def not_deleted(post_id) info("error", "could not delete post #{post_id} (post isn't yours, or is already deleted)", "red") end |
#not_deleted_m(post_id) ⇒ Object
88 89 90 |
# File 'lib/ayadn/status.rb', line 88 def not_deleted_m(post_id) info("error", "could not delete post #{post_id} (post isn't yours, or is already deleted)", "red") end |
#not_followed(username) ⇒ Object
112 113 114 |
# File 'lib/ayadn/status.rb', line 112 def not_followed(username) info("error", "could not follow user #{username} (doesn't exist, or you already follow)", "red") end |
#not_muted(username) ⇒ Object
120 121 122 |
# File 'lib/ayadn/status.rb', line 120 def not_muted(username) info("error", "could not mute user #{username} (doesn't exist, or is already muted)", "red") end |
#not_reposted(post_id) ⇒ Object
100 101 102 |
# File 'lib/ayadn/status.rb', line 100 def not_reposted(post_id) info("error", "could not repost post #{post_id} (post has been deleted?)", "red") end |
#not_starred(post_id) ⇒ Object
92 93 94 |
# File 'lib/ayadn/status.rb', line 92 def not_starred(post_id) info("error", "could not star post #{post_id} (post doesn't exist, or is already starred)", "red") end |
#not_unblocked(username) ⇒ Object
124 125 126 |
# File 'lib/ayadn/status.rb', line 124 def not_unblocked(username) info("error", "could not unblock user #{username} (doesn't exist, or wasn't already blocked)", "red") end |
#not_unfollowed(username) ⇒ Object
108 109 110 |
# File 'lib/ayadn/status.rb', line 108 def not_unfollowed(username) info("error", "could not unfollow user #{username} (doesn't exist, or wasn't already followed)", "red") end |
#not_unmuted(username) ⇒ Object
116 117 118 |
# File 'lib/ayadn/status.rb', line 116 def not_unmuted(username) info("error", "could not unmute user #{username} (doesn't exist, or wasn't already muted)", "red") end |
#not_unreposted(post_id) ⇒ Object
96 97 98 |
# File 'lib/ayadn/status.rb', line 96 def not_unreposted(post_id) info("error", "could not unrepost post #{post_id} (post isn't yours, isn't a repost, or has been deleted)", "red") end |
#not_unstarred(post_id) ⇒ Object
104 105 106 |
# File 'lib/ayadn/status.rb', line 104 def not_unstarred(post_id) info("error", "could not unstar post #{post_id} (post isn't yours, isn't starred, or has been deleted)", "red") end |
#not_your_repost ⇒ Object
339 340 341 |
# File 'lib/ayadn/status.rb', line 339 def not_your_repost info("error", "this post isn't one of your reposts", "red") end |
#not_your_starred ⇒ Object
343 344 345 |
# File 'lib/ayadn/status.rb', line 343 def not_your_starred info("error", "this isn't one of your starred posts", "red") end |
#ok? ⇒ Boolean
521 522 523 |
# File 'lib/ayadn/status.rb', line 521 def ok? info("confirm", "is it ok? [y/N]", "yellow") end |
#one_username ⇒ Object
446 447 448 |
# File 'lib/ayadn/status.rb', line 446 def one_username info("error", "please specify only one username", "red") end |
#pin_creds_saved ⇒ Object
294 295 296 |
# File 'lib/ayadn/status.rb', line 294 def pin_creds_saved info("done", "credentials successfully encoded and saved", "green") end |
#pin_password ⇒ Object
387 388 389 |
# File 'lib/ayadn/status.rb', line 387 def pin_password info("please", "enter your Pinboard password (invisible, CTRL+C to cancel)", "green") end |
#pin_username ⇒ Object
383 384 385 |
# File 'lib/ayadn/status.rb', line 383 def pin_username info("please", "enter your Pinboard username (CTRL+C to cancel)", "green") end |
#post ⇒ Object
257 258 259 |
# File 'lib/ayadn/status.rb', line 257 def post @thor.say_status "max", "#{Settings.config[:post_max_length]} characters", "cyan" end |
#post_404(post_id) ⇒ Object
371 372 373 |
# File 'lib/ayadn/status.rb', line 371 def post_404(post_id) info("error", "impossible to find #{post_id} (it may have been deleted)", "red") end |
#post_info ⇒ Object
477 478 479 |
# File 'lib/ayadn/status.rb', line 477 def post_info info("info", "post", "cyan") end |
#posting ⇒ Object
32 33 34 |
# File 'lib/ayadn/status.rb', line 32 def posting info("connected", "posting to ADN", "yellow") end |
#profile_options ⇒ Object
442 443 444 |
# File 'lib/ayadn/status.rb', line 442 def info("error", "please specify what to update or delete: --bio, --name, --blog, --twitter or --web", "red") end |
#readline ⇒ Object
245 246 247 248 249 250 251 |
# File 'lib/ayadn/status.rb', line 245 def readline say do @thor.say_status :next, "type your text", :cyan @thor.say_status :ok, "[CTRL+D] to validate", :cyan @thor.say_status :cancel, "[CTRL+C] to cancel", :cyan end end |
#redirecting ⇒ Object
324 325 326 327 328 329 |
# File 'lib/ayadn/status.rb', line 324 def redirecting say do @thor.say_status :info, "post is a repost", :cyan @thor.say_status :action, "redirecting", :yellow end end |
#reply ⇒ Object
253 254 255 |
# File 'lib/ayadn/status.rb', line 253 def reply @thor.say_status "max", "#{Settings.config[:post_max_length]} characters", "cyan" end |
#replying_to(post_id) ⇒ Object
240 241 242 243 |
# File 'lib/ayadn/status.rb', line 240 def (post_id) puts "\n" @thor.say_status "replying", "to post #{post_id}", "yellow" end |
#repost_info ⇒ Object
481 482 483 |
# File 'lib/ayadn/status.rb', line 481 def repost_info info("info", "repost of", "cyan") end |
#reposted(post_id) ⇒ Object
148 149 150 |
# File 'lib/ayadn/status.rb', line 148 def reposted(post_id) info("reposted", "post #{post_id}", "green") end |
#reposting(post_id) ⇒ Object
72 73 74 |
# File 'lib/ayadn/status.rb', line 72 def reposting(post_id) @thor.say_status :reposting, "post #{post_id}", :yellow end |
#saving_pin ⇒ Object
298 299 300 |
# File 'lib/ayadn/status.rb', line 298 def saving_pin info("saving", "post text and links to Pinboard", "yellow") end |
#say ⇒ Object
expects a block
557 558 559 560 561 |
# File 'lib/ayadn/status.rb', line 557 def say() # expects a block puts "\n" yield puts "\n" end |
#server_error(bool) ⇒ Object
530 531 532 533 534 535 536 537 538 539 540 541 542 |
# File 'lib/ayadn/status.rb', line 530 def server_error(bool) if bool == true say do @thor.say_status :error, "Ayadn couldn't get the JSON reponse", :red @thor.say_status :next, "trying again in 10 seconds", :yellow end else say do @thor.say_status :error, "Ayadn couldn't get the JSON reponse", :red @thor.say_status :status, "Current command canceled after one retry", :yellow end end end |
#starred(post_id) ⇒ Object
140 141 142 |
# File 'lib/ayadn/status.rb', line 140 def starred(post_id) info("starred", "post #{post_id}", "green") end |
#starring(post_id) ⇒ Object
80 81 82 |
# File 'lib/ayadn/status.rb', line 80 def starring(post_id) @thor.say_status :starring, "post #{post_id}", :yellow end |
#threshold ⇒ Object
356 357 358 359 360 361 |
# File 'lib/ayadn/status.rb', line 356 def threshold say do @thor.say_status :error, "please enter a value between 0.1 and 3.5", :red @thor.say_status :info, "example: 2.1", :green end end |
#to_be_posted ⇒ Object
468 469 470 |
# File 'lib/ayadn/status.rb', line 468 def to_be_posted info("", "Your post:") end |
#too_long(size, max_size) ⇒ Object
391 392 393 394 395 396 397 398 |
# File 'lib/ayadn/status.rb', line 391 def too_long(size, max_size) diff = size - max_size diff > 1 ? pl = "s" : pl = "" say do @thor.say_status :error, "text too long", :red @thor.say_status :info, "#{max_size} max: #{diff} character#{pl} to remove", :green end end |
#type_and_target_missing ⇒ Object
282 283 284 |
# File 'lib/ayadn/status.rb', line 282 def type_and_target_missing info("error", "please submit a TYPE ('mention', 'hashtag', 'client') and a TARGET (a @username, a hashtag, a client name)", "red") end |
#unblocked(username) ⇒ Object
180 181 182 |
# File 'lib/ayadn/status.rb', line 180 def unblocked(username) info("unblocked", username, "green") end |
#unblocking(username) ⇒ Object
60 61 62 |
# File 'lib/ayadn/status.rb', line 60 def unblocking(username) @thor.say_status :unblocking, username, :yellow end |
#unfollowed(username) ⇒ Object
164 165 166 |
# File 'lib/ayadn/status.rb', line 164 def unfollowed(username) info("unfollowed", username, "green") end |
#unfollowing(username) ⇒ Object
44 45 46 |
# File 'lib/ayadn/status.rb', line 44 def unfollowing(username) @thor.say_status :unfollowing, username, :yellow end |
#unmuted(username) ⇒ Object
172 173 174 |
# File 'lib/ayadn/status.rb', line 172 def unmuted(username) info("unmuted", username, "green") end |
#unmuting(username) ⇒ Object
52 53 54 |
# File 'lib/ayadn/status.rb', line 52 def unmuting(username) @thor.say_status :unmuting, username, :yellow end |
#unread_from_channel(channel_id) ⇒ Object
485 486 487 488 |
# File 'lib/ayadn/status.rb', line 485 def unread_from_channel(channel_id) @thor.say_status :info, "unread message(s) from channel #{channel_id}", :cyan puts "\n\n" end |
#unreposted(post_id) ⇒ Object
144 145 146 |
# File 'lib/ayadn/status.rb', line 144 def unreposted(post_id) info("unreposted", "post #{post_id}", "green") end |
#unreposting(post_id) ⇒ Object
68 69 70 |
# File 'lib/ayadn/status.rb', line 68 def unreposting(post_id) @thor.say_status :unreposting, "post #{post_id}", :yellow end |
#unstarred(post_id) ⇒ Object
152 153 154 |
# File 'lib/ayadn/status.rb', line 152 def unstarred(post_id) info("unstarred", "post #{post_id}", "green") end |
#unstarring(post_id) ⇒ Object
76 77 78 |
# File 'lib/ayadn/status.rb', line 76 def unstarring(post_id) @thor.say_status :unstarring, "post #{post_id}", :yellow end |
#updating_profile ⇒ Object
464 465 466 |
# File 'lib/ayadn/status.rb', line 464 def updating_profile info("updating", "profile", "yellow") end |
#user_404(username) ⇒ Object
367 368 369 |
# File 'lib/ayadn/status.rb', line 367 def user_404(username) info("error", "user #{username} doesn't exist (it could be a deleted account)", "red") end |
#valid_colors(colors_list) ⇒ Object
265 266 267 268 |
# File 'lib/ayadn/status.rb', line 265 def valid_colors(colors_list) @thor.say_status "info", "valid colors:", "cyan" say { puts colors_list } end |
#version ⇒ Object
501 502 503 504 505 506 507 |
# File 'lib/ayadn/status.rb', line 501 def version puts ayadn() @thor.say_status :version, "#{VERSION}", :green @thor.say_status :changelog, "https://github.com/ericdke/na/blob/master/CHANGELOG.md", :yellow @thor.say_status :docs, "https://github.com/ericdke/na/tree/master/doc", :yellow puts "\n\n" end |
#writing ⇒ Object
219 220 221 222 223 |
# File 'lib/ayadn/status.rb', line 219 def writing puts "\n" @thor.say_status "author", "#{Settings.config[:identity][:handle]}", "cyan" puts "\n" end |
#wrong_arguments ⇒ Object
286 287 288 |
# File 'lib/ayadn/status.rb', line 286 def wrong_arguments info("error", "invalid arguments", "red") end |
#wtf ⇒ Object
320 321 322 |
# File 'lib/ayadn/status.rb', line 320 def wtf info("error", "an unkown error happened", "red") end |
#yourmessage(username = nil) ⇒ Object
225 226 227 228 229 230 231 232 |
# File 'lib/ayadn/status.rb', line 225 def username = nil if username.nil? @thor.say_status "", "Your message:" else @thor.say_status "", "Your message to #{username}:" end puts "\n\n" end |
#yourpost ⇒ Object
472 473 474 475 |
# File 'lib/ayadn/status.rb', line 472 def yourpost # info("", "Your post:") @thor.say_status nil, "Your post:" end |