Sha256: c955db9e92eeb5c5c3f7b9ac4db270b12b518a38f80ea6e328898ef813b22918

Contents?: true

Size: 756 Bytes

Versions: 18

Compression:

Stored size: 756 Bytes

Contents

# -*- encoding : utf-8 -*-
module GitStats
  module StatsView
    class ViewData
      include ActionView::Helpers::TagHelper
      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

18 entries across 18 versions & 1 rubygems

Version Path
git_stats-1.0.17 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.16 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.15 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.14 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.13 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.12 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.11 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.10 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.9 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.8 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.7 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.6 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.5 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.4 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.3 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.2 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.1 lib/git_stats/stats_view/view_data.rb
git_stats-1.0.0 lib/git_stats/stats_view/view_data.rb