Created
December 20, 2012 15:31
-
-
Save Catsquotl/4345965 to your computer and use it in GitHub Desktop.
basic initialize method to separate command line options from filenames.
args should become ARGV in the implementation
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
def initialize *args | |
@files = [] | |
@switches = [] | |
until args.first.to_s.include?('-') == false | |
tmp_switch = args.shift | |
@switches.push(tmp_switch) | |
end | |
until args.empty? | |
tmp_file = args.shift | |
@files.push(tmp_file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment