Class: Torque::DateSettings
- Inherits:
-
Object
- Object
- Torque::DateSettings
- Defined in:
- lib/torque/date_settings.rb
Overview
Determines the date range for a release notes generation
Instance Method Summary collapse
-
#custom_date_range? ⇒ Boolean
True if the date range was set manually via command line, else false.
-
#get_dates ⇒ accept_from, accept_to
Generates the accept_from and accept_to dates if they don’t already exist.
-
#initialize(options, last_run_path, fs) ⇒ DateSettings
constructor
A new instance of DateSettings.
Constructor Details
#initialize(options, last_run_path, fs) ⇒ DateSettings
Returns a new instance of DateSettings.
13 14 15 16 17 18 19 20 21 |
# File 'lib/torque/date_settings.rb', line 13 def initialize(, last_run_path, fs) @options = @last_run_path = last_run_path @fs = fs @current_date = Date.today @beginning_of_time = Date.new(1900, 1, 1) @date_format = "%Y-%m-%d" end |
Instance Method Details
#custom_date_range? ⇒ Boolean
Returns True if the date range was set manually via command line, else false.
34 35 36 37 |
# File 'lib/torque/date_settings.rb', line 34 def custom_date_range? generate_dates if !@custom_date_range return @custom_date_range end |
#get_dates ⇒ accept_from, accept_to
Generates the accept_from and accept_to dates if they don’t already exist
27 28 29 30 |
# File 'lib/torque/date_settings.rb', line 27 def get_dates generate_dates if !@accept_from || !@accept_to return @accept_from, @accept_to end |