From c1184febae94aa9a4d59589fc48aecc57d2c210f Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 22 Aug 2007 00:03:52 +0000 Subject: [PATCH] missing rdoc commit --- lib/help.rb | 2 +- lib/pastie.rb | 2 +- lib/sake.rb | 19 ++++++++++++++++--- lib/server.rb | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/help.rb b/lib/help.rb index 45ce358..ca94994 100644 --- a/lib/help.rb +++ b/lib/help.rb @@ -1,5 +1,5 @@ class Sake - module Help + module Help #:nodoc: extend self def display diff --git a/lib/pastie.rb b/lib/pastie.rb index e436e57..e45b029 100644 --- a/lib/pastie.rb +++ b/lib/pastie.rb @@ -1,6 +1,6 @@ require 'tempfile' -class Pastie +class Pastie #:nodoc: all PASTE_URL = ENV['SAKE_PASTIE_URL'] || ENV['PASTIE_URL'] || 'http://pastie.caboo.se/pastes/create' def self.paste(text) diff --git a/lib/sake.rb b/lib/sake.rb index 1d19008..02589ab 100644 --- a/lib/sake.rb +++ b/lib/sake.rb @@ -70,7 +70,7 @@ # $ sake -S -d # class Sake - module Version + module Version #:nodoc: Major = '1' Minor = '0' Tweak = '10' @@ -267,6 +267,8 @@ def run_rake # tasks = TasksFile.parse('Rakefile').tasks # task = tasks['db:remigrate'] class TasksArray < Array + ## + # Accepts a task name or index. def [](name_or_index) if name_or_index.is_a? String detect { |task| task.name == name_or_index } @@ -432,12 +434,17 @@ def to_ruby end ## - # String-ish duck typing + # String-ish duck typing, sorting based on Task names def <=>(other) to_s <=> other.to_s end + ## + # The task name def to_s; @name end + + ## + # Basically to_s.inspect def inspect; @name.inspect end end @@ -455,10 +462,14 @@ def method_missing(*args, &block) tasks_file.send(*args, &block) end + ## + # A TaskFile object of our Store def tasks_file @tasks_file ||= TasksFile.parse(path) end + ## + # The platform-aware path to the Store def path path = if PLATFORM =~ /win32/ win32_path @@ -469,7 +480,7 @@ def path path end - def win32_path + def win32_path #:nodoc: unless File.exists?(win32home = ENV['HOMEDRIVE'] + ENV['HOMEPATH']) puts "# No HOMEDRIVE or HOMEPATH environment variable.", "# Sake needs to know where it should save Rake tasks!" @@ -478,6 +489,8 @@ def win32_path end end + ## + # Wrote our current tasks_file to disk, overwriting the current Store. def save! File.open(path, 'w') do |file| file.puts tasks_file.to_ruby diff --git a/lib/server.rb b/lib/server.rb index 7029ceb..cf00508 100644 --- a/lib/server.rb +++ b/lib/server.rb @@ -2,7 +2,7 @@ require 'mongrel' class Sake - module Server + module Server #:nodoc:all extend self def start(args)