Permalink
Browse files

- Renamed some files to make Hoe happy

- Incremented version number
- Added Hoe declarations into rakefile
- Added guard statements after Numeric extensions
  • Loading branch information...
1 parent bf99ab1 commit 270e08ad44e56ed92496f12840793ed6b23dbe7a @texel committed Dec 11, 2008
Showing with 25 additions and 11 deletions.
  1. +3 −0 .gitignore
  2. 0 CHANGES → History.txt
  3. 0 README → README.txt
  4. +9 −0 Rakefile
  5. +13 −11 lib/runt.rb
View
@@ -0,0 +1,3 @@
+*.gemspec
+*.gem
+/target
View
File renamed without changes.
View
File renamed without changes.
View
@@ -3,6 +3,8 @@
begin
require 'rubygems'
require 'rake/gempackagetask'
+ require 'hoe'
+ require './lib/runt.rb'
rescue Exception
nil
end
@@ -14,6 +16,7 @@ require 'rake/contrib/sshpublisher'
require 'rake/contrib/rubyforgepublisher'
require 'fileutils'
+
#####################################################################
# Constants
#####################################################################
@@ -41,6 +44,12 @@ end
# build directory
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
#####################################################################
View
@@ -55,6 +55,8 @@
#
module Runt
+ VERSION = "0.7.1"
+
class << self
def day_name(number)
@@ -94,7 +96,7 @@ def ordinalize(number)
end
end
-
+
#Yes it's true, I'm a big idiot!
Sunday = Date::DAYNAMES.index("Sunday")
Monday = Date::DAYNAMES.index("Monday")
@@ -219,16 +221,16 @@ def date_precision
# somewhere else. :-)
#
class Numeric #:nodoc:
- def microseconds() Float(self * (10 ** -6)) end
- def milliseconds() Float(self * (10 ** -3)) end
- def seconds() self end
- def minutes() 60 * seconds end
- def hours() 60 * minutes end
- def days() 24 * hours end
- def weeks() 7 * days end
- def months() 30 * days end
- def years() 365 * days end
- def decades() 10 * years end
+ def microseconds() Float(self * (10 ** -6)) end unless self.instance_methods.include?('microseconds')
+ def milliseconds() Float(self * (10 ** -3)) end unless self.instance_methods.include?('milliseconds')
+ def seconds() self end unless self.instance_methods.include?('seconds')
+ def minutes() 60 * seconds end unless self.instance_methods.include?('minutes')
+ def hours() 60 * minutes end unless self.instance_methods.include?('hours')
+ def days() 24 * hours end unless self.instance_methods.include?('days')
+ def weeks() 7 * days end unless self.instance_methods.include?('weeks')
+ def months() 30 * days end unless self.instance_methods.include?('months')
+ def years() 365 * days end unless self.instance_methods.include?('years')
+ def decades() 10 * years end unless self.instance_methods.include?('decades')
# This causes RDoc to hurl:
%w[
microseconds milliseconds seconds minutes hours days weeks months years decades

0 comments on commit 270e08a

Please sign in to comment.