Skip to content

Commit

Permalink
Extract AutoHCK::Project#create_timestamp into a helper
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Chulak <[email protected]>
  • Loading branch information
Jedoku committed Feb 19, 2024
1 parent b271e63 commit 9c32e19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/auxiliary/time_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def time_diff(start, finish)
end

def timestamp
Time.now.strftime('%Y%m%d%H%M%S')
Time.now.strftime('%Y_%m_%d_%H_%M_%S')
end
end
end
7 changes: 2 additions & 5 deletions lib/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
require './lib/auxiliary/json_helper'
require './lib/auxiliary/id_gen'
require './lib/auxiliary/extra_software/manager'
require './lib/auxiliary/time_helper'

# AutoHCK module
module AutoHCK
Expand Down Expand Up @@ -113,7 +114,7 @@ def move_workspace_to(path)

def init_class_variables
@config = Json.read_json(CONFIG_JSON, @logger)
@timestamp = create_timestamp
@timestamp = timestamp
@engine_type = @config["#{@options.mode}_engine"]
@run_terminated = false
end
Expand Down Expand Up @@ -187,10 +188,6 @@ def check_run_termination
@github.handle_cancel
end

def create_timestamp
Time.now.strftime('%Y_%m_%d_%H_%M_%S')
end

def init_workspace
@workspace_path = [@config['workspace_path'], @engine_type,
@config['setupmanager']].join('/')
Expand Down

0 comments on commit 9c32e19

Please sign in to comment.