Skip to content

Instantly share code, notes, and snippets.

@vertiginous
Created June 19, 2010 21:36
Show Gist options
  • Select an option

  • Save vertiginous/445300 to your computer and use it in GitHub Desktop.

Select an option

Save vertiginous/445300 to your computer and use it in GitHub Desktop.
module Pik
class BashFile < ScriptFile
attr_accessor :file_data, :file_name, :ruby_dir
def extname
".sh"
end
def header
string = "#!/bin/sh\n"
string << "# This bash script generated by Pik, the\n"
string << "# Ruby Manager for Windows\n"
end
def call(exe)
@file_data << "#{exe}\n"
self
end
def set(items)
items.each{|k,v|
v = v.to_bash if v.respond_to? 'to_bash'
@file_data << "export #{k}='#{v}'" }
self
end
def unset(items)
items.each{|k| @file_data << "export #{k}=" }
self
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment