lib/timeliness.rb in timeliness-0.2.0 vs lib/timeliness.rb in timeliness-0.3.0

- old
+ new

@@ -1,19 +1,20 @@ require 'date' require 'forwardable' require 'timeliness/helpers' -require 'timeliness/formats' +require 'timeliness/definitions' +require 'timeliness/format' require 'timeliness/format_set' require 'timeliness/parser' require 'timeliness/version' module Timeliness class << self extend Forwardable def_delegators Parser, :parse, :_parse - def_delegators Formats, :add_formats, :remove_formats, :use_us_formats, :use_euro_formats + def_delegators Definitions, :add_formats, :remove_formats, :use_us_formats, :use_euro_formats attr_accessor :default_timezone, :date_for_time_type, :ambiguous_year_threshold end # Default timezone. Options: # - :local (default) @@ -24,11 +25,11 @@ # - 'Zone name' # @default_timezone = :local # Set the default date part for a time type values. - @date_for_time_type = [ 2000, 1, 1 ] + @date_for_time_type = lambda { Time.now } def self.date_for_time_type case @date_for_time_type when Array @date_for_time_type @@ -47,6 +48,6 @@ # year = '30' is considered 1930 # @ambiguous_year_threshold = 30 end -Timeliness::Formats.compile_formats +Timeliness::Definitions.compile_formats