lib/hoe.rb in hoe-3.1.1 vs lib/hoe.rb in hoe-3.2.0
- old
+ new
@@ -89,11 +89,11 @@
class Hoe
include Rake::DSL if defined?(Rake::DSL)
# duh
- VERSION = '3.1.1'
+ VERSION = '3.2.0'
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
:publish, :gemcutter, :signing, :test]
@bad_plugins = []
@@ -805,15 +805,17 @@
def require_ruby_version version
spec_extras[:required_ruby_version] = version
end
##
- # Provide a linear degrading value from n to m over start to finis dates.
+ # Provide a linear degrading value from n to m over start to finis
+ # dates. If not provided, start and finis will default to 1/1 and
+ # 12/31 of the current year.
- def timebomb n, m, finis = '2010-04-01', start = '2009-03-14'
+ def timebomb n, m, finis = nil, start = nil
require 'time'
- finis = Time.parse finis
- start = Time.parse start
+ finis = Time.parse(finis || "#{Time.now.year}-12-31")
+ start = Time.parse(start || "#{Time.now.year}-01-01")
rest = (finis - Time.now)
full = (finis - start)
[((n - m) * rest / full).to_i + m, m].max
end