<commit_before>class ListsController < ApplicationController
before_filter :authenticate_user!
  # GET /lists
  # GET /lists.xml
  def index
    @lists = List.all(:conditions=>{:user_id => current_user})
    @latest = List.all(:conditions=>{:share=>true}, :limit=>5)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @lists }
    end
  end

  # GET /lists/1
  # GET /lists/1.xml
  def show
    @list = List.find(params[:id])
    if @list.share == true || @list.user == current_user
      @tasks = Task.all(:conditions=>{:list_id => @list}, :order=>"status ASC, priority_id ASC")
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @list }
      end
    end
  end

  # GET /lists/new
  # GET /lists/new.xml
  def new<commit_msg>shared lists viewable by anyone, logged in or not<commit_after>class ListsController < ApplicationController
before_filter :authenticate_user!, :except => :show
  # GET /lists
  # GET /lists.xml
  def index
    @lists = List.all(:conditions=>{:user_id => current_user})
    @latest = List.all(:conditions=>{:share=>true}, :limit=>5)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @lists }
    end
  end

  # GET /lists/1
  # GET /lists/1.xml
  def show
    @list = List.find(params[:id])
    if @list.share == true || @list.user == current_user
      @tasks = Task.all(:conditions=>{:list_id => @list}, :order=>"status ASC, priority_id ASC")
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @list }
      end
    else
      flash[:notice] = "You must be logged in to view that."
      redirect_to new_user_session_path 
    end
  end

  # GET /lists/new
  # GET /lists/new.xml
  def new
{'fraction_non_alphanumeric': 0.1393939393939394, 'fraction_numerical': 0.003305785123966942, 'mean_word_length': 2.807127882599581, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '5812752', 'n_tokens_mistral': 618, 'n_tokens_neox': 603, 'n_words': 153}