Class: GitStats::Generator

Inherits:
Object
  • Object
show all
Includes:
Inspector
Defined in:
lib/git_stats/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Inspector

#inspect, #pretty_print, #to_s

Constructor Details

#initialize(options) {|_self| ... } ⇒ Generator

Returns a new instance of Generator.

Yields:

  • (_self)

Yield Parameters:



14
15
16
17
18
19
20
21
22
23
# File 'lib/git_stats/generator.rb', line 14

def initialize(options)
  @path = validate_repo_path(options[:path])
  @out_path = File.expand_path(options[:out_path])

  @repo = GitData::Repo.new(options.merge(path: path))
  view_data = StatsView::ViewData.new(@repo)
  @view = StatsView::View.new(view_data, out_path)

  yield self if block_given?
end

Instance Attribute Details

#out_pathObject (readonly)

Returns the value of attribute out_path.



12
13
14
# File 'lib/git_stats/generator.rb', line 12

def out_path
  @out_path
end

#pathObject (readonly)

Returns the value of attribute path.



12
13
14
# File 'lib/git_stats/generator.rb', line 12

def path
  @path
end