Sha256: 960c3bcccd3ca4877f12ef44d99b2c3e8cfcb0a09e9f44843992aadd1b5e3f5a

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

module GitStats
  module StatsView
    class ViewData
      include LazyHighCharts::LayoutHelper
      attr_reader :repo

      def initialize(repo)
        @repo = repo
      end

      def charts
        @charts ||= Charts::All.new(repo)
      end

      def render_partial(template_name, params = {})
        Template.new(template_name).render(self, params)
      end

      def asset_path(asset, active_page)
        Pathname.new("/assets/#{asset}").relative_path_from(Pathname.new("/#{active_page}").dirname)
      end

      def link_to(href, active_page)
        Pathname.new("/#{href}").relative_path_from(Pathname.new("/#{active_page}").dirname)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nova_git_stats-2.4.2 lib/git_stats/stats_view/view_data.rb
nova_git_stats-2.4.1 lib/git_stats/stats_view/view_data.rb
nova_git_stats-2.4.0 lib/git_stats/stats_view/view_data.rb
nova_git_stats-2.3.0 lib/git_stats/stats_view/view_data.rb