Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence warnings #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/ice_cube/deprecated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Deprecated
def deprecated_alias(name, replacement)
# Create a wrapped version
define_method(name) do |*args, &block|
warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0]
#warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0]
send replacement, *args, &block
end
end
Expand All @@ -21,15 +21,15 @@ def deprecated(name, replacement)
alias_method old_name, name
# And replace it with a wrapped version
define_method(name) do |*args, &block|
warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0]
#warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0]
send old_name, *args, &block
end
end

def self.schedule_options(schedule, options)
if options[:start_date_override]
warn "IceCube: :start_date_override option is deprecated " \
"(use a block: `{|s| s.start_time = override }`)", caller[0]
#warn "IceCube: :start_date_override option is deprecated " \
# "(use a block: `{|s| s.start_time = override }`)", caller[0]
schedule.start_time = options[:start_date_override]
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/ice_cube/parsers/hash_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def normalize_keys(hash)
data = IceCube::FlexibleHash.new(hash.dup)

if (start_date = data.delete(:start_date))
warn "IceCube: :start_date is deprecated, please use :start_time at: #{ caller[0] }"
#warn "IceCube: :start_date is deprecated, please use :start_time at: #{ caller[0] }"
data[:start_time] = start_date
end

{:rdates => :rtimes, :exdates => :extimes}.each do |old_key, new_key|
if (times = data.delete(old_key))
warn "IceCube: :#{old_key} is deprecated, please use :#{new_key} at: #{ caller[0] }"
#warn "IceCube: :#{old_key} is deprecated, please use :#{new_key} at: #{ caller[0] }"
(data[new_key] ||= []).concat times
end
end
Expand Down Expand Up @@ -61,7 +61,7 @@ def apply_rrules(schedule, data)

def apply_exrules(schedule, data)
return unless data[:exrules]
warn "IceCube: :exrules is deprecated, and will be removed in a future release. at: #{ caller[0] }"
#warn "IceCube: :exrules is deprecated, and will be removed in a future release. at: #{ caller[0] }"
data[:exrules].each do |h|
rrule = h.is_a?(IceCube::Rule) ? h : IceCube::Rule.from_hash(h)

Expand Down
4 changes: 2 additions & 2 deletions lib/ice_cube/time_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.match_zone(input_time, reference)
def self.ensure_time(time, reference = nil, date_eod = false)
case time
when DateTime
warn "IceCube: DateTime support is deprecated (please use Time) at: #{ caller[2] }"
#warn "IceCube: DateTime support is deprecated (please use Time) at: #{ caller[2] }"
Time.local(time.year, time.month, time.day, time.hour, time.min, time.sec)
when Date
if date_eod
Expand Down Expand Up @@ -134,7 +134,7 @@ def self.hash(time)
def self.restore_deserialized_offset(time, orig_offset_str)
return time if time.respond_to?(:time_zone) ||
time.getlocal(orig_offset_str).utc_offset == time.utc_offset
warn "IceCube: parsed Time from nonlocal TZ. Use ActiveSupport to fix DST at: #{ caller[0] }"
#warn "IceCube: parsed Time from nonlocal TZ. Use ActiveSupport to fix DST at: #{ caller[0] }"
time.localtime(orig_offset_str)
end

Expand Down