Class: Languages
- Inherits:
-
Object
- Object
- Languages
- Defined in:
- lib/languages.rb
Class Method Summary collapse
Class Method Details
.current ⇒ Object
11 12 13 14 |
# File 'lib/languages.rb', line 11 def self.current langs = Dir.entries(File.join(File.dirname(__FILE__), "../app_generators")) langs.reject {|i| ((i == ".") or (i == ".."))} end |
.parse(args) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/languages.rb', line 3 def self.parse(args) lang = args.find {|arg| ((arg =~ /-l=/) or (arg =~ /--language=/)) } lang = "-l=ruby" if lang.nil? lang = lang.split('=')[1] raise "Supported languages: #{current.inspect}" if (!current.member?(lang)) lang end |
.print ⇒ Object
16 17 18 19 20 |
# File 'lib/languages.rb', line 16 def self.print list = "" current.each {|lang| list << lang << '|'} list.chomp('|') end |