How to hide accesses to a mailbox when using mail in ruby?

There is a script that sends the results of work on mail via SMTP using the mail gem. The script I want to put in a public repository, but do not want to burn access to email. How to make better options of sending in a separate file to add it in .gitignore?
Send this:
options = { :address => "smtp.gmail.com",
 :port => 587,
 :domain => 'domain.com',
 :user_name => 'mail@domain.com',
 :password => 'mail_password',
 :authentication => 'plain',
 :enable_starttls_auto => true }

Mail.defaults do
 delivery_method :smtp, options
end

#Sending
Mail.deliver do
 from 'mail@domain.com'
 to 'admin@domain.com'
 subject 'some subject'
 html_part do
 content_type 'text/html; charset=UTF-8'
 body "#{html_mail}"
end
end
September 19th 19 at 00:10
3 answers
September 19th 19 at 00:12
Solution
In ruby to store configs usually use yaml. Read/write in this format is in the standard library of ruby
September 19th 19 at 00:14
Gem figaro to come. Remove the options in environment variables, and will be a joy :)
September 19th 19 at 00:16
In Rails 4.1 there is such a file as secrets.yml to store all this goodness. If the version is lower, it is really in individual .yml file and it to .gitignore.
A good version of the gem

Find more questions by tags Ruby