Methods

Dotenv::Substitutions::Command

Public Class Methods

call(value, env) click to toggle source
# File lib/dotenv/substitutions/command.rb, line 16
def call(value, env)
  # Process interpolated shell commands
  value.gsub(INTERPOLATED_SHELL_COMMAND) do |*|
    command = $~[:cmd][1..-2] # Eliminate opening and closing parentheses

    if $~[:backslash]
      $~[0][1..-1]
    else
      `#{command}`.chomp
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.