redmine-installer 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 525718299dda12ef91b9d72e068c57dbb76cdd6bd64c912655ebfa6b7bfc2a6b
4
- data.tar.gz: daa66c51c307b3a64c8dd98f39bae50b5040620299a1a4be54b6b52d948bbd86
3
+ metadata.gz: ec96d4984b4c45e21344787cd394b022d02bd4d856e5b8a4b2bd2460d4cb24a2
4
+ data.tar.gz: 58b94762b3e044099d45336fafbe878f16eac2fe6d0b964f96ead4c30cbdfdb9
5
5
  SHA512:
6
- metadata.gz: a3806697afbfb76fcfc8ff203cd41f1eb0d7f22429fe7fc2695b99c2d2a56a9d2734f8df3fc19bc96e162c359a35d1509e79561dfba99637ba654629918c4344
7
- data.tar.gz: b86c957b30ace57e6d3f787ce789a84c088cb366c454fefb380e45c27768c8a1f70062fd2c03f1fb598ac582b4de35a7679fb321242448c7629b9e1759a5b178
6
+ metadata.gz: f119d9a2243485cb25c3c42272be9a83470faa73ebde07f59a17eafe7bdb239e9f4a20b12e784b47130d322508a9fd72de956c26dd85ff9b61cdd9ecdd335fb3
7
+ data.tar.gz: 2d636c5c2ae93e696437e50f875fc739d3e5f45377f88c28378ebda481d29b18717c477e0f416a1eac732d1f617852f2d8a176c3265cb8219f56b7501580cf29
@@ -33,7 +33,7 @@ module RedmineInstaller
33
33
  end
34
34
 
35
35
  def get_parameters
36
- @username = prompt.ask('Username:', required: true)
36
+ @user_name = prompt.ask('Username:', required: true)
37
37
  @password = prompt.mask('Password:', required: true)
38
38
  end
39
39
 
@@ -66,10 +66,11 @@ module RedmineInstaller
66
66
  settings['port'] = @port
67
67
 
68
68
  # Optional
69
- settings['authentication'] = @authentication unless @authentication.to_s.empty?
69
+ settings['authentication'] = @authentication.to_sym unless @authentication.to_s.empty?
70
70
  settings['domain'] = @domain unless @domain.to_s.empty?
71
71
  settings['user_name'] = @user_name unless @user_name.to_s.empty?
72
72
  settings['password'] = @password unless @password.to_s.empty?
73
+ settings['tls'] = @enable_tls unless @enable_tls.to_s.empty?
73
74
  settings['enable_starttls_auto'] = @enable_starttls unless @enable_starttls.to_s.empty?
74
75
  settings['openssl_verify_mode'] = @openssl_verify unless @openssl_verify.to_s.empty?
75
76
 
@@ -77,7 +78,7 @@ module RedmineInstaller
77
78
  end
78
79
 
79
80
  def to_s
80
- "<#{class_name} #{@username}@#{@address}:#{@port}>"
81
+ "<#{class_name} #{@user_name}@#{@address}:#{@port}>"
81
82
  end
82
83
 
83
84
  end
@@ -115,6 +116,7 @@ module RedmineInstaller
115
116
  @domain = prompt.ask('Domain:')
116
117
  @authentication = prompt.ask('Authentication:')
117
118
  @openssl_verify = prompt.ask('Openssl verify mode:')
119
+ @enable_tls = prompt.yes?('Enable tls?:', default: false)
118
120
  @enable_starttls = prompt.yes?('Enable starttls?:', default: true)
119
121
  end
120
122
 
@@ -1,3 +1,3 @@
1
1
  module RedmineInstaller
2
- VERSION = '2.2.3'
2
+ VERSION = '2.2.4'
3
3
  end
@@ -27,13 +27,53 @@ module InstallerHelper
27
27
  # @process.write("\r\n")
28
28
  end
29
29
 
30
+ def go_up
31
+ @process.write("\e[A")
32
+ end
33
+
30
34
  def go_down
31
35
  # write(TTY::Reader::Keys.keys[:down])
32
36
  # write("\e[B")
33
37
  @process.write("\e[B")
34
38
  end
35
39
 
