<commit_before>class Groups::HomeController < Groups::BaseController

  layout 'sidecolumn'
  helper 'groups/wikis', 'wikis/base', 'wikis/sections'
  permissions 'wikis'
  before_filter 'fetch_wikis'
  javascript :wiki
  stylesheet 'wiki_edit'

  def initialize(options = {})
    @group = options[:group]
  end

  before_filter :authorized?

  def show
    @pages = Page.paginate_by_path '/descending/updated_at/limit/30/',
      options_for_group(@group), pagination_params
  end

  protected

  def fetch_wikis
    if current_user.member_of? @group
      @private_wiki = @group.private_wiki
      @public_wiki = @group.public_wiki
      @wiki = coming_from_wiki?(@public_wiki) || !@private_wiki ? @public_wiki : @private_wiki
    else
      @wiki = @group.public_wiki
    end
  end

  helper_method :coming_from_wiki?
  # will return true if we came from the wiki editor, versions or diffs
  def coming_from_wiki?(wiki)
    return unless wiki and request.referer
    request.referer == edit_group_wiki_url(@group, wiki) or
    request.referer.index(root_url + 'wikis/' + wiki.to_param )
  end<commit_msg>groups: you shouldn't need to be logged in to view the home page.<commit_after>class Groups::HomeController < Groups::BaseController

  layout 'sidecolumn'
  helper 'groups/wikis', 'wikis/base', 'wikis/sections'
  permissions 'wikis'
  before_filter 'fetch_wikis'
  javascript :wiki
  stylesheet 'wiki_edit'

  def initialize(options = {})
    @group = options[:group]
  end

  def show
    @pages = Page.paginate_by_path '/descending/updated_at/limit/30/',
      options_for_group(@group), pagination_params
  end

  protected

  def fetch_wikis
    if current_user.member_of? @group
      @private_wiki = @group.private_wiki
      @public_wiki = @group.public_wiki
      @wiki = coming_from_wiki?(@public_wiki) || !@private_wiki ? @public_wiki : @private_wiki
    else
      @wiki = @group.public_wiki
    end
  end

  helper_method :coming_from_wiki?
  # will return true if we came from the wiki editor, versions or diffs
  def coming_from_wiki?(wiki)
    return unless wiki and request.referer
    request.referer == edit_group_wiki_url(@group, wiki) or
    request.referer.index(root_url + 'wikis/' + wiki.to_param )
  end
{'fraction_non_alphanumeric': 0.09803043867502238, 'fraction_numerical': 0.0017905102954341987, 'mean_word_length': 3.933774834437086, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '920092', 'n_tokens_mistral': 743, 'n_tokens_neox': 720, 'n_words': 173}