File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ After you install stackify-api-ruby you need to run the generator:
3636
3737The generator creates a file 'config/initializers/stackify.rb' configuring stackify-api-ruby with your API key. You can change default settings there.
3838
39+ In your 'config/initializers/stackify.rb' file don't forget to add 'Stackify::EnvDetails.instance.set_rails_info'
40+
3941### Non-Rails
4042
4143For using stackify-api-ruby gem within any Ruby application add to top of your main file:
Original file line number Diff line number Diff line change @@ -11,6 +11,20 @@ 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+ }
25+ end
26+
27+ def set_rails_info
1428 rails_info = defined? ( Rails ) ? Rails ::Info . properties . to_h : nil
1529 @info = rails_info || { 'Application root' => Dir . pwd , 'Environment' => 'development' }
1630 @request_details = { }
You can’t perform that action at this time.
0 commit comments