Permalink
Browse files

first git commit

  • Loading branch information...
0 parents commit c7934375e2717f5026f239468d3ea290f78238a7 @jmettraux committed Apr 7, 2008
Showing with 993 additions and 0 deletions.
  1. +8 −0 CHANGELOG.txt
  2. +21 −0 LICENSE.txt
  3. +151 −0 README.txt
  4. +120 −0 Rakefile
  5. +39 −0 lib/rufus/rtm.rb
  6. +101 −0 lib/rufus/rtm/base.rb
  7. +122 −0 lib/rufus/rtm/credentials.rb
  8. +347 −0 lib/rufus/rtm/resources.rb
  9. +80 −0 test/tasks_test.rb
  10. +4 −0 test/test.rb
@@ -0,0 +1,8 @@
+
+= rufus-rtm CHANGELOG.txt
+
+
+== rufus-rtm - 0.1 released 2008/02/14
+
+- initial release
+
@@ -0,0 +1,21 @@
+
+Copyright (c) 2008, John Mettraux, jmettraux@gmail.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
@@ -0,0 +1,151 @@
+
+= rufus-rtm
+
+
+== getting it
+
+ sudo gem install -y rufus-rtm
+
+or at
+
+http://rubyforge.org/frs/?group_id=4812
+
+
+== credentials
+
+'rufus-rtm' expects to find RTM credentials in the environment. It will look for :
+
+* RTM_API_KEY
+* RTM_SHARED_SECRET
+* RTM_FROB
+* RTM_AUTH_TOKEN
+
+You have to apply for the first two ones at http://www.rememberthemilk.com/services/api/keys.rtm
+
+Once you have the API key and the shared secret, you have to get the frob and the auth token. Fire your 'irb' and
+
+ >> require 'rubygems'
+ >> require 'rufus/rtm'
+
+ please visit this URL with your browser and then hit 'enter' :
+
+ http://www.rememberthemilk.com/services/auth/?api_sig=70036e47c38da170fee431f04e29e8f0&frob=fa794036814b78fddf3e5641fe7c37f80e7d91fc&perms=delete&api_key=7f07e4fc5a944bf8c02a7d1e45c79346
+
+visit, the given URL, you should finally be greeted by a message like "You have successfully authorized the application API Application. You may now close this window and continue the authentication process with the application that sent you here.", hit enter...
+
+ ok, now getting auth token...
+
+ here are your RTM_FROB and RTM_AUTH_TOKEN, make sure to place them
+ in your environment :
+
+ export RTM_FROB=3cef465718317b837eec2faeb5340fe777d55c7c
+ export RTM_AUTH_TOKEN=ca0022d705ea1831543b7cdd2d7e3d707a0e1efb
+
+make then sure that all the 4 variables are set in the environment you use for running 'rufus-rtm'.
+
+
+== usage
+
+ require 'rubygems'
+ require 'rufus/rtm'
+
+ #
+ # listing tasks
+
+ tasks = Task.find
+ # finding all the tasks
+
+ tasks = Task.find :filter => "status:incomplete"
+ # finding all the incomplete tasks
+
+ tasks.each do |task|
+
+ puts "task id #{task.task_id}"
+ puts " #{task.name} (#{task.tags.join(",")})"
+ puts
+ end
+
+ #
+ # adding a task
+
+ task = Task.add! "study this rufus-rtm gem"
+ # gets added to the 'Inbox' by default
+
+ puts "task id is #{task.task_id}"
+
+ #
+ # enumerating lists
+
+ lists = List.find
+
+ w = lists.find { |l| l.name == 'Work' }
+
+ puts "my Work list id is #{w.list_id}"
+
+ #
+ # adding a task to a list
+
+ task = Task.add! "work, more work", w.list_id
+
+ #
+ # completing a task
+
+ task.complete!
+
+ #
+ # deleting a task
+
+ task.delete!
+
+
+Note that the methods that change the state of the Remember The Milk dataset have names ending with an exclamation mark.
+
+Note as well that, there is a 1 second delay before any request to the RTM server, in order to respect their conditions. This may change in future releases.
+
+
+= features yet to implement
+
+* tags modifications
+* smart lists
+* ...
+
+
+= dependencies
+
+The gem 'rufus-verbs' (http://rufus.rubyforge.org/rufus-verbs)
+
+
+== mailing list
+
+On the rufus-ruby list[http://groups.google.com/group/rufus-ruby] :
+
+ http://groups.google.com/group/rufus-ruby
+
+
+== issue tracker
+
+http://rubyforge.org/tracker/?atid=18584&group_id=4812&func=browse
+
+
+== source
+
+http://github.com/jmettraux/rufus-rtm
+
+ git clone git://github.com/jmettraux/rufus-rtm.git
+
+
+== author
+
+John Mettraux, jmettraux@gmail.com
+http://jmettraux.wordpress.com
+
+
+== the rest of Rufus
+
+http://rufus.rubyforge.org
+
+
+== license
+
+MIT
+
120 Rakefile
@@ -0,0 +1,120 @@
+
+require 'rubygems'
+
+require 'rake'
+require 'rake/clean'
+require 'rake/packagetask'
+require 'rake/gempackagetask'
+require 'rake/rdoctask'
+require 'rake/testtask'
+
+
+RUFUS_RTM_VERSION = "0.1"
+
+#
+# GEM SPEC
+
+spec = Gem::Specification.new do |s|
+
+ s.name = "rufus-rtm"
+ s.version = RUFUS_RTM_VERSION
+ s.authors = [ "John Mettraux" ]
+ s.email = "jmettraux@gmail.com"
+ s.homepage = "http://rufus.rubyforge.org/rufus-rtm"
+ s.platform = Gem::Platform::RUBY
+ s.summary = "yet another RememberTheMilk wrapper"
+ #s.license = "MIT"
+
+ s.require_path = "lib"
+ #s.autorequire = "rufus-rtm"
+ s.test_file = "test/test.rb"
+ s.has_rdoc = true
+ s.extra_rdoc_files = [ 'README.txt' ]
+
+ [ 'rufus-verbs' ].each do |d|
+ s.requirements << d
+ s.add_dependency d
+ end
+
+ files = FileList[ "{bin,docs,lib,test}/**/*" ]
+ files.exclude "rdoc"
+ s.files = files.to_a
+end
+
+#
+# tasks
+
+CLEAN.include("pkg", "html", "rdoc")
+
+task :default => [ :clean, :repackage ]
+
+
+#
+# TESTING
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << "test"
+ t.test_files = FileList['test/test.rb']
+ t.verbose = true
+end
+
+#
+# PACKAGING
+
+Rake::GemPackageTask.new(spec) do |pkg|
+ #pkg.need_tar = true
+end
+
+Rake::PackageTask.new("rufus-rtm", RUFUS_RTM_VERSION) do |pkg|
+
+ pkg.need_zip = true
+ pkg.package_files = FileList[
+ "Rakefile",
+ "*.txt",
+ "lib/**/*",
+ "test/**/*"
+ ].to_a
+ #pkg.package_files.delete("MISC.txt")
+ class << pkg
+ def package_name
+ "#{@name}-#{@version}-src"
+ end
+ end
+end
+
+
+#
+# DOCUMENTATION
+
+#ALLISON=`allison --path`
+ALLISON="/Library/Ruby/Gems/1.8/gems/allison-2.0.3/lib/allison.rb"
+
+Rake::RDocTask.new do |rd|
+
+ rd.main = "README.txt"
+
+ rd.rdoc_dir = "html/rufus-rtm"
+
+ rd.rdoc_files.include(
+ "README.txt", "CHANGELOG.txt", "LICENSE.txt", "lib/**/*.rb")
+
+ rd.title = "rufus-rtm rdoc"
+
+ rd.options << '-N' # line numbers
+ rd.options << '-S' # inline source
+
+ rd.template = ALLISON if File.exist?(ALLISON)
+end
+
+
+#
+# WEBSITE
+
+task :upload_website => [ :clean, :rdoc ] do
+
+ account = "jmettraux@rubyforge.org"
+ webdir = "/var/www/gforge-projects/rufus"
+
+ sh "rsync -azv -e ssh html/rufus-rtm #{account}:#{webdir}/"
+end
+
@@ -0,0 +1,39 @@
+
+#
+#--
+# Copyright (c) 2008, John Mettraux, jmettraux@gmail.com
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# (MIT license)
+#++
+#
+
+#
+# John Mettraux
+#
+# Made in Japan
+#
+# 2008/02/07
+#
+
+require 'rufus/rtm/base'
+require 'rufus/rtm/credentials'
+require 'rufus/rtm/resources'
+
Oops, something went wrong.

0 comments on commit c793437

Please sign in to comment.