Class: RubyConfig::RuntimeBase
- Inherits:
-
Object
- Object
- RubyConfig::RuntimeBase
show all
- Defined in:
- lib/ruby_config/runtime_base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(install_path, tmp_path) ⇒ RuntimeBase
Returns a new instance of RuntimeBase.
7
8
9
10
|
# File 'lib/ruby_config/runtime_base.rb', line 7
def initialize(install_path, tmp_path)
@install_path = File.join(install_path, handle)
@tmp_path = tmp_path
end
|
Instance Attribute Details
#install_path ⇒ Object
Returns the value of attribute install_path.
5
6
7
|
# File 'lib/ruby_config/runtime_base.rb', line 5
def install_path
@install_path
end
|
#tmp_path ⇒ Object
Returns the value of attribute tmp_path.
5
6
7
|
# File 'lib/ruby_config/runtime_base.rb', line 5
def tmp_path
@tmp_path
end
|
Instance Method Details
#additional_library_path ⇒ Object
88
89
90
|
# File 'lib/ruby_config/runtime_base.rb', line 88
def additional_library_path
File.join(ruby_home_path, 'lib', 'ruby', 'site_ruby', major_version)
end
|
#already_installed? ⇒ Boolean
100
101
102
|
# File 'lib/ruby_config/runtime_base.rb', line 100
def already_installed?
Pathname.new(File.join(ruby_bin_path, 'ruby')).exist?
end
|
#archive_download_url ⇒ Object
download url of ruby runtime
46
47
48
|
# File 'lib/ruby_config/runtime_base.rb', line 46
def archive_download_url
raise "Not implemented yet!"
end
|
#archive_file_name ⇒ Object
name of ruby runtime archive
41
42
43
|
# File 'lib/ruby_config/runtime_base.rb', line 41
def archive_file_name
raise "Not implemented yet!"
end
|
#bash_alias ⇒ Object
hash (key: alias name, value: alias bash script)
65
|
# File 'lib/ruby_config/runtime_base.rb', line 65
def bash_alias;{};end
|
#default_library_path ⇒ Object
92
93
94
|
# File 'lib/ruby_config/runtime_base.rb', line 92
def default_library_path
File.join(ruby_home_path, 'lib', 'ruby', major_version)
end
|
#delete ⇒ Object
104
105
106
|
# File 'lib/ruby_config/runtime_base.rb', line 104
def delete
FileUtils.remove_entry_secure(@install_path)
end
|
#description ⇒ Object
55
56
57
|
# File 'lib/ruby_config/runtime_base.rb', line 55
def description
raise "Not implemented yet!"
end
|
#do_install ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/ruby_config/runtime_base.rb', line 12
def do_install
create_directory_structure
download_file_unless_exists(archive_file_name, archive_download_url)
install
cleanup_tmp_dir
end
|
#do_post_install ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'lib/ruby_config/runtime_base.rb', line 27
def do_post_install
post_install
install_rubygems unless File.exists?(gem_executable_path)
end
|
#gem_executable_path ⇒ Object
83
84
85
|
# File 'lib/ruby_config/runtime_base.rb', line 83
def gem_executable_path
File.join(ruby_bin_path, 'gem')
end
|
#gem_home_path ⇒ Object
75
76
77
|
# File 'lib/ruby_config/runtime_base.rb', line 75
def gem_home_path
File.join(@install_path, 'gem')
end
|
#handle ⇒ Object
technical name used to select runtime
51
52
53
|
# File 'lib/ruby_config/runtime_base.rb', line 51
def handle
raise "Not implemented yet!"
end
|
#install ⇒ Object
23
24
25
|
# File 'lib/ruby_config/runtime_base.rb', line 23
def install
raise "Not implemented yet!"
end
|
#major_version ⇒ Object
60
61
62
|
# File 'lib/ruby_config/runtime_base.rb', line 60
def major_version
'1.8'
end
|
#post_install ⇒ Object
called after install and runtime is enabled
37
38
|
# File 'lib/ruby_config/runtime_base.rb', line 37
def post_install
end
|
#ruby_bin_path ⇒ Object
71
72
73
|
# File 'lib/ruby_config/runtime_base.rb', line 71
def ruby_bin_path
File.join(ruby_home_path, 'bin')
end
|
#ruby_executable_path ⇒ Object
79
80
81
|
# File 'lib/ruby_config/runtime_base.rb', line 79
def ruby_executable_path
File.join(ruby_bin_path, 'ruby')
end
|
#ruby_home_path ⇒ Object
67
68
69
|
# File 'lib/ruby_config/runtime_base.rb', line 67
def ruby_home_path
File.join(@install_path, 'ruby')
end
|
#to_s ⇒ Object
96
97
98
|
# File 'lib/ruby_config/runtime_base.rb', line 96
def to_s
"#{description} [#{handle}]"
end
|