Skip to content

Commit

Permalink
Moved CHANGELOG to History.txt. Added descriptions for all the comman…
Browse files Browse the repository at this point in the history
…d line modes. Refreshed the manifest of files. Removed the command.rb file as it is no longer needed. Updated the version number.
  • Loading branch information
jnunemaker committed Jul 23, 2008
1 parent d02d233 commit 0dae822
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 316 deletions.
53 changes: 0 additions & 53 deletions CHANGELOG

This file was deleted.

62 changes: 58 additions & 4 deletions History.txt
@@ -1,4 +1,58 @@
== 0.0.1 2008-03-12

* 1 major enhancement:
* Initial release
0.2.8 - July 22, 2008
* complete rewrite of CLI. Now supports multiple accounts and changing between them.
* added source, truncated, in_reply_to_status_id, in_reply_to_user_id, and favorited to Twitter::Status
* added protected to Twitter::User
* d CLI method now takes standard input like post
0.2.7 - June 29, 2008
* added #rate_limit_status (Daniel Morrison)
* added source parameter option to Base#post
* added twittergem as source when posting from command line
* Twitter::RateExceeded raised when you hit your limit (Jim O'Leary)
* Twitter::Unavailable raised when twitter returns 503
* Twitter::CantConnect is now more descriptive as to what is the problem when it is raised during a request
* quoting your message when using twitter post on the command line is now optional (Benoit Caccinolo)
* aliased post to p on command line so it's shorter (Benoit Caccinolo)
* unescaped html and added some color in command line view (Miles Z. Sterrett)
* added gemspec (technoweenie, Miles Z. Sterrett)
* Fixed stack trace error on first command line operation (Matt Rose)
0.2.6 - April 2, 2008
* found a more simple way of doing stdin without any extra gem dependencies
0.2.5 - April 2, 2008
* Command line interface can now use stdin for posting (ideas and example code from Jeremy Friesen)
$ twitter post 'test without stdin' # => twitters: test without stdin
$ echo 'test with stdin' | twitter post 'and an argv[1]' # => twitters: test with stdin and an argv[1]
$ echo 'test with stdin without any argv[1]' | twitter post # => twitters: test with stdin without any argv[1]
0.2.4 - Mar 31, 2008
* Added lite option to friends and followers, which doesn't include the user's current status (Daniel Morrison)
* Updated since option to use HTTP header, and added the option on timeline() and replies(). (Daniel Morrison)
0.2.3 - Jan 16, 2008
* added d to command line interface twitter d jnunemaker 'hola' (Humbucker)
* added progress dots when posting for confirmation when twitter is running slow (Hendy Irawan)
0.2.2 - added leave and follow which are new twitter api methods for turning notifications on and off
0.2.0 - Aug 4, 2007
* added sent_messages
* alias direct_messages to received_messages
* added create_friendship
* added destroy_friendship
* added featured to retrieve the featured twitter users
* added replies
* added destroy to destroy a status by id
* added status to find a status by id
* added active support as an extra dependency
* implemented d method to send direct messages (jnewland)
* fixed since argument in direct_messages method (jnewland)
0.1.1 - May 20, 2007
* hpricot 0.5+ now supported; just a bug fix (Ryan Waldron is the man!)
0.1.0 - March 31, 2007
* added d method for creating direct messages (waiting for it to work as documented)
* added featured method for getting featured users statuses (waiting for it to work as documented)
* added direct_messages method
* added friends_for method
* added a few tests
* removed relative_created_at as it is deprecated
* separated out the call method into call, request and parse methods
0.0.5 - just a bit of code cleanup
0.0.4 - added :location, :description, :url, :profile_image_url to user class (Alex Payne)
0.0.3 - added a bit more informative message when things go wrong
0.0.2 - added the command line options i forgot to add (friend and follower); improved some docs
0.0.1 - initial release
10 changes: 8 additions & 2 deletions Manifest.txt
@@ -1,4 +1,3 @@
CHANGELOG
History.txt
License.txt
Manifest.txt
Expand All @@ -10,7 +9,14 @@ config/requirements.rb
examples/twitter.rb
lib/twitter.rb
lib/twitter/base.rb
lib/twitter/command.rb
lib/twitter/cli.rb
lib/twitter/cli/config.rb
lib/twitter/cli/helpers.rb
lib/twitter/cli/migrations/20080722194500_create_accounts.rb
lib/twitter/cli/migrations/20080722194508_create_tweets.rb
lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb
lib/twitter/cli/models/account.rb
lib/twitter/cli/models/tweet.rb
lib/twitter/direct_message.rb
lib/twitter/easy_class_maker.rb
lib/twitter/rate_limit_status.rb
Expand Down
25 changes: 22 additions & 3 deletions lib/twitter/cli.rb
Expand Up @@ -7,36 +7,39 @@
require 'highline/import'
require 'activerecord'
require 'sqlite3'
HighLine.track_eof = false

HighLine.track_eof = false
CLI_ROOT = File.expand_path(File.join(File.dirname(__FILE__), 'cli'))
require CLI_ROOT + '/config'
require CLI_ROOT + '/helpers'

Dir[CLI_ROOT + '/models/*.rb'].each { |m| require m }

include Twitter::CLI::Helpers

Main {
def run
puts 'This is where the help goes'
puts "twitter [command] --help for usage instructions."
puts "The available commands are: \n install, uninstall, add, remove, list, change, post, befriend, defriend, follow, leave, d and timeline."
end

mode 'install' do
description 'Creates the sqlite3 database and runs the migrations.'
def run
migrate
say 'Twitter installed.'
end
end

mode 'uninstall' do
description 'Removes the sqlite3 database. There is no undo for this.'
def run
FileUtils.rm(Twitter::CLI::Config[:database])
say 'Twitter gem uninstalled.'
end
end

mode 'add' do
description 'Adds a new twitter account to the database. Prompts for username and password.'
def run
account = Hash.new
say "Add New Account:"
Expand All @@ -60,6 +63,7 @@ def run
end

mode 'remove' do
description 'Removes a twitter account from the database. If username provided it removes that username else it prompts with list and asks for which one you would like to remove.'
argument( 'username' ) {
optional
description 'username of account you would like to remove'
Expand Down Expand Up @@ -92,6 +96,7 @@ def run
end

mode 'list' do
description 'Lists all the accounts that have been added and puts a * by the current one that is used for posting, etc.'
def run
do_work do
if Account.count == 0
Expand All @@ -107,6 +112,7 @@ def run
end

mode 'change' do
description 'Changes the current account being used for posting etc. to the username provided. If no username is provided, a list is presented and you can choose the account from there.'
argument( 'username' ) {
optional
description 'username of account you would like to switched to'
Expand Down Expand Up @@ -136,6 +142,10 @@ def run
end

mode 'post' do
description "Posts a message to twitter using the current account. The following are all valid examples from the command line:
$ twitter post 'my update'
$ twitter post my update with quotes
$ echo 'my update from stdin' | twitter post"
def run
do_work do
post = ARGV.size > 1 ? ARGV.join(" ") : ARGV.shift
Expand All @@ -154,6 +164,7 @@ def run
end

mode 'befriend' do
description "Allows you to add a user as a friend"
argument('username') {
required
description 'username or id of twitterrer to befriend'
Expand All @@ -169,6 +180,7 @@ def run
end

mode 'defriend' do
description "Allows you to remove a user from being a friend"
argument('username') {
required
description 'username or id of twitterrer to defriend'
Expand All @@ -184,6 +196,7 @@ def run
end

mode 'follow' do
description "Allows you to turn on notifications for a user"
argument('username') {
required
description 'username or id of twitterrer to follow'
Expand All @@ -199,6 +212,7 @@ def run
end

mode 'leave' do
description "Allows you to turn off notifications for a user"
argument('username') {
required
description 'username or id of twitterrer to leave'
Expand All @@ -214,6 +228,10 @@ def run
end

mode 'd' do
description "Allows you to direct message a user. The following are all valid examples from the command line:
$ twitter d jnunemaker 'yo homeboy'
$ twitter d jnunemaker yo homeboy
$ echo 'yo homeboy' | twitter d jnunemaker"
argument('username') {
required
description 'username or id of twitterrer to direct message'
Expand All @@ -230,6 +248,7 @@ def run
end

mode 'timeline' do
description "Allows you to view your timeline, your friends or the public one"
argument( 'timeline' ) {
description 'the timeline you wish to see (friends, public, me)'
default 'friends'
Expand Down

0 comments on commit 0dae822

Please sign in to comment.