Skip to content

Commit 3820cf4

Browse files
author
Joselito Tapangan
committed
Update the function based from the instruction of Darin.
1 parent de24fd5 commit 3820cf4

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

lib/stackify/env_details.rb

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,7 @@ class EnvDetails
1111

1212

1313
def initialize
14-
@info = { 'Application root' => Dir.pwd, 'Environment' => 'development'}
15-
@request_details = {}
16-
@app_name = app_name
17-
app_location = Stackify.configuration.app_location || @info['Application root']
18-
@details = {
19-
'DeviceName' => Socket.gethostname,
20-
'AppLocation' => app_location,
21-
'AppName' => @app_name,
22-
'ConfiguredAppName' => @app_name,
23-
'ConfiguredEnvironmentName' =>@info['Environment']
24-
}
14+
set_env_properties
2515
end
2616

2717
def set_rails_info
@@ -32,7 +22,10 @@ def set_rails_info
3222
rescue NameError => exception
3323
return
3424
end
35-
rails_info = defined?(Rails) ? Rails::Info.properties.to_h : nil
25+
set_env_properties (defined?(Rails) ? Rails::Info.properties.to_h : nil)
26+
end
27+
28+
def set_env_properties (rails_info = nil)
3629
@info = rails_info || { 'Application root' => Dir.pwd, 'Environment' => 'development'}
3730
@request_details = {}
3831
@app_name = app_name

0 commit comments

Comments
 (0)