Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4619

How to use ENV Variables inside Ruby file in nested Object [closed]

$
0
0

Given the following File Content:

gitlab_rails['omniauth_providers'] = [    {        name: "oauth2_generic",        label: "Example",        app_id: "ENV_VARIABLE_HER",        app_secret: "ENV_VARIABLE_HERE",        args: {            client_options: {                site: "https://www.example.test",                user_info_url: "/api/v1/oauth/user",                authorize_url: "/oauth/authorize",                token_url: "/oauth/token",                ssl: {                    verify: false                }            },            user_response_structure: {                root_path: ['data'],                id_path: ['data', 'id'],                attributes: {                    email: "email",                    name: "name"                }            },            authorize_params: {                client_id: "ENV_VARIABLE_HERE",                redirect_uri: "https://git.example.test/users/auth/oauth2_generic/callback",                response_type: "code",                scope: ""            },            strategy_class: "OmniAuth::Strategies::OAuth2Generic"        }    }]

I would need to replace the "ENV_VARIABLE_HERE" with an actual ENV Variable. The following did work outside the Object or whatever it is calles in Ruby (was not able to find it out)

gitlab_rails['x'] = ENV['ENV_VARIABLE_HERE']this works!
gitlab_rails['x'] = [    {        something: ENV['ENV_VARIABLE_HERE']    }]

does not work!


Viewing all articles
Browse latest Browse all 4619

Trending Articles