lib/holidays/definition/context/generator.rb
def clean_year_ranges(year_ranges)
          year_ranges.collect do |year_range|
            if year_range["between"]
              range = year_range["between"]
              if range.is_a?(String)
                year_range["between"] = Range.new(*range.split("..").map(&:to_i))
              end
            end

            year_range
          end
        end
# In this case we end up parsing a range as "2006..2008" a string. This is codifying
# what we already do...today we parse as a string but when writing out to our final
# generated files it comes out as a range that Ruby interprets. This just puts it in stone
# what we want to do.
In this case we end up parsing a range as "2006..2008" a string. This is codifying
what we already do...today we parse as a string but when writing out to our final
generated files it comes out as a range that Ruby interprets. This just puts it in stone
what we want to do.
In this case we end up parsing a range as " 2006 .. 2008 " a string . This is codifying what we already do ... today we parse as a string but when writing out to our final generated files it comes out as a range that Ruby interprets . This just puts it in stone what we want to do .
def clean_year_ranges(year_ranges)
          year_ranges.collect do |year_range|
            if year_range["between"]
              range = year_range["between"]
              if range.is_a?(String)
                year_range["between"] = Range.new(*range.split("..").map(&:to_i))
              end
            end
            year_range
          end
        end
def clean_year_ranges ( year_ranges ) year_ranges . collect do | year_range | if year_range [ "between" ] range = year_range [ "between" ] if range . is_a? ( String ) year_range [ "between" ] = Range . new ( * range . split ( ".." ) . map ( & :to_i ) ) end end year_range end end
In this case we end up parsing a range as "2006..2008" a string.
In this case we end up parsing a range as " 2006 .. 2008 " a string .
year_ranges