Class: Pik::BatchFile

Inherits:
ScriptFile show all
Defined in:
lib/pik/scripts/batch_file.rb

Instance Attribute Summary

Attributes inherited from ScriptFile

#file_data, #file_name, #ruby_dir

Instance Method Summary collapse

Methods inherited from ScriptFile

#<<, #echo, #initialize, #path, #remove_line, #to_s, #write

Constructor Details

This class inherits a constructor from Pik::ScriptFile

Instance Method Details

#call(bat) ⇒ Object



15
16
17
18
# File 'lib/pik/scripts/batch_file.rb', line 15

def call(bat)
  @file_data << "CALL #{bat}\n"
  self
end

#extnameObject



5
6
7
# File 'lib/pik/scripts/batch_file.rb', line 5

def extname
  ".bat"
end

#headerObject



9
10
11
12
13
# File 'lib/pik/scripts/batch_file.rb', line 9

def header
  string =  "@ECHO OFF\n\n" 
  string << "::  This batch file generated by Pik, the\n"
  string << "::  Ruby Manager for Windows\n"  
end

#set(items) ⇒ Object



20
21
22
23
# File 'lib/pik/scripts/batch_file.rb', line 20

def set(items)
  items.each{|k,v| @file_data << "SET #{k}=#{v}" }
  self
end

#unset(*items) ⇒ Object



25
26
27
28
# File 'lib/pik/scripts/batch_file.rb', line 25

def unset(*items)
  items.flatten.each{|k| @file_data << "SET #{k}=" }
  self
end