This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| months = [1,2,3,4,5,6,7,9,10,11,12].to_a.map { |month| Date.new(2018, month) } | |
| months = months.map { |month| month..month.end_of_month } | |
| months.inject([]) do |array, month| | |
| if array.present? && array.last.last + 1.day == month.first | |
| array.push(array.pop.first..month.last) | |
| else | |
| array.push(month) | |
| end | |
| end.map do |range| | |
| [range.first.strftime("%b '%y"), range.last.beginning_of_month.strftime("%b '%y")].join(" - ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin | |
| require 'bundler/inline' | |
| rescue LoadError => e | |
| $stderr.puts 'Bundler 1.10 or later is required. Please update Bundler' | |
| raise e | |
| end | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| # Activate the gem you are reporting the issue against. |