Module: Clicoder::Helper

Included in:
SiteBase
Defined in:
lib/clicoder.rb

Instance Method Summary collapse

Instance Method Details

#detect_mainObject



13
14
15
# File 'lib/clicoder.rb', line 13

def detect_main
  Dir.glob('main.*').first
end

#ext_to_language_name(ext) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/clicoder.rb', line 17

def ext_to_language_name(ext)
  @map ||= {
    cpp: 'C++',
    cc: 'C++',
    c: 'C',
    java: 'JAVA',
    cs: 'C#',
    d: 'D',
    rb: 'Ruby',
    py: 'Python',
    php: 'PHP'
  }
  return @map[ext.gsub(/^\./, '').to_sym]
end