lib/ayadn/app.rb in ayadn-1.6.0 vs lib/ayadn/app.rb in ayadn-1.7.0

- old
+ new

@@ -1,11 +1,11 @@ # encoding: utf-8 module Ayadn class App < Thor package_name "Ayadn" - %w{action stream api search descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug check nowplaying nowwatching tvshow}.each { |r| require_relative "#{r}" } + %w{action stream api search descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug check nowplaying nowwatching tvshow annotations}.each { |r| require_relative "#{r}" } ## # These methods are intended to be called from the CLI. desc "timeline", "Show your App.net timeline, aka the Unified Stream (-tl)" @@ -15,10 +15,11 @@ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def timeline Action.new.unified(options) end desc "checkins", "Show the Checkins Stream (-ck)" @@ -27,10 +28,11 @@ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def checkins Action.new.checkins(options) end desc "global", "Show the Global Stream (-gl)" @@ -39,10 +41,11 @@ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def global Action.new.global(options) end desc "trending", "Show the Trending Stream (-tr)" @@ -51,10 +54,11 @@ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def trending Action.new.trending(options) end desc "photos", "Show the Photos Stream (-ph)" @@ -63,10 +67,11 @@ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def photos Action.new.photos(options) end desc "conversations", "Show the Conversations Stream (-cq)" @@ -75,10 +80,11 @@ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def conversations Action.new.conversations(options) end desc "mentions @USERNAME", "Show posts containing a mention of @username (-m)" @@ -86,10 +92,11 @@ long_desc Descriptions.mentions option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def mentions(*username) Action.new.mentions(username, options) end desc "userposts @USERNAME", "Show posts by @username (-up)" @@ -97,10 +104,11 @@ long_desc Descriptions.posts option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def userposts(*username) Action.new.posts(username, options) end desc "interactions", "Show your recent ADN activity (-int)" @@ -142,10 +150,11 @@ map "-co" => :convo map "thread" => :convo option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream" option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force long_desc Descriptions.convo def convo(post_id) Action.new.convo(post_id, options) end @@ -184,10 +193,11 @@ desc "hashtag HASHTAG", "Show recent posts containing #HASHTAG (-t)" map "-t" => :hashtag long_desc Descriptions.hashtag option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw option :extract, aliases: "-e", type: :boolean, desc: Descriptions.options_extract + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def hashtag(hashtag) Action.new.hashtag(hashtag, options) end desc "search WORD(S)", "Show recents posts containing WORD(S) (-s)" @@ -195,10 +205,11 @@ long_desc Descriptions.search option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw option :extract, aliases: "-e", type: :boolean, desc: Descriptions.options_extract + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force option :messages, type: :boolean, desc: 'Search for WORD(S) in messages, including PMs.' option :users, type: :boolean, desc: 'Search for App.net users by searching WORD(S) in their bio/description.' option :channels, type: :boolean, desc: 'Search for App.net channels by searching WORD(S) in their description.' option :annotations, type: :boolean, desc: 'Search for posts containing a specific App.net annotation.' def search(*words) @@ -223,10 +234,11 @@ desc "postinfo POST", "Show detailed informations about a post (-pi)" map "-pi" => :postinfo long_desc Descriptions.postinfo option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw + option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force def postinfo(post_id) Action.new.postinfo(post_id, options) end desc "files", "List your files (-fl)" @@ -348,27 +360,36 @@ end desc "post Your text", "Simple post to App.net (-P)" map "-P" => :post long_desc Descriptions.post - option :embed, aliases: "-e", type: :array, desc: "Embed one or several pictures in the new post" + option :embed, aliases: "-E", type: :array, desc: "Embed one or several pictures in the new post" + option :youtube, aliases: "-Y", type: :array, desc: "Embed a Youtube video in the new post" + option :vimeo, aliases: "-V", type: :array, desc: "Embed a Vimeo video in the new post" + option :poster, aliases: "-M", type: :array, desc: "Embed a movie poster, from title, in the new post" def post(*args) Action.new.post(args, options) end desc "write", "Multi-line post to App.net (-W)" map "compose" => :write map "-W" => :write long_desc Descriptions.write - option :embed, aliases: "-e", type: :array, desc: "Embed one or several pictures in the new post" + option :embed, aliases: "-E", type: :array, desc: "Embed one or several pictures in the new post" + option :youtube, aliases: "-Y", type: :array, desc: "Embed a Youtube video in the new post" + option :vimeo, aliases: "-V", type: :array, desc: "Embed a Vimeo video in the new post" + option :poster, aliases: "-M", type: :array, desc: "Embed a movie poster, from title, in the new post" def write Action.new.write(options) end desc "pm @USERNAME", "Send a private message to @username" long_desc Descriptions.pmess - option :embed, aliases: "-e", type: :array, desc: "Embed one or several pictures in the new post" + option :embed, aliases: "-E", type: :array, desc: "Embed one or several pictures in the new post" + option :youtube, aliases: "-Y", type: :array, desc: "Embed a Youtube video in the new post" + option :vimeo, aliases: "-V", type: :array, desc: "Embed a Vimeo video in the new post" + option :poster, aliases: "-M", type: :array, desc: "Embed a movie poster, from title, in the new post" def pm(*username) Action.new.pmess(username, options) end desc "send CHANNEL", "Send a message to a CHANNEL (-C)" @@ -379,10 +400,13 @@ end desc "reply POST", "Reply to post nĀ°POST (-R)" map "-R" => :reply long_desc Descriptions.reply - option :embed, aliases: "-e", type: :array, desc: "Embed one or several pictures in the new post" + option :embed, aliases: "-E", type: :array, desc: "Embed one or several pictures in the new post" + option :youtube, aliases: "-Y", type: :array, desc: "Embed a Youtube video in the new post" + option :vimeo, aliases: "-V", type: :array, desc: "Embed a Vimeo video in the new post" + option :poster, aliases: "-M", type: :array, desc: "Embed a movie poster, from title, in the new post" def reply(id) ayadn = Action.new ayadn.reply(id, options) end