Skip to content

Commit

Permalink
missing rdoc commit
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Aug 22, 2007
1 parent ccdd21b commit c1184fe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/help.rb
@@ -1,5 +1,5 @@
class Sake
module Help
module Help #:nodoc:
extend self

def display
Expand Down
2 changes: 1 addition & 1 deletion 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)
Expand Down
19 changes: 16 additions & 3 deletions lib/sake.rb
Expand Up @@ -70,7 +70,7 @@
# $ sake -S -d
#
class Sake
module Version
module Version #:nodoc:
Major = '1'
Minor = '0'
Tweak = '10'
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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!"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/server.rb
Expand Up @@ -2,7 +2,7 @@
require 'mongrel'

class Sake
module Server
module Server #:nodoc:all
extend self

def start(args)
Expand Down

0 comments on commit c1184fe

Please sign in to comment.