36
- def expected_successful_configuration
40
+ def email_username
41
+ 'username'
42
+ end
43
+
44
+ def email_password
45
+ 'password'
46
+ end
47
+
48
+ def email_address
49
+ 'address'
50
+ end
51
+
52
+ def email_port
53
+ '123'
54
+ end
55
+
56
+ def email_domain
57
+ 'domain'
58
+ end
59
+
60
+ def email_authentication
61
+ 'plain'
62
+ end
63
+
64
+ def email_openssl_verify_mode
65
+ 'none'
66
+ end
67
+
68
+ def email_enable_tls
69
+ false
70
+ end
71
+
72
+ def email_enable_starttls
73
+ true
74
+ end
75
+
76
+ def expected_successful_configuration(email: false)
37
77
  expected_output('Creating database configuration')
38
78
  expected_output('What database do you want use?')
39
79
  expected_output('‣ MySQL')
@@ -62,8 +102,44 @@ module InstallerHelper
62
102
 
63
103
  expected_output('Creating email configuration')
64
104
  expected_output('Which service to use for email sending?')
65
- expected_output('‣ Nothing')
66
- select_choice
105
+
106
+ if email
107
+ go_up
108
+ go_up
109
+ go_up
110
+ expected_output('‣ Custom configuration (SMTP)')
111
+ select_choice
112
+
113
+ expected_output('Username:')
114
+ write(email_username)
115
+
116
+ expected_output('Password:')
117
+ write(email_password)
118
+
119
+ expected_output('Address:')
120
+ write(email_address)
121
+
122
+ expected_output('Port:')
123
+ write(email_port)
124
+
125
+ expected_output('Domain:')
126
+ write(email_domain)
127
+
128
+ expected_output('Authentication:')
129
+ write(email_authentication)
130
+
131
+ expected_output('Openssl verify mode:')
132
+ write(email_openssl_verify_mode)
133
+
134
+ expected_output('Enable tls?: (y/N)')
135
+ write(email_enable_tls ? 'y' : 'n')
136
+
137
+ expected_output('Enable starttls?: (Y/n)')
138
+ write(email_enable_starttls ? 'y' : 'n')
139
+ else
140
+ expected_output('‣ Nothing')
141
+ select_choice
142
+ end
67
143
  end
68
144
 
69
145
  def expected_successful_installation_or_upgrade(db_creating: false, after_create: nil)
@@ -103,6 +179,24 @@ module InstallerHelper
103
179
  end
104
180
  end
105
181
 
182
+ def expected_email_configuration
183
+ Dir.chdir(@redmine_root) do
184
+ configuration = YAML.load_file('config/configuration.yml')['default']['email_delivery']
185
+ smtp_settings = configuration['smtp_settings']
186
+
187
+ expect(configuration['delivery_method']).to eq(:smtp)
188
+ expect(smtp_settings['address']).to eq(email_address)
189
+ expect(smtp_settings['port']).to eq(email_port.to_i)
190
+ expect(smtp_settings['authentication']).to eq(email_authentication.to_sym)
191
+ expect(smtp_settings['domain']).to eq(email_domain)
192
+ expect(smtp_settings['user_name']).to eq(email_username)
193
+ expect(smtp_settings['password']).to eq(email_password)
194
+ expect(smtp_settings['tls']).to eq(email_enable_tls)
195
+ expect(smtp_settings['enable_starttls_auto']).to eq(email_enable_starttls)
196
+ expect(smtp_settings['openssl_verify_mode']).to eq(email_openssl_verify_mode)
197
+ end
198
+ end
199
+
106
200
  def wait_for_stdin_buffer
107
201
  sleep 0.5
108
202
  end
@@ -59,10 +59,11 @@ RSpec.describe RedmineInstaller::Install, command: 'install' do
59
59
 
60
60
  expected_output('Extracting redmine package')
61
61
 
62
- expected_successful_configuration
62
+ expected_successful_configuration(email: true)
63
63
  expected_successful_installation
64
64
 
65
65
  expected_redmine_version('3.4.5')
66
+ expected_email_configuration
66
67
  end
67
68
 
68
69
  it 'download redmine', args: ['v3.4.5'] do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine-installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Moravčík
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-08 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander