Created
June 19, 2010 21:36
-
-
Save vertiginous/445300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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