lib/pair_see/seer.rb in pair_see-0.1.1 vs lib/pair_see/seer.rb in pair_see-0.1.2
- old
+ new
@@ -6,17 +6,27 @@
require_relative 'log_lines'
require_relative 'card'
attr_reader :log_lines, :devs, :dev_pairs, :card_prefix
- def initialize(log_lines, config_file)
- @log_lines = log_lines
- @devs = active_devs(config_file)
+ def initialize(options)
+ @log_lines = _lines_from(options[:repo_location], options[:after_date])
+ @devs = _active(options[:names])
+ @card_prefix = options[:card_prefix]
@dev_pairs = devs.combination(2)
- @card_prefix = get_card_prefix(config_file)
end
+ def _active(devs)
+ devs.select do |dev|
+ _is_active?(dev)
+ end
+ end
+
+ def _lines_from(repo, after_date)
+ LogLines.new(repo, after_date)
+ end
+
def cards_per_person
@devs.map do |dev|
{ dev => cards_dev_worked_on(log_lines, dev) }
end.inject({}) do |result, element|
result.merge(element)
@@ -69,14 +79,14 @@
def active_devs(config_file)
config = YAML.load_file(config_file)
devs_in_config = config['names'].split(' ')
devs_in_config.select do |dev|
- is_active(dev)
+ _is_active?(dev)
end
end
- def is_active(dev)
+ def _is_active?(dev)
log_lines.active? dev
end
def pair_commits
dev_pairs.map do |person1, person2|