Class: Xezat::Command::Announce

Inherits:
Object
  • Object
show all
Includes:
Xezat
Defined in:
lib/xezat/command/announce.rb

Constant Summary

Constants included from Xezat

Xezat::CONFIG_FILE, DATA_DIR, REPOSITORY_DIR, ROOT_DIR, TEMPLATE_DIR, VERSION

Instance Method Summary collapse

Methods included from Xezat

#config, #packages, #print_yaml, #variables

Constructor Details

#initialize(options, cygport) ⇒ Announce

Returns a new instance of Announce.



10
11
12
13
# File 'lib/xezat/command/announce.rb', line 10

def initialize(options, cygport)
  @options = options
  @cygport = cygport
end

Instance Method Details

#executeObject



15
16
17
18
19
# File 'lib/xezat/command/announce.rb', line 15

def execute
  variables = variables(@cygport)
  erb = File.expand_path(File.join(TEMPLATE_DIR, 'announce.erb'))
  print ERB.new(File.readlines(erb).join(nil), trim_mode: '%-').result(binding).chop # remove redundant new line
end