lib/et-orbi.rb in et-orbi-1.1.5 vs lib/et-orbi.rb in et-orbi-1.1.6
- old
+ new
@@ -7,11 +7,11 @@
require 'et-orbi/zone_aliases'
module EtOrbi
- VERSION = '1.1.5'
+ VERSION = '1.1.6'
#
# module methods
class << self
@@ -101,11 +101,11 @@
get_tzone(t.zone) ||
get_local_tzone(t)
z ||= t.zone
# pass the abbreviation anyway,
- # it will be used in resulting the error message
+ # it will be used in the resulting error message
EoTime.new(t, z)
end
def make_from_date(d, zone)
@@ -641,33 +641,35 @@
# https://en.wikipedia.org/wiki/ISO_8601
# Postel's law applies
#
def list_iso8601_zones(s)
- s.scan(
- %r{
- (?<=:\d\d)
- \s*
- (?:
- [-+]
- (?:[0-1][0-9]|2[0-4])
- (?:(?::)?(?:[0-5][0-9]|60))?
- (?![-+])
- |
- Z
- )
- }x
- ).collect(&:strip)
+ s
+ .scan(
+ %r{
+ (?<=:\d\d)
+ \s*
+ (?:
+ [-+]
+ (?:[0-1][0-9]|2[0-4])
+ (?:(?::)?(?:[0-5][0-9]|60))?
+ (?![-+])
+ |
+ Z
+ )
+ }x)
+ .collect(&:strip)
end
def list_olson_zones(s)
- s.scan(
- %r{
- (?<=\s|\A)
- (?:[A-Za-z][A-Za-z0-9+_-]+)
- (?:\/(?:[A-Za-z][A-Za-z0-9+_-]+)){0,2}
- }x)
+ s
+ .scan(
+ %r{
+ (?<=\s|\A)
+ (?:[A-Z][A-Za-z0-9+_-]+)
+ (?:\/(?:[A-Z][A-Za-z0-9+_-]+)){0,2}
+ }x)
end
def find_olson_zone(str)
list_olson_zones(str).each { |s| z = get_tzone(s); return z if z }