Class: Redmine::Installer::Plugin::EmailSending
- Defined in:
- lib/redmine-installer/plugins/email_sending.rb
Direct Known Subclasses
Constant Summary collapse
- CONFIGURATION_YML_PATH =
'config/configuration.yml'
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #build ⇒ Object
- #delivery_method ⇒ Object
-
#delivery_settings ⇒ Object
Build ConfigParams.
-
#initialize ⇒ EmailSending
constructor
A new instance of EmailSending.
- #make_config(redmine_root) ⇒ Object
Methods inherited from Base
Methods included from Utils
Constructor Details
#initialize ⇒ EmailSending
Returns a new instance of EmailSending.
8 9 10 11 12 |
# File 'lib/redmine-installer/plugins/email_sending.rb', line 8 def initialize @params = Redmine::Installer::ConfigParams.new @params.add('user_name') @params.add('password').hide(true) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/redmine-installer/plugins/email_sending.rb', line 6 def params @params end |
Instance Method Details
#build ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/redmine-installer/plugins/email_sending.rb', line 14 def build { 'default' => { 'email_delivery' => { 'delivery_method' => delivery_method, "#{delivery_method}_settings" => delivery_settings } } } end |
#delivery_method ⇒ Object
31 32 33 |
# File 'lib/redmine-installer/plugins/email_sending.rb', line 31 def delivery_method :smtp end |
#delivery_settings ⇒ Object
Build ConfigParams
36 37 38 39 40 41 42 43 |
# File 'lib/redmine-installer/plugins/email_sending.rb', line 36 def delivery_settings settings = {} @params.each do |param| next if param.value.empty? settings[param.name] = param.value end settings end |
#make_config(redmine_root) ⇒ Object
25 26 27 28 29 |
# File 'lib/redmine-installer/plugins/email_sending.rb', line 25 def make_config(redmine_root) File.open(File.join(redmine_root, CONFIGURATION_YML_PATH), 'w') do |f| f.puts(YAML.dump(build)) end end |