redmine-installer 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redmine-installer/steps/redmine_root.rb +23 -0
- data/lib/redmine-installer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39d85939c998462ecd8ca73cb36ea64265932493
|
4
|
+
data.tar.gz: e4a5149bd9e03b9bca73160e4d9788032e378219
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7b18f22182d1c9d291e4eaa49845c395cb98ac90b20d7147e94073b09ed282e4a0bbe2a3a2c28e94d08aaa0c86a7bae5339bcf2b81f89ae1f0843dd10574f47
|
7
|
+
data.tar.gz: b88825152385bea8eb96d8c6c0f82f35deaf28265adff233bd7752e3efc059334069de681b595ef15e61aad7b775890b4223bc8f80e2da8f566b2fee0abf3ed4
|
@@ -1,6 +1,10 @@
|
|
1
|
+
require 'find'
|
2
|
+
|
1
3
|
module Redmine::Installer::Step
|
2
4
|
class RedmineRoot < Base
|
3
5
|
|
6
|
+
CHECK_N_INACCESSIBLE_FILES = 10
|
7
|
+
|
4
8
|
def up
|
5
9
|
# Get redmine root
|
6
10
|
base.redmine_root ||= ask(:path_for_redmine_root, default: '.')
|
@@ -8,6 +12,10 @@ module Redmine::Installer::Step
|
|
8
12
|
# Make absolute path
|
9
13
|
base.redmine_root = File.expand_path(base.redmine_root)
|
10
14
|
|
15
|
+
if base.redmine_root == Dir.pwd
|
16
|
+
error "You cannot upgrade current dir. Please go to the different directory."
|
17
|
+
end
|
18
|
+
|
11
19
|
unless Dir.exist?(base.redmine_root)
|
12
20
|
try_create_dir(base.redmine_root)
|
13
21
|
end
|
@@ -15,6 +23,21 @@ module Redmine::Installer::Step
|
|
15
23
|
unless File.writable?(base.redmine_root)
|
16
24
|
error t(:dir_is_not_writeable, dir: base.redmine_root)
|
17
25
|
end
|
26
|
+
|
27
|
+
inaccessible_files = []
|
28
|
+
Find.find(base.redmine_root).each do |item|
|
29
|
+
if !File.writable?(item) || !File.readable?(item)
|
30
|
+
inaccessible_files << item
|
31
|
+
end
|
32
|
+
|
33
|
+
if inaccessible_files.size > CHECK_N_INACCESSIBLE_FILES
|
34
|
+
break
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
if inaccessible_files.any?
|
39
|
+
error "Redmine root contains inaccessible files. Make sure that all files in #{base.redmine_root} are readable/writeable. (limit #{CHECK_N_INACCESSIBLE_FILES} files: #{inaccessible_files.join(', ')})"
|
40
|
+
end
|
18
41
|
end
|
19
42
|
|
20
43
|
def save(configuration)
|
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: 1.0.
|
4
|
+
version: 1.0.6
|
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:
|
11
|
+
date: 2016-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansi
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.
|
206
|
+
rubygems_version: 2.5.1
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Easy way how install/upgrade redmine or plugin.
|