Class: CiHelper::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/ci_helper/installer.rb

Overview

Responsible for create the setting file in the git repo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, user_setting) ⇒ Installer

Returns a new instance of Installer.



7
8
9
10
# File 'lib/ci_helper/installer.rb', line 7

def initialize(target, user_setting)
  @target = target
  @user_setting = user_setting
end

Instance Attribute Details

#targetObject (readonly)

Returns the value of attribute target.



5
6
7
# File 'lib/ci_helper/installer.rb', line 5

def target
  @target
end

#user_settingObject (readonly)

Returns the value of attribute user_setting.



5
6
7
# File 'lib/ci_helper/installer.rb', line 5

def user_setting
  @user_setting
end

Instance Method Details

#install_ci_helper_configObject



12
13
14
15
16
17
# File 'lib/ci_helper/installer.rb', line 12

def install_ci_helper_config
  ci_config_file = File.join(target, CiHelper::CONFIG_FILE_NAME)

  result = File.open(ci_config_file, 'w') { |f| f.write(user_setting.to_yaml)}
  puts 'intialize success You can run the montior now ' if result
end