Class: OracleClientInstaller
- Inherits:
-
Object
- Object
- OracleClientInstaller
- Includes:
- Executable, ScriptLocator
- Defined in:
- lib/oracle_client_installer/version.rb,
lib/oracle_client_installer/oracle_client_installer.rb
Constant Summary collapse
- VERSION =
"1.0.2"
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#interpolator ⇒ Object
readonly
Returns the value of attribute interpolator.
-
#script_list ⇒ Object
readonly
Returns the value of attribute script_list.
Instance Method Summary collapse
-
#initialize(config_file_name) ⇒ OracleClientInstaller
constructor
A new instance of OracleClientInstaller.
- #install ⇒ Object
- #uninstall ⇒ Object
- #verify(&code) ⇒ Object
Constructor Details
#initialize(config_file_name) ⇒ OracleClientInstaller
Returns a new instance of OracleClientInstaller.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 11 def initialize config_file_name @interpolator = TextInterpolator.new @env = read_config(config_file_name) puts "ruby home: #{env[:ruby_home]}" puts "ruby_oci_version: #{env[:ruby_oci_version]}" puts "user: #{env[:user]}" @script_list = scripts(File.('scripts.sh', File.dirname(__FILE__))) end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 9 def env @env end |
#interpolator ⇒ Object (readonly)
Returns the value of attribute interpolator.
9 10 11 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 9 def interpolator @interpolator end |
#script_list ⇒ Object (readonly)
Returns the value of attribute script_list.
9 10 11 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 9 def script_list @script_list end |
Instance Method Details
#install ⇒ Object
23 24 25 26 27 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 23 def install run({:sudo => true, :capture_output => true}, "install", env) run({}, "install-ruby-oci8", env) end |
#uninstall ⇒ Object
29 30 31 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 29 def uninstall run({:sudo => true}, "uninstall", env) end |
#verify(&code) ⇒ Object
33 34 35 |
# File 'lib/oracle_client_installer/oracle_client_installer.rb', line 33 def verify &code run({}, "verify", env.merge(:cmd => code.call)) end |