<commit_before>class ArticlesController < ApplicationController
  cache_sweeper :blog_sweeper, :only => "comment"
  
  before_filter :verify_user_exists
  before_filter :verify_config
  
  def index
    @pages = Paginator.new self, Article.count, 10, @params['page']
    @articles = Article.find(:all,  :condition => 'published!=0',  :order => 'articles.created_at DESC', :limit => 10, :offset => @pages.current.offset)
  end
  
  def search
    @articles = Article.search(@params["q"])
  end
  
  def read    
    @article      = Article.find(@params["id"], :include => [:categories])    
    @comment      = Comment.new
    @page_title   = @article.title

    fill_from_cookies(@comment)    
  end
    
  def permalink
    @article    = Article.find_by_permalink(@params["year"], @params["month"], @params["day"], @params["title"])
    @comment    = Comment.new

    fill_from_cookies(@comment)    
    
    if @article.nil?
      error("Post not found..")
    else
      @page_title = @article.title
      render_action "read"<commit_msg>Fixed condititions of ArticleController#index to properly hide unpublished articles<commit_after>class ArticlesController < ApplicationController
  cache_sweeper :blog_sweeper, :only => "comment"
  
  before_filter :verify_user_exists
  before_filter :verify_config
  
  def index
    @pages = Paginator.new self, Article.count, 10, @params['page']
    @articles = Article.find(:all, :conditions => 'published != 0',  :order => 'articles.created_at DESC', :limit => 10, :offset => @pages.current.offset)
  end
  
  def search
    @articles = Article.search(@params["q"])
  end
  
  def read    
    @article      = Article.find(@params["id"], :include => [:categories])    
    @comment      = Comment.new
    @page_title   = @article.title

    fill_from_cookies(@comment)    
  end
    
  def permalink
    @article    = Article.find_by_permalink(@params["year"], @params["month"], @params["day"], @params["title"])
    @comment    = Comment.new

    fill_from_cookies(@comment)    
    
    if @article.nil?
      error("Post not found..")
    else
      @page_title = @article.title
      render_action "read"
{'fraction_non_alphanumeric': 0.13324048282265552, 'fraction_numerical': 0.004642525533890436, 'mean_word_length': 3.31, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6630956', 'n_tokens_mistral': 691, 'n_tokens_neox': 662, 'n_words': 144}