Class: Ixtlan::Gettext::Crawler

Inherits:
Object
  • Object
show all
Defined in:
lib/ixtlan/gettext/crawler.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.crawlObject



24
25
26
# File 'lib/ixtlan/gettext/crawler.rb', line 24

def self.crawl
  Crawler.new.crawl
end

Instance Method Details

#crawlObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ixtlan/gettext/crawler.rb', line 28

def crawl
  keys.clear
  Dir[File.join('app', '**', '*rb')].each do |f|
    File.read(f).each_line do |line|
      extract_key(line) if line =~ /_[ (]/
    end
  end
  keys.sort!
  keys.uniq!
  keys
end