Class: Ayadn::Status
- Inherits:
-
Object
- Object
- Ayadn::Status
- Defined in:
- lib/ayadn/status.rb
Class Method Summary collapse
- .auto ⇒ Object
- .bad_path ⇒ Object
- .blocked(username) ⇒ Object
- .blocking(username) ⇒ Object
- .cache_range ⇒ 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_hashtag ⇒ Object
- .error_missing_message_id ⇒ Object
- .error_missing_parameters ⇒ Object
- .error_missing_post_id ⇒ Object
- .error_missing_username ⇒ Object
- .error_only_osx ⇒ Object
- .fetching_from(source) ⇒ Object
- .followed(username) ⇒ Object
- .following(username) ⇒ Object
- .itunes_store ⇒ 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_itunes ⇒ Object
- .no_new_posts ⇒ Object
- .no_pin_creds ⇒ Object
- .no_text ⇒ Object
- .nobody_reposted ⇒ Object
- .nobody_starred ⇒ Object
- .not_authorized ⇒ Object
- .not_blocked(post_id) ⇒ Object
- .not_deleted(post_id) ⇒ Object
- .not_followed(post_id) ⇒ Object
- .not_found ⇒ Object
- .not_mutable ⇒ Object
- .not_muted(post_id) ⇒ Object
- .not_reposted(post_id) ⇒ Object
- .not_starred(post_id) ⇒ Object
- .not_unblocked(post_id) ⇒ Object
- .not_unfollowed(post_id) ⇒ Object
- .not_unmuted(post_id) ⇒ Object
- .not_unreposted(post_id) ⇒ Object
- .not_unstarred(post_id) ⇒ Object
- .not_your_repost ⇒ Object
- .not_your_starred ⇒ Object
- .pin_creds_saved ⇒ Object
- .pin_password ⇒ Object
- .pin_username ⇒ Object
- .post ⇒ Object
- .post_404(post_id) ⇒ Object
- .posting ⇒ Object
- .readline ⇒ Object
- .redirecting ⇒ Object
- .reducing(db) ⇒ Object
-
.reply ⇒ Object
def self.classic “nType your text.
- .replying_to(post_id) ⇒ Object
- .reposted(post_id) ⇒ Object
- .reposting(post_id) ⇒ Object
- .saving_pin ⇒ Object
- .starred(post_id) ⇒ Object
- .starring(post_id) ⇒ Object
- .stopped ⇒ Object
- .threshold ⇒ 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
- .unreposted(post_id) ⇒ Object
- .unreposting(post_id) ⇒ Object
- .unstarred(post_id) ⇒ Object
- .unstarring(post_id) ⇒ Object
- .uploading(files) ⇒ Object
- .user_404(username) ⇒ Object
-
.valid_colors(colors_list) ⇒ Object
def self.method_missing(meth, args) “nThe command ‘#meth #args’ doesn’t exist.n”.color(:red) end.
- .writing ⇒ Object
- .wrong_arguments ⇒ Object
- .wtf ⇒ Object
- .yourmessage ⇒ Object
- .yourpost ⇒ Object
Class Method Details
.auto ⇒ Object
242 243 244 245 246 247 |
# File 'lib/ayadn/status.rb', line 242 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_path ⇒ Object
284 285 286 |
# File 'lib/ayadn/status.rb', line 284 def self.bad_path "\n\nCouldn't upload this file (path seems wrong).\n\n".color(:red) end |
.blocked(username) ⇒ Object
122 123 124 |
# File 'lib/ayadn/status.rb', line 122 def self.blocked(username) "\nUser #{username} has been blocked.\n".color(:green) end |
.blocking(username) ⇒ Object
41 42 43 |
# File 'lib/ayadn/status.rb', line 41 def self.blocking(username) "\nBlocking #{username}".inverse end |
.cache_range ⇒ Object
251 252 253 |
# File 'lib/ayadn/status.rb', line 251 def self.cache_range "\nPlease enter a number of hours between 1 and 168.\n\n".color(:red) end |
.canceled ⇒ Object
218 219 220 |
# File 'lib/ayadn/status.rb', line 218 def self.canceled "\n\nCanceled.\n\n".color(:cyan) end |
.deleted(post_id) ⇒ Object
89 90 91 |
# File 'lib/ayadn/status.rb', line 89 def self.deleted(post_id) "\nPost #{post_id} has been deleted.\n".color(:green) end |
.deleted_m(message_id) ⇒ Object
92 93 94 |
# File 'lib/ayadn/status.rb', line 92 def self.deleted_m() "\nMessage #{message_id} has been deleted.\n".color(:green) end |
.deleting_message(message_id) ⇒ Object
23 24 25 |
# File 'lib/ayadn/status.rb', line 23 def self.() "\nDeleting message #{message_id}\n".inverse end |
.deleting_post(post_id) ⇒ Object
20 21 22 |
# File 'lib/ayadn/status.rb', line 20 def self.deleting_post(post_id) "\nDeleting post #{post_id}\n".inverse end |
.done ⇒ Object
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 |
.downloading ⇒ Object
10 11 12 |
# File 'lib/ayadn/status.rb', line 10 def self.downloading "Downloading from ADN...\n\n".inverse end |
.empty_fields ⇒ Object
215 216 217 |
# File 'lib/ayadn/status.rb', line 215 def self.empty_fields "\nCanceled: couldn't get enough information (empty field).\n\n".color(:red) end |
.empty_list ⇒ Object
143 144 145 |
# File 'lib/ayadn/status.rb', line 143 def self.empty_list "\n\nThe list is empty.\n\n".color(:red) end |
.error_missing_channel_id ⇒ Object
134 135 136 |
# File 'lib/ayadn/status.rb', line 134 def self.error_missing_channel_id "\nYou have to specify a channel id.\n".color(:red) end |
.error_missing_hashtag ⇒ Object
137 138 139 |
# File 'lib/ayadn/status.rb', line 137 def self.error_missing_hashtag "\nYou have to specify one or more hashtag(s).\n".color(:red) end |
.error_missing_message_id ⇒ Object
131 132 133 |
# File 'lib/ayadn/status.rb', line 131 def self. "\nYou have to specify a message id.\n".color(:red) end |
.error_missing_parameters ⇒ Object
140 141 142 |
# File 'lib/ayadn/status.rb', line 140 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_id ⇒ Object
128 129 130 |
# File 'lib/ayadn/status.rb', line 128 def self.error_missing_post_id "\nYou have to specify a post id.\n".color(:red) end |
.error_missing_username ⇒ Object
125 126 127 |
# File 'lib/ayadn/status.rb', line 125 def self.error_missing_username "\nYou have to specify a username.\n".color(:red) end |
.error_only_osx ⇒ Object
212 213 214 |
# File 'lib/ayadn/status.rb', line 212 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
293 294 295 |
# File 'lib/ayadn/status.rb', line 293 def self.fetching_from source "\nFetching informations from #{source}...\n".color(:green) end |
.followed(username) ⇒ Object
110 111 112 |
# File 'lib/ayadn/status.rb', line 110 def self.followed(username) "\nUser #{username} has been followed.\n".color(:green) end |
.following(username) ⇒ Object
29 30 31 |
# File 'lib/ayadn/status.rb', line 29 def self.following(username) "\nFollowing #{username}".inverse end |
.itunes_store ⇒ Object
290 291 292 |
# File 'lib/ayadn/status.rb', line 290 def self.itunes_store "Fetching informations from the Itunes Store...\n".color(:green) end |
.message ⇒ Object
179 180 181 |
# File 'lib/ayadn/status.rb', line 179 def self. "\n#{Settings.config[:message_max_length]} ".color(:yellow) + "characters maximum.\n" end |
.message_from(username) ⇒ Object
161 162 163 |
# File 'lib/ayadn/status.rb', line 161 def self.(username) "\nMessage from ".color(:cyan) + "#{Settings.config[:identity][:handle]} ".color(:green) + "to ".color(:cyan) + "#{username[0]}".color(:yellow) + ".".color(:cyan) end |
.must_be_in_index ⇒ Object
257 258 259 |
# File 'lib/ayadn/status.rb', line 257 def self.must_be_in_index "\nNumber must be in the range of the indexed posts.\n".color(:red) end |
.must_be_integer ⇒ Object
191 192 193 |
# File 'lib/ayadn/status.rb', line 191 def self.must_be_integer "\nThis paramater must be an integer between 1 and 200.\n".color(:red) end |
.muted(username) ⇒ Object
116 117 118 |
# File 'lib/ayadn/status.rb', line 116 def self.muted(username) "\nUser #{username} has been muted.\n".color(:green) end |
.muting(username) ⇒ Object
35 36 37 |
# File 'lib/ayadn/status.rb', line 35 def self.muting(username) "\nMuting #{username}".inverse end |
.no_alias ⇒ Object
266 267 268 |
# File 'lib/ayadn/status.rb', line 266 def self.no_alias "\nThis alias doesn't exist.\n\n".color(:red) end |
.no_curl ⇒ Object
287 288 289 |
# File 'lib/ayadn/status.rb', line 287 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_itunes ⇒ Object
269 270 271 |
# File 'lib/ayadn/status.rb', line 269 def self.no_itunes "\nCanceled: unable to get info from iTunes.\n".color(:red) end |
.no_new_posts ⇒ Object
194 195 196 |
# File 'lib/ayadn/status.rb', line 194 def self.no_new_posts "\nNo new posts since your last visit.\n\n".color(:cyan) end |
.no_pin_creds ⇒ Object
203 204 205 |
# File 'lib/ayadn/status.rb', line 203 def self.no_pin_creds "\nAyadn couldn't find your Pinboard credentials.\n".color(:red) end |
.no_text ⇒ Object
281 282 283 |
# File 'lib/ayadn/status.rb', line 281 def self.no_text "\n\nYou should provide some text.\n\n".color(:red) end |
.nobody_reposted ⇒ Object
230 231 232 |
# File 'lib/ayadn/status.rb', line 230 def self.nobody_reposted "\nNobody reposted this post.\n\n".color(:red) end |
.nobody_starred ⇒ Object
233 234 235 |
# File 'lib/ayadn/status.rb', line 233 def self.nobody_starred "\nNobody starred this post.\n\n".color(:red) end |
.not_authorized ⇒ Object
221 222 223 |
# File 'lib/ayadn/status.rb', line 221 def self. "\nYou need to authorize Ayadn before using it.\n\nPlease run 'ayadn -auth' :)\n\n".color(:red) end |
.not_blocked(post_id) ⇒ Object
86 87 88 |
# File 'lib/ayadn/status.rb', line 86 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
56 57 58 |
# File 'lib/ayadn/status.rb', line 56 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
74 75 76 |
# File 'lib/ayadn/status.rb', line 74 def self.not_followed(post_id) "\nCould not follow user #{username} (doesn't exist, or you already follow)\n".color(:red) end |
.not_found ⇒ Object
146 147 148 |
# File 'lib/ayadn/status.rb', line 146 def self.not_found "\n\n404 NOT FOUND - Object does not exist or has been deleted\n\n" end |
.not_mutable ⇒ Object
188 189 190 |
# File 'lib/ayadn/status.rb', line 188 def self.not_mutable "\nThis parameter is not modifiable for the time being, sorry.\n".color(:red) end |
.not_muted(post_id) ⇒ Object
80 81 82 |
# File 'lib/ayadn/status.rb', line 80 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
65 66 67 |
# File 'lib/ayadn/status.rb', line 65 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
59 60 61 |
# File 'lib/ayadn/status.rb', line 59 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
83 84 85 |
# File 'lib/ayadn/status.rb', line 83 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
71 72 73 |
# File 'lib/ayadn/status.rb', line 71 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
77 78 79 |
# File 'lib/ayadn/status.rb', line 77 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
62 63 64 |
# File 'lib/ayadn/status.rb', line 62 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
68 69 70 |
# File 'lib/ayadn/status.rb', line 68 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_repost ⇒ Object
236 237 238 |
# File 'lib/ayadn/status.rb', line 236 def self.not_your_repost "\nThis post isn't one of your reposts.\n\n".color(:red) end |
.not_your_starred ⇒ Object
239 240 241 |
# File 'lib/ayadn/status.rb', line 239 def self.not_your_starred "\nThis isn't one of your starred posts.\n\n".color(:red) end |
.pin_creds_saved ⇒ Object
206 207 208 |
# File 'lib/ayadn/status.rb', line 206 def self.pin_creds_saved "\n\nCredentials successfully encoded and saved in database.\n\n".color(:green) end |
.pin_password ⇒ Object
275 276 277 |
# File 'lib/ayadn/status.rb', line 275 def self.pin_password "\nPlease enter your Pinboard password (invisible, CTRL+C to cancel): ".color(:green) end |
.pin_username ⇒ Object
272 273 274 |
# File 'lib/ayadn/status.rb', line 272 def self.pin_username "Please enter your Pinboard username (CTRL+C to cancel): ".color(:green) end |
.post ⇒ Object
176 177 178 |
# File 'lib/ayadn/status.rb', line 176 def self.post "\n#{Settings.config[:post_max_length]} ".color(:yellow) + "characters maximum.\n" end |
.post_404(post_id) ⇒ Object
263 264 265 |
# File 'lib/ayadn/status.rb', line 263 def self.post_404(post_id) "\nImpossible to find #{post_id}. This post may have been deleted.\n".color(:red) end |
.posting ⇒ Object
17 18 19 |
# File 'lib/ayadn/status.rb', line 17 def self.posting "Posting to ADN...\n\n".inverse end |
.readline ⇒ Object
167 168 169 |
# File 'lib/ayadn/status.rb', line 167 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 |
.redirecting ⇒ Object
227 228 229 |
# File 'lib/ayadn/status.rb', line 227 def self.redirecting "\nPost is a repost. Redirecting...\n".color(:cyan) end |
.reducing(db) ⇒ Object
248 249 250 |
# File 'lib/ayadn/status.rb', line 248 def self.reducing db "\nPlease wait while Ayadn is pruning and compacting the #{db} database...\n".color(:cyan) end |
.reply ⇒ Object
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
173 174 175 |
# File 'lib/ayadn/status.rb', line 173 def self.reply "\n#{Settings.config[:post_max_length]} ".color(:yellow) + "characters maximum.\n" end |
.replying_to(post_id) ⇒ Object
164 165 166 |
# File 'lib/ayadn/status.rb', line 164 def self.(post_id) "\nReplying to post #{post_id}...\n".color(:green) end |
.reposted(post_id) ⇒ Object
101 102 103 |
# File 'lib/ayadn/status.rb', line 101 def self.reposted(post_id) "\nPost #{post_id} has been reposted.\n".color(:green) end |
.reposting(post_id) ⇒ Object
47 48 49 |
# File 'lib/ayadn/status.rb', line 47 def self.reposting(post_id) "\nReposting #{post_id}".inverse end |
.saving_pin ⇒ Object
209 210 211 |
# File 'lib/ayadn/status.rb', line 209 def self.saving_pin "\nSaving post text and links to Pinboard...\n\n".color(:yellow) end |
.starred(post_id) ⇒ Object
95 96 97 |
# File 'lib/ayadn/status.rb', line 95 def self.starred(post_id) "\nPost #{post_id} has been starred.\n".color(:green) end |
.starring(post_id) ⇒ Object
53 54 55 |
# File 'lib/ayadn/status.rb', line 53 def self.starring(post_id) "\nStarring #{post_id}".inverse end |
.stopped ⇒ Object
149 150 151 |
# File 'lib/ayadn/status.rb', line 149 def self.stopped "\n\nStopped.".color(:red) end |
.threshold ⇒ Object
254 255 256 |
# File 'lib/ayadn/status.rb', line 254 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
278 279 280 |
# File 'lib/ayadn/status.rb', line 278 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_missing ⇒ Object
197 198 199 |
# File 'lib/ayadn/status.rb', line 197 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
119 120 121 |
# File 'lib/ayadn/status.rb', line 119 def self.unblocked(username) "\nUser #{username} has been unblocked.\n".color(:green) end |
.unblocking(username) ⇒ Object
38 39 40 |
# File 'lib/ayadn/status.rb', line 38 def self.unblocking(username) "\nUnblocking #{username}".inverse end |
.unfollowed(username) ⇒ Object
107 108 109 |
# File 'lib/ayadn/status.rb', line 107 def self.unfollowed(username) "\nUser #{username} has been unfollowed.\n".color(:green) end |
.unfollowing(username) ⇒ Object
26 27 28 |
# File 'lib/ayadn/status.rb', line 26 def self.unfollowing(username) "\nUnfollowing #{username}".inverse end |
.unmuted(username) ⇒ Object
113 114 115 |
# File 'lib/ayadn/status.rb', line 113 def self.unmuted(username) "\nUser #{username} has been unmuted.\n".color(:green) end |
.unmuting(username) ⇒ Object
32 33 34 |
# File 'lib/ayadn/status.rb', line 32 def self.unmuting(username) "\nUnmuting #{username}".inverse end |
.unreposted(post_id) ⇒ Object
98 99 100 |
# File 'lib/ayadn/status.rb', line 98 def self.unreposted(post_id) "\nPost #{post_id} has been unreposted.\n".color(:green) end |
.unreposting(post_id) ⇒ Object
44 45 46 |
# File 'lib/ayadn/status.rb', line 44 def self.unreposting(post_id) "\nUnreposting #{post_id}".inverse end |
.unstarred(post_id) ⇒ Object
104 105 106 |
# File 'lib/ayadn/status.rb', line 104 def self.unstarred(post_id) "\nPost #{post_id} has been unstarred.\n".color(:green) end |
.unstarring(post_id) ⇒ Object
50 51 52 |
# File 'lib/ayadn/status.rb', line 50 def self.unstarring(post_id) "\nUnstarring #{post_id}".inverse end |
.uploading(files) ⇒ Object
13 14 15 16 |
# File 'lib/ayadn/status.rb', line 13 def self.uploading files files.length > 1 ? pl = "s" : pl = "" "\nUploading file#{pl} to ADN...".color(:cyan) end |
.user_404(username) ⇒ Object
260 261 262 |
# File 'lib/ayadn/status.rb', line 260 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
185 186 187 |
# File 'lib/ayadn/status.rb', line 185 def self.valid_colors(colors_list) "\nThe valid colors are: #{colors_list}\n".color(:cyan) end |
.writing ⇒ Object
152 153 154 |
# File 'lib/ayadn/status.rb', line 152 def self.writing "\nPosting as ".color(:cyan) + "#{Settings.config[:identity][:handle]}".color(:green) + ".".color(:cyan) end |
.wrong_arguments ⇒ Object
200 201 202 |
# File 'lib/ayadn/status.rb', line 200 def self.wrong_arguments "\nYou have to submit valid arguments.\n\n".color(:red) end |
.wtf ⇒ Object
224 225 226 |
# File 'lib/ayadn/status.rb', line 224 def self.wtf "\nSomething wrong happened. :(\n\n".color(:red) end |
.yourmessage ⇒ Object
158 159 160 |
# File 'lib/ayadn/status.rb', line 158 def self. "Your message:\n\n".color(:cyan) end |
.yourpost ⇒ Object
155 156 157 |
# File 'lib/ayadn/status.rb', line 155 def self.yourpost "Your post:\n\n".color(:cyan) end |