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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6952796bd301dde3ee7ca67d1c8f56d03b0df632
4
- data.tar.gz: 7f70e35b172302737ef4309d31067d08c3d309ef
3
+ metadata.gz: 39d85939c998462ecd8ca73cb36ea64265932493
4
+ data.tar.gz: e4a5149bd9e03b9bca73160e4d9788032e378219
5
5
  SHA512:
6
- metadata.gz: fddebfbfe71cc4c9a26283ac5a8242762548130849a1654f330cfda56a7ca1524c95993658fdafadae68807542606519d69f464e68f2ff0279f7780de5a615fd
7
- data.tar.gz: 5fa2b8a75e41b6c5cc71bd217c83c7a2f9ab2d7d05506b74e7b43bd01010164c60fc75e4623577d67d03b7677ee9e32ee0978dbd870be6528963747ef459221c
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)
@@ -1,5 +1,5 @@
1
1
  module Redmine
2
2
  module Installer
3
- VERSION = '1.0.5'
3
+ VERSION = '1.0.6'
4
4
  end
5
5
  end
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.5
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: 2015-07-15 00:00:00.000000000 Z
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.4.5
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.