Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for Git Bash. Some code cleanup. Fixed up use specs
- Loading branch information
1 parent
a9af535
commit 450e07d
Showing
12 changed files
with
144 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
I happened to need to add after this line:
unset GEM_HOME
unset GEM_PATH
for pik to properly set my gems when switching rubies. Although, I have just tested it with ruby 1.9.2 and 1.8.7.