Class: Pik::PsFile
- Inherits:
-
ScriptFile
- Object
- ScriptFile
- Pik::PsFile
- Defined in:
- lib/pik/scripts/ps_file.rb
Instance Attribute Summary collapse
-
#file_data ⇒ Object
Returns the value of attribute file_data.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#ruby_dir ⇒ Object
Returns the value of attribute 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 Attribute Details
#file_data ⇒ Object
Returns the value of attribute file_data.
5 6 7 |
# File 'lib/pik/scripts/ps_file.rb', line 5 def file_data @file_data end |
#file_name ⇒ Object
Returns the value of attribute file_name.
5 6 7 |
# File 'lib/pik/scripts/ps_file.rb', line 5 def file_name @file_name end |
#ruby_dir ⇒ Object
Returns the value of attribute ruby_dir.
5 6 7 |
# File 'lib/pik/scripts/ps_file.rb', line 5 def ruby_dir @ruby_dir end |
Instance Method Details
#call(exe) ⇒ Object
16 17 18 19 |
# File 'lib/pik/scripts/ps_file.rb', line 16 def call(exe) @file_data << "#{exe}\n" self end |
#extname ⇒ Object
7 8 9 |
# File 'lib/pik/scripts/ps_file.rb', line 7 def extname ".ps1" end |
#header ⇒ Object
11 12 13 14 |
# File 'lib/pik/scripts/ps_file.rb', line 11 def header string = "# This powshell script generated by Pik, the\n" string << "# Ruby Manager for Windows\n" end |
#set(items) ⇒ Object
21 22 23 24 |
# File 'lib/pik/scripts/ps_file.rb', line 21 def set(items) items.each{|k,v| @file_data << "$ENV:#{k}=\"#{v}\"" } self end |
#unset(items) ⇒ Object
26 27 28 29 |
# File 'lib/pik/scripts/ps_file.rb', line 26 def unset(items) items.each{|k| @file_data << "Remove-Item ENV:#{k}" } self end |