Class: Action::CLI::ListDumps

Inherits:
Object
  • Object
show all
Includes:
InchCI::Action
Defined in:
app/services/action/cli/list_dumps.rb

Constant Summary collapse

LANGUAGES =
%w(elixir nodejs)

Instance Method Summary collapse

Methods included from InchCI::Action

#exposures, included

Constructor Details

#initialize(params) ⇒ ListDumps


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/services/action/cli/list_dumps.rb', line 12

def initialize(params)
  @languages = LANGUAGES

  if @language = params[:language]
    glob = File.join(dump_dir, '**/*.json')
    @filenames = filter_by_language(basenames_by_glob(glob))
    @dates = {}
    @filenames.each do |filename|
      date = filename =~ /\/(\d+)\// && $1
      unless date.nil?
        @dates[date] ||= []
        @dates[date] << filename
      end
    end
  end
end