Class: Redmine::Installer::Step::LoadPackage
- Inherits:
-
Base
- Object
- Base
- Redmine::Installer::Step::LoadPackage
show all
- Defined in:
- lib/redmine-installer/steps/load_package.rb
Constant Summary
collapse
- SUPPORTED_ARCHIVE_FORMATS =
['.zip', '.gz', '.tgz']
- TAR_LONGLINK =
'././@LongLink'
- PROGRESSBAR_FORMAT =
'%a [%b>%i] %p%% %t'
Instance Attribute Summary
Attributes inherited from Base
#base, #index, #ran
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #load, #print_footer, #print_header, #print_title, #redmine_plugins, #save
Methods included from Utils
included
Instance Method Details
#down ⇒ Object
52
53
54
55
|
# File 'lib/redmine-installer/steps/load_package.rb', line 52
def down
FileUtils.remove_entry_secure(@tmpdir) if @tmpdir
FileUtils.safe_unlink(@tmpfile) if @tmpfile
end
|
#final ⇒ Object
57
58
59
60
|
# File 'lib/redmine-installer/steps/load_package.rb', line 57
def final
down
say(t(:redmine_was_installed_to, dir: base.redmine_root), 1)
end
|
#prepare ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/redmine-installer/steps/load_package.rb', line 17
def prepare
case base.options[:source]
when 'file'
unless File.exist?(base.package)
if base.package =~ /\Av?(\d\.\d\.\d)\Z/
download_redmine($1)
end
end
unless File.exist?(base.package)
error :file_not_exist, file: base.package
end
@type = File.extname(base.package)
unless SUPPORTED_ARCHIVE_FORMATS.include?(@type)
error :file_must_have_format, file: base.package, formats: SUPPORTED_ARCHIVE_FORMATS.join(', ')
end
when 'git'
nil
else
error :error_unsupported_source, source: base.options[:source]
end
end
|
#up ⇒ Object
43
44
45
46
47
48
49
50
|
# File 'lib/redmine-installer/steps/load_package.rb', line 43
def up
case base.options[:source]
when 'file'
load_from_archive
when 'git'
load_from_git
end
end
|