Skip to content

Commit

Permalink
- Renamed some files to make Hoe happy
Browse files Browse the repository at this point in the history
- Incremented version number
- Added Hoe declarations into rakefile
- Added guard statements after Numeric extensions
  • Loading branch information
Leigh Caplan committed Dec 11, 2008
1 parent bf99ab1 commit 270e08a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
*.gemspec
*.gem
/target
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions Rakefile
Expand Up @@ -3,6 +3,8 @@
begin begin
require 'rubygems' require 'rubygems'
require 'rake/gempackagetask' require 'rake/gempackagetask'
require 'hoe'
require './lib/runt.rb'
rescue Exception rescue Exception
nil nil
end end
Expand All @@ -14,6 +16,7 @@ require 'rake/contrib/sshpublisher'
require 'rake/contrib/rubyforgepublisher' require 'rake/contrib/rubyforgepublisher'
require 'fileutils' require 'fileutils'



##################################################################### #####################################################################
# Constants # Constants
##################################################################### #####################################################################
Expand Down Expand Up @@ -41,6 +44,12 @@ end
# build directory # build directory
TARGET_DIR = "target" TARGET_DIR = "target"


# Trying to auto-build with Hoe.
Hoe.new('runt', PKG_VERSION) do |p|
p.rubyforge_name = 'Runt' # if different than lowercase project name
p.developer('Matthew Lipper', 'mlipper@gmail.com')
end

##################################################################### #####################################################################
# Targets # Targets
##################################################################### #####################################################################
Expand Down
24 changes: 13 additions & 11 deletions lib/runt.rb
Expand Up @@ -55,6 +55,8 @@
# #
module Runt module Runt


VERSION = "0.7.1"

class << self class << self


def day_name(number) def day_name(number)
Expand Down Expand Up @@ -94,7 +96,7 @@ def ordinalize(number)
end end


end end

#Yes it's true, I'm a big idiot! #Yes it's true, I'm a big idiot!
Sunday = Date::DAYNAMES.index("Sunday") Sunday = Date::DAYNAMES.index("Sunday")
Monday = Date::DAYNAMES.index("Monday") Monday = Date::DAYNAMES.index("Monday")
Expand Down Expand Up @@ -219,16 +221,16 @@ def date_precision
# somewhere else. :-) # somewhere else. :-)
# #
class Numeric #:nodoc: class Numeric #:nodoc:
def microseconds() Float(self * (10 ** -6)) end def microseconds() Float(self * (10 ** -6)) end unless self.instance_methods.include?('microseconds')
def milliseconds() Float(self * (10 ** -3)) end def milliseconds() Float(self * (10 ** -3)) end unless self.instance_methods.include?('milliseconds')
def seconds() self end def seconds() self end unless self.instance_methods.include?('seconds')
def minutes() 60 * seconds end def minutes() 60 * seconds end unless self.instance_methods.include?('minutes')
def hours() 60 * minutes end def hours() 60 * minutes end unless self.instance_methods.include?('hours')
def days() 24 * hours end def days() 24 * hours end unless self.instance_methods.include?('days')
def weeks() 7 * days end def weeks() 7 * days end unless self.instance_methods.include?('weeks')
def months() 30 * days end def months() 30 * days end unless self.instance_methods.include?('months')
def years() 365 * days end def years() 365 * days end unless self.instance_methods.include?('years')
def decades() 10 * years end def decades() 10 * years end unless self.instance_methods.include?('decades')
# This causes RDoc to hurl: # This causes RDoc to hurl:
%w[ %w[
microseconds milliseconds seconds minutes hours days weeks months years decades microseconds milliseconds seconds minutes hours days weeks months years decades
Expand Down

0 comments on commit 270e08a

Please sign in to comment